From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4702 Path: news.gmane.org!not-for-mail From: John Mudd Newsgroups: gmane.linux.lib.musl.general Subject: Re: Build on linux 2.6 and run on linux 2.4? Date: Fri, 21 Mar 2014 15:48:31 -0400 Message-ID: References: <20140320231412.GG26358@brightrain.aerifal.cx> <20140321180204.GL26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c36ca8d90cc504f5232c61 X-Trace: ger.gmane.org 1395431336 6210 80.91.229.3 (21 Mar 2014 19:48:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2014 19:48:56 +0000 (UTC) Cc: musl To: Rich Felker Original-X-From: musl-return-4706-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 21 20:49:04 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WR5RA-0003j9-7E for gllmg-musl@plane.gmane.org; Fri, 21 Mar 2014 20:49:04 +0100 Original-Received: (qmail 1720 invoked by uid 550); 21 Mar 2014 19:49:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1712 invoked from network); 21 Mar 2014 19:49:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=4imIb+lNAmhxVhV/DhpK7sMWoWAW8j4yc/CgtFqZAH4=; b=jJNZUJaKNARyskhPa3Caj9QI1Dfzxz8Oq6QRk2Y1GFFXnZ1Q1x05dAqbUnod3ffJpn DAFJqSIXQIyI92Kqe5hvNHKmKjrrU3B0zx5oWW+Lo+DDQ2L5ntx2vbPyeOWJNNL6eIX/ +jJVEZLq+fw1eama5eWdND7HXjcIEWguiZ38Nb6is0ctRavDQG/c67rHC27R8/MCbJA6 CRXMzGic2oT9+BkrHIoHQ1wde4y+pliDH9VaAmuaMuHa4udFOqCQUbLwVKOY9+uE+n/t i0Hy7ZoDAIjLeQ/cfRnK8Eqzv0imoSVlDdS5LetsQeWlcnmAxDI/983YYz0OoJ/YGQZE LEJA== X-Received: by 10.112.201.1 with SMTP id jw1mr2448468lbc.47.1395431331923; Fri, 21 Mar 2014 12:48:51 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:4702 Archived-At: --001a11c36ca8d90cc504f5232c61 Content-Type: text/plain; charset=ISO-8859-1 $ getconf GNU_LIBPTHREAD_VERSION NPTL 0.60 $ So that's it, I lucked out? I can start building my apps on a modern Linux and still run on my older ones? If so then this is like being told time travel is possible. On Fri, Mar 21, 2014 at 2:24 PM, John Mudd wrote: > $ cat /etc/*-release > LSB_VERSION="1.3" > Red Hat Enterprise Linux AS release 3 (Taroon) > [jmudd@ares jmudd]$ lsb_release -a > LSB Version: 1.3 > Distributor ID: RedHatEnterpriseAS > Description: Red Hat Enterprise Linux AS release 3 (Taroon) > Release: 3 > Codename: Taroon > $ uname -mrs > Linux 2.4.21-4.EL i686 > $ cat /proc/version > Linux version 2.4.21-4.EL (bhcompile@daffy.perf.redhat.com) (gcc version > 3.2.3 20030502 (Red Hat Linux 3.2.3-20)) #1 Fri Oct 3 18:13:58 EDT 2003 > $ > > > logfile: > 25920 execve("/home/jmudd/test_threads2", ["test_threads2"], [/* 26 vars > */]) = 0 > 25920 rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0 > 25920 set_thread_area({entry_number:-1 -> 6, base_addr:0x804e540, > limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, > seg_not_present:0, useable:1}) = 0 > 25920 set_tid_address(0x804e558) = 25920 > 25920 mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb75ea000 > 25920 mprotect(0xb75eb000, 86016, PROT_READ|PROT_WRITE) = 0 > 25920 clone(child_stack=0xb75fff30, > flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, > parent_tidptr=0xb75fff58, {entry_number:6, base_addr:0xb75fff40, > limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, > seg_not_present:0, useable:1}, child_tidptr=0xb75fff58) = 25921 > 25920 mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb75d4000 > 25920 mprotect(0xb75d5000, 86016, PROT_READ|PROT_WRITE) = 0 > 25920 clone(child_stack=0xb75e9f30, > flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, > parent_tidptr=0xb75e9f58, {entry_number:6, base_addr:0xb75e9f40, > limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, > seg_not_present:0, useable:1}, child_tidptr=0xb75e9f58) = 25922 > 25920 futex(0xb75fff58, FUTEX_WAIT, 25921, NULL > 25922 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25922 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25920 <... futex resumed> ) = -1 EINTR (Interrupted system > call) > 25922 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25920 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25920 futex(0xb75fff58, FUTEX_WAIT, 25921, NULL > 25921 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25921 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25920 <... futex resumed> ) = -1 EINTR (Interrupted system > call) > 25921 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25920 --- SIGSTOP (Stopped (signal)) @ 0 (0) --- > 25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL > 25920 futex(0xb75fff58, FUTEX_WAIT, 25921, NULL > 25922 futex(0x804e0c4, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 futex(0x804e0e8, FUTEX_WAIT, 0, NULL > 25922 futex(0x804e0e8, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL > 25922 futex(0x804e0c4, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 > 25921 writev(1, [{"Counter value functionCount1: 1", 31}, {"\n", 1}], 2) = > 32 > 25921 futex(0x804e0e8, FUTEX_WAIT, 1, NULL > 25922 futex(0x804e0e8, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL > 25922 futex(0x804e0c4, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 writev(1, [{"Counter value functionCount1: 2", 31}, {"\n", 1}], 2) = > 32 > 25921 futex(0x804e0e8, FUTEX_WAIT, 2, NULL > 25922 futex(0x804e0e8, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL > 25922 futex(0x804e0c4, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 writev(1, [{"Counter value functionCount1: 3", 31}, {"\n", 1}], 2) = > 32 > 25921 futex(0x804e0e8, FUTEX_WAIT, 3, NULL > 25922 writev(1, [{"Counter value functionCount2: 4", 31}, {"\n", 1}], 2) = > 32 > 25922 writev(1, [{"Counter value functionCount2: 5", 31}, {"\n", 1}], 2) = > 32 > 25922 writev(1, [{"Counter value functionCount2: 6", 31}, {"\n", 1}], 2) = > 32 > 25922 writev(1, [{"Counter value functionCount2: 7", 31}, {"\n", 1}], 2) = > 32 > 25922 futex(0x804e0e8, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL > 25922 futex(0x804e0c4, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 writev(1, [{"Counter value functionCount1: 8", 31}, {"\n", 1}], 2) = > 32 > 25921 futex(0x804e0e8, FUTEX_WAIT, 4, NULL > 25922 futex(0x804e0e8, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL > 25922 futex(0x804e0c4, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 writev(1, [{"Counter value functionCount1: 9", 31}, {"\n", 1}], 2) = > 32 > 25921 futex(0x804e0e8, FUTEX_WAIT, 5, NULL > 25922 futex(0x804e0e8, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL > 25922 futex(0x804e0c4, FUTEX_WAKE, 1) = 1 > 25921 <... futex resumed> ) = 0 > 25921 writev(1, [{"Counter value functionCount1: 10", 32}, {"\n", 1}], 2) > = 33 > 25921 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0 > 25921 _exit(0) = ? > 25920 <... futex resumed> ) = 0 > 25920 munmap(0xb75ea000, 90112) = 0 > 25920 futex(0xb75e9f58, FUTEX_WAIT, 25922, NULL > 25922 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0 > 25922 _exit(0) = ? > 25920 <... futex resumed> ) = 0 > 25920 munmap(0xb75d4000, 90112) = 0 > 25920 writev(1, [{"Final count: 10", 15}, {"\n", 1}], 2) = 16 > 25920 exit_group(0) = ? > > > > On Fri, Mar 21, 2014 at 2:02 PM, Rich Felker wrote: > >> On Fri, Mar 21, 2014 at 01:54:34PM -0400, John Mudd wrote: >> > Here is the regular and strace output on 2.4 kernel, more specifically >> > Linux 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 >> GNU/Linux. >> > >> > $ test_threads2 >> > Counter value functionCount1: 1 >> > Counter value functionCount1: 2 >> > Counter value functionCount1: 3 >> > Counter value functionCount2: 4 >> > Counter value functionCount2: 5 >> > Counter value functionCount2: 6 >> > Counter value functionCount2: 7 >> > Counter value functionCount1: 8 >> > Counter value functionCount1: 9 >> > Counter value functionCount1: 10 >> > Final count: 10 >> > $ >> > >> > $ strace test_threads2 >> > execve("/home/jmudd/test_threads2", ["test_threads2"], [/* 26 vars */]) >> = 0 >> > rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0 >> > set_thread_area({entry_number:-1 -> 6, base_addr:0x804e540, >> limit:1048575, >> > seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, >> > seg_not_present:0, useable:1}) = 0 >> > set_tid_address(0x804e558) = 25884 >> > mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = >> 0xb75ea000 >> > mprotect(0xb75eb000, 86016, PROT_READ|PROT_WRITE) = 0 >> > clone(child_stack=0xb75fff30, >> > >> flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, >> > parent_tidptr=0xb75fff58, {entry_number:6, base_addr:0xb75fff40, >> > limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, >> limit_in_pages:1, >> > seg_not_present:0, useable:1}, child_tidptr=0xb75fff58) = 25885 >> > mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = >> 0xb75d4000 >> > mprotect(0xb75d5000, 86016, PROT_READ|PROT_WRITE) = 0 >> > clone(child_stack=0xb75e9f30, >> > >> flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, >> > parent_tidptr=0xb75e9f58, {entry_number:6, base_addr:0xb75e9f40, >> > limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, >> limit_in_pages:1, >> > seg_not_present:0, useable:1}, child_tidptr=0xb75e9f58) = 25886 >> > futex(0xb75fff58, FUTEX_WAIT, 25885, NULLCounter value functionCount1: 1 >> > Counter value functionCount1: 2 >> > Counter value functionCount1: 3 >> > Counter value functionCount2: 4 >> > Counter value functionCount2: 5 >> > Counter value functionCount2: 6 >> > Counter value functionCount2: 7 >> > Counter value functionCount1: 8 >> > Counter value functionCount1: 9 >> > Counter value functionCount1: 10 >> > ) = 0 >> > munmap(0xb75ea000, 90112) = 0 >> > munmap(0xb75d4000, 90112) = 0 >> > writev(1, [{"Final count: 10", 15}, {"\n", 1}], 2Final count: 10 >> > ) = 16 >> > exit_group(0) = ? >> > $ >> >> Is this a stock 2.4.x kernel or a distro-modified one that might have >> things backported from 2.6? >> >> Can you re-run the strace with: >> >> strace -f -o logfile test_threads2 >> >> -f is needed to trace anything but the main thread/original process, >> and -o to a file produces nicer output (pid/tid on each line) than the >> usual default. >> >> Rich >> > > --001a11c36ca8d90cc504f5232c61 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
$ getconf GNU_LIBPTHREAD_VERSION
NPTL 0.60<= /div>
$

