lkml.org 
[lkml]   [1999]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject2.3.6pre2: New mechanism for unaligned a.out's broken
Hello,

I found that in Linux 2.3.6pre2 (and probably some versions before that)
the new way to execute ancient not-page-aligned a.out binaries is broken.

I have a /usr/bin/time in this format and when I use it the child
process that is created through fork and exec gets a segfault
while it is running.

/usr/bin/time ls

4501 execve("/usr/bin/time", ["/usr/bin/time", "ls"], [/* 54 vars */]) = 0
4501 getuid() = 10
4501 geteuid() = 10
4501 getgid() = 100
4501 getegid() = 100
4501 uselib("/usr/lib/libc.so.4") = -1 ENOENT (No such file or directory)
4501 uselib("/lib/libc.so.4") = 0
4501 brk(0) = 0x4000
4501 brk(0x7000) = 0x7000
4501 brk(0x8000) = 0x8000
4501 stat("/etc/locale/C/libc.cat", 0xbffff4bc) = -1 ENOENT (No such file or directory)
4501 stat("/usr/lib/locale/C/libc.cat", 0xbffff4bc) = -1 ENOENT (No such file or directory)
4501 stat("/usr/lib/locale/libc/C/usr/share/locale/C/libc.cat", 0xbffff4bc) = -1 ENOENT (No such file or directory)
4501 stat("/usr/local/share/locale/C/libc.cat", 0xbffff4bc) = -1 ENOENT (No such file or directory)
4501 gettimeofday({928955139, 681269}, NULL) = 0
4501 fork() = 4502
4501 sigaction(SIGINT, {SIG_IGN}, {SIG_DFL}) = 0
4501 sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}) = 0
4501 wait4(-1, <unfinished ...>
4502 geteuid() = 10
4502 getegid() = 100
4502 getgroups(32, [100, 9, 11, 18, 90, 91, 92, 93]) = 8
4502 stat("/usr/local/bin/ls", 0xbffff930) = -1 ENOENT (No such file or directory)
4502 stat("/bin/ls", {st_mode=S_IFREG|0755, st_size=93916, ...}) = 0
4502 execve("/bin/ls", ["ls"], [/* 54 vars */]) = 0
4502 brk(0) = 0x8056018
4502 mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
4502 open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
4502 open("/etc/ld.so.cache", O_RDONLY) = 4
4502 fstat(4, {st_mode=S_IFREG|0644, st_size=31691, ...}) = 0
4502 mmap(0, 31691, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40016000
4502 close(4) = 0
4502 open("/lib/libc.so.6", O_RDONLY) = 4
4502 fstat(4, {st_mode=S_IFREG|0755, st_size=4082851, ...}) = 0
4502 read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
4502 mmap(0, 990332, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4001e000
4502 mprotect(0x40109000, 27772, PROT_NONE) = 0
4502 mmap(0x40109000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xea000) = 0x40109000
4502 mmap(0x4010d000, 11388, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4010d000
4502 close(4) = 0
4502 mprotect(0x4001e000, 962560, PROT_READ|PROT_WRITE) = 0
4502 mprotect(0x4001e000, 962560, PROT_READ|PROT_EXEC) = 0
4502 munmap(0x40016000, 31691) = 0
4502 personality(PER_LINUX) = 0
4502 getpid() = 4502
4502 --- SIGSEGV (Segmentation fault) ---
4501 <... wait4 resumed> [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV], 0, {ru_utime={0, 0}, ru_stime={0, 0}, ...}) = 4502
4501 --- SIGCHLD (Child exited) ---
4501 gettimeofday({928955139, 702049}, NULL) = 0
4501 sigaction(SIGINT, {SIG_DFL}, {SIG_IGN}) = 0
4501 sigaction(SIGQUIT, {SIG_DFL}, {SIG_IGN}) = 0
4501 write(2, "0.00", 4) = 4
4501 write(2, "u", 1) = 1
4501 write(2, "s", 1) = 1
[rest deleted]

A normal run of /bin/ls continues at the segfault above like this:

getpid() = 4536
brk(0) = 0x8056018
brk(0x80561b8) = 0x80561b8
brk(0x8057000) = 0x8057000
time(NULL) = 928955844
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
brk(0x805a000) = 0x805a000


The system is based on Dual-PentiumII, 233MHz,
Gigabyte GA-686LX2 motherboard. The kernel is compiled with
egcs 1.1.2.

Find the hardware and kernel configuration used at
http://www.snafu.de/~zahn/autoconf.html

Complete boot messages are at http://www.snafu.de/~zahn/bootmsg.html

The time binary used is at http://www.snafu.de/~zahn/time

Steffen

--
home email: user@domain where domain=berlin.snafu.de, user=zahn
Use of my address for unsolicited commercial advertising is forbidden.
2^3021377 - 1 | "Where do you want to crash today?"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.037 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site