mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Mudd <johnbmudd@gmail.com>
To: Rich Felker <dalias@aerifal.cx>
Cc: musl <musl@lists.openwall.com>
Subject: Re: Build on linux 2.6 and run on linux 2.4?
Date: Fri, 21 Mar 2014 14:24:09 -0400	[thread overview]
Message-ID: <CAGDMk9EFO1j=a=YuUi0AuCxxa9rnSi5RFQ9MH1vc6Hs61tFVmw@mail.gmail.com> (raw)
In-Reply-To: <20140321180204.GL26358@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 9239 bytes --]

$ 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 <unfinished ...>
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 <unfinished ...>
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 <unfinished ...>
25920 futex(0xb75fff58, FUTEX_WAIT, 25921, NULL <unfinished ...>
25922 futex(0x804e0c4, FUTEX_WAKE, 1)   = 1
25921 <... futex resumed> )             = 0
25921 futex(0x804e0e8, FUTEX_WAIT, 0, NULL <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE, 1)   = 1
25921 <... futex resumed> )             = 0
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
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 <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE, 1)   = 1
25921 <... futex resumed> )             = 0
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
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 <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE, 1)   = 1
25921 <... futex resumed> )             = 0
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
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 <unfinished ...>
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 <unfinished ...>
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 <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE, 1)   = 1
25921 <... futex resumed> )             = 0
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
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 <unfinished ...>
25922 futex(0x804e0e8, FUTEX_WAKE, 1)   = 1
25921 <... futex resumed> )             = 0
25921 futex(0x804e0c4, FUTEX_WAIT, -2147483632, NULL <unfinished ...>
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 <unfinished ...>
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 <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/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
>

[-- Attachment #2: Type: text/html, Size: 11726 bytes --]

  reply	other threads:[~2014-03-21 18:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20 20:58 John Mudd
2014-03-20 23:14 ` Rich Felker
2014-03-21  0:51   ` Rich Felker
2014-03-26  6:22     ` Rich Felker
2014-03-21 13:02   ` John Mudd
2014-03-21 16:40     ` Rich Felker
2014-03-21 17:54     ` John Mudd
2014-03-21 18:02       ` Rich Felker
2014-03-21 18:24         ` John Mudd [this message]
2014-03-21 19:09           ` Rich Felker
2014-03-21 19:48           ` John Mudd
2014-03-21 19:53             ` Rich Felker
2014-03-21 20:16               ` John Mudd
2014-03-22 11:12                 ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGDMk9EFO1j=a=YuUi0AuCxxa9rnSi5RFQ9MH1vc6Hs61tFVmw@mail.gmail.com' \
    --to=johnbmudd@gmail.com \
    --cc=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).