So that's it, I lucked out? I can = start building my apps on a modern Linux and still run on my older ones? If= so then this is like being told time travel is possible.



On Fri, Mar 21, 2014 at 2:24 PM, John Mudd <johnbmudd@gmail.com<= /a>> wrote:
$ cat /etc/*-rele= ase
LSB_VERSION=3D"1.3"
Red Hat Enterprise Li= nux AS release 3 (Taroon)
[jmudd@ares jmudd]$ lsb_release -a
LSB Version: =A0 =A01.3
Distributor ID: RedHatEnterpriseAS
Description: =A0 =A0Red Hat En= terprise Linux AS release 3 (Taroon)
Release: =A0 =A0 =A0 =A03
Codename: =A0 =A0 =A0 Taroon
$ uname -mrs
Linux= 2.4.21-4.EL i686
$ cat /proc/version=A0
Linux version 2.4.21-4.EL (bhcompile@daffy.= perf.redhat.com) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)) = #1 Fri Oct 3 18:13:58 EDT 2003
$=A0


logfile:
<= div>25920 execve("/home/jmudd/test_threads2", ["test_threads= 2"], [/* 26 vars */]) =3D 0
25920 rt_sigprocmask(SIG_UNBLOCK= , [RT_1 RT_2], NULL, 8) =3D 0
25920 set_thread_area({entry_number:-1 -> 6, base_addr:0x804e540, l= imit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, = seg_not_present:0, useable:1}) =3D 0
25920 set_tid_address(0x804e= 558) =A0 =A0 =A0 =A0=3D 25920
25920 mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = =3D 0xb75ea000
25920 mprotect(0xb75eb000, 86016, PROT_READ|PROT_W= RITE) =3D 0
25920 clone(child_stack=3D0xb75fff30, flags=3DCLONE_V= M|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTL= S|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, parent_tidptr=3D= 0xb75fff58, {entry_number:6, base_addr:0xb75fff40, limit:1048575, seg_32bit= :1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, usea= ble:1}, child_tidptr=3D0xb75fff58) =3D 25921
25920 mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = =3D 0xb75d4000
25920 mprotect(0xb75d5000, 86016, PROT_READ|PROT_W= RITE) =3D 0
25920 clone(child_stack=3D0xb75e9f30, flags=3DCLONE_V= M|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTL= S|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, parent_tidptr=3D= 0xb75e9f58, {entry_number:6, base_addr:0xb75e9f40, limit:1048575, seg_32bit= :1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, usea= ble:1}, child_tidptr=3D0xb75e9f58) =3D 25922
25920 futex(0xb75fff58, FUTEX_WAIT, 25921, NULL <unfinished ...>=
25922 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
25922= --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
25920 <... futex r= esumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D -1 EINTR (Interrupted system call)=
25922 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
25920 --- S= IGSTOP (Stopped (signal)) @ 0 (0) ---
25920 futex(0xb75fff58, FUT= EX_WAIT, 25921, NULL <unfinished ...>
25921 --- SIGSTOP (St= opped (signal)) @ 0 (0) ---
25921 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
25920 <.= .. futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D -1 EINTR (Interrupted sy= stem call)
25921 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
=
25920 --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...= >
25920 futex(0xb75fff58, FUTEX_WAIT, 25921, NULL <unfinish= ed ...>
25922 futex(0x804e0c4, FUTEX_WAKE, 1) =A0 =3D 1
25921 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
<= div>25921 futex(0x804e0e8, FUTEX_WAIT, 0, NULL <unfinished ...>
=
25922 futex(0x804e0e8, FUTEX_WAKE, 1) =A0 =3D 1
25921 <..= . futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...= >
25922 futex(0x804e0c4, FUTEX_WAKE, 1) =A0 =3D 1
25= 921 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) =3D 0
25921 writev(1, [{"Counter value functionCount1: 1", 31}, {&= quot;\n", 1}], 2) =3D 32
25921 futex(0x804e0e8, FUTEX_WAIT, = 1, NULL <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE,= 1) =A0 =3D 1
25921 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
<= div>25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>= ;
25922 futex(0x804e0c4, FUTEX_WAKE, 1) =A0 =3D 1
25921 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 writev(1, [{"Counter value functionCount1: 2", 31}, {&= quot;\n", 1}], 2) =3D 32
25921 futex(0x804e0e8, FUTEX_W= AIT, 2, NULL <unfinished ...>
25922 futex(0x804e0e8, FUTEX_= WAKE, 1) =A0 =3D 1
25921 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
<= div>25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>= ;
25922 futex(0x804e0c4, FUTEX_WAKE, 1) =A0 =3D 1
25921 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 writev(1, [{"Counter value functionCount1: 3", 31}, {&= quot;\n", 1}], 2) =3D 32
25921 futex(0x804e0e8, FUTEX_WAIT, = 3, NULL <unfinished ...>
25922 writev(1, [{"Counter va= lue functionCount2: 4", 31}, {"\n", 1}], 2) =3D 32
25922 writev(1, [{"Counter value functionCount2: 5", 31}, {&= quot;\n", 1}], 2) =3D 32
25922 writev(1, [{"Counter val= ue functionCount2: 6", 31}, {"\n", 1}], 2) =3D 32
25922 writev(1, [{"Counter value functionCount2: 7", 31}, {"= \n", 1}], 2) =3D 32
25922 futex(0x804e0e8, FUTEX_WAKE, 1) = =A0 =3D 1
25921 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 = =A0 =3D 0
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
25922 futex(0x804e0c4, FUTEX_WAKE, 1) =A0 =3D 1
25921 <= ;... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 writev(1, [{"Counter value functionCount1: 8", 31}, {&= quot;\n", 1}], 2) =3D 32
25921 futex(0x804e0e8, FUTEX_WAIT, 4, NULL <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE, 1) =A0 =3D 1
25921 <.= .. futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 futex(= 0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
25922 futex(0x804e0c4, FUTEX_WAKE, 1) =A0 =3D 1
25921 <..= . futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 writev(= 1, [{"Counter value functionCount1: 9", 31}, {"\n", 1}]= , 2) =3D 32
25921 futex(0x804e0e8, FUTEX_WAIT, 5, NULL <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE, 1) =A0 =3D 1
25921 <.= .. futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 futex(= 0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
25922 futex(0x804e0c4, FUTEX_WAKE, 1) =A0 =3D 1
25921 <..= . futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25921 writev(= 1, [{"Counter value functionCount1: 10", 32}, {"\n", 1}= ], 2) =3D 33
25921 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) =3D 0
25921 _exi= t(0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D ?
259= 20 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
2592= 0 munmap(0xb75ea000, 90112) =A0 =A0 =A0 =A0 =3D 0
25920 futex(0xb75e9f58, FUTEX_WAIT, 25922, NULL <unfinished ...>=
25922 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) =3D 0
2592= 2 _exit(0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D ?
25920 <... futex resumed> ) =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
25920 munmap(0xb75d4000, 90112) =A0 =A0 =A0 =A0 =3D 0
25920 = writev(1, [{"Final count: 10", 15}, {"\n", 1}], 2) =3D = 16
25920 exit_group(0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =3D ?


On Fri, Mar 21, 2014 at 2:02 PM, Rich Felk= er <dalias@aerifal.cx> wrote:
On Fri, Mar 21, 2014 at 01:54:34PM= -0400, John Mudd wrote:
> Here is the regular and strace output on 2.4 kernel, more specifically=
> Linux 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Li= nux.
>
> $ test_threads2
> Counter value functionCount1: 1
> Counter value functionCount1: 2
> Counter value functionCount1: 3
> Counter value functionCount2: 4
> Counter value functionCount2: 5
> Counter value functionCount2: 6
> Counter value functionCount2: 7
> Counter value functionCount1: 8
> Counter value functionCount1: 9
> Counter value functionCount1: 10
> Final count: 10
> $
>
> $ strace test_threads2
> execve("/home/jmudd/test_threads2", ["test_threads2&quo= t;], [/* 26 vars */]) =3D 0
> rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) =3D 0
> set_thread_area({entry_number:-1 -> 6, base_addr:0x804e540, limit:1= 048575,
> seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
> seg_not_present:0, useable:1}) =3D 0
> set_tid_address(0x804e558) =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D 25884
> mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0x= b75ea000
> mprotect(0xb75eb000, 86016, PROT_READ|PROT_WRITE) =3D 0
> clone(child_stack=3D0xb75fff30,
> flags=3DCLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE= _SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACH= ED,
> parent_tidptr=3D0xb75fff58, {entry_number:6, base_addr:0xb75fff40,
> limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pag= es:1,
> seg_not_present:0, useable:1}, child_tidptr=3D0xb75fff58) =3D 25885 > mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0x= b75d4000
> mprotect(0xb75d5000, 86016, PROT_READ|PROT_WRITE) =3D 0
> clone(child_stack=3D0xb75e9f30,
> flags=3DCLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE= _SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACH= ED,
> parent_tidptr=3D0xb75e9f58, {entry_number:6, base_addr:0xb75e9f40,
> limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pag= es:1,
> seg_not_present:0, useable:1}, child_tidptr=3D0xb75e9f58) =3D 25886 > futex(0xb75fff58, FUTEX_WAIT, 25885, NULLCounter value functionCount1:= 1
> Counter value functionCount1: 2
> Counter value functionCount1: 3
> Counter value functionCount2: 4
> Counter value functionCount2: 5
> Counter value functionCount2: 6
> Counter value functionCount2: 7
> Counter value functionCount1: 8
> Counter value functionCount1: 9
> Counter value functionCount1: 10
> ) =3D 0
> munmap(0xb75ea000, 90112) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
> munmap(0xb75d4000, 90112) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D 0
> writev(1, [{"Final count: 10", 15}, {"\n", 1}], 2F= inal count: 10
> ) =3D 16
> exit_group(0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D = ?
> $

Is this a stock 2.4.x kernel or a distro-modified one that migh= t have
things backported from 2.6?

Can you re-run the strace with:

=A0 =A0 strace -f -o logfile test_threads2

-f is needed to trace anything but the main thread/original process,
and -o to a file produces nicer output (pid/tid on each line) than the
usual default.

Rich


--001a11c36ca8d90cc504f5232c61--