|
From: Eyal L. <ey...@ey...> - 2004-11-06 02:40:49
Attachments:
zz33.sh
|
While I am back on the list I might as well report another problem.
Using execvp in a threaded environment provokes some errors from
the child process.
$ sh ~/zz33.sh
gcc (GCC) 3.3.4 (Debian 1:3.3.4-13)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.4/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.4 (Debian 1:3.3.4-13)
/usr/lib/gcc-lib/i486-linux/3.3.4/cc1 -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=4 /home/eyal/zz33.c -quiet -dumpbase zz33.c -auxbase zz33 -g -O0 -Wall -version -o /tmp/cccMiRwl.s
GNU C version 3.3.4 (Debian 1:3.3.4-13) (i486-linux)
compiled by GNU C version 3.3.4 (Debian 1:3.3.4-13).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129475
ignoring nonexistent directory "/usr/i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i486-linux/3.3.4/include
/usr/include
End of search list.
as -V -Qy -o /tmp/ccsL3z8x.o /tmp/cccMiRwl.s
GNU assembler version 2.15 (i386-linux) using BFD version 2.15
/usr/lib/gcc-lib/i486-linux/3.3.4/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /home/eyal/zz33 /usr/lib/gcc-lib/i486-linux/3.3.4/../../../crt1.o /usr/lib/gcc-lib/i486-linux/3.3.4/../../../crti.o /usr/lib/gcc-lib/i486-linux/3.3.4/crtbegin.o -L/usr/lib/gcc-lib/i486-linux/3.3.4 -L/usr/lib/gcc-lib/i486-linux/3.3.4/../../.. -lpthread /tmp/ccsL3z8x.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc-lib/i486-linux/3.3.4/crtend.o /usr/lib/gcc-lib/i486-linux/3.3.4/../../../crtn.o
/home/eyal/zz33.c(80) will pthread_attr_init
/home/eyal/zz33.c(83) pthread_attr_init=0
forking
forked, pid=14765
forked, pid=0
==14765== Thread 2:
==14765== Invalid read of size 4
==14765== at 0x1B9A215D: getenv (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEC80 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 2
==14765== at 0x1B9A2170: getenv (in /lib/tls/libc-2.3.2.so)
==14765== Address 0x52BFEDA5 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 4
==14765== at 0x1B9A2183: getenv (in /lib/tls/libc-2.3.2.so)
==14765== Address 0x52BFEC84 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 1
==14765== at 0x1B9A219C: getenv (in /lib/tls/libc-2.3.2.so)
==14765== Address 0x52BFEE9E is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 1
==14765== at 0x1B9A21BD: getenv (in /lib/tls/libc-2.3.2.so)
==14765== Address 0x52BFEEA0 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 1
==14765== at 0x1BA23CE5: execvp (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEEA1 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 1
==14765== at 0x1BA23D3A: execvp (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEEA1 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 2
==14765== at 0x1BA23D74: execvp (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEEA1 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 4
==14765== at 0x1BA23D76: execvp (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEEA3 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Syscall param execve(envp) contains uninitialised or unaddressable byte(s)
==14765== at 0x1BA2388A: execve (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEC80 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Syscall param execve(envp[i]) contains uninitialised or unaddressable byte(s)
==14765== at 0x1BA2388A: execve (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEDA5 is not stack'd, malloc'd or (recently) free'd
==14765==
==14765== Thread 2:
==14765== Invalid read of size 1
==14765== at 0x1BA23DBE: execvp (in /lib/tls/libc-2.3.2.so)
==14765== by 0x8048642: execvp_test (zz33.c:36)
==14765== by 0x804874C: func (zz33.c:64)
==14765== by 0x1B90FAB7: thread_wrapper (vg_libpthread.c:795)
==14765== by 0xB000F0FD: do__quit (vg_scheduler.c:1743)
==14765== Address 0x52BFEEAF is not stack'd, malloc'd or (recently) free'd
/home/eyal/zz33.c(66) execvp_test rc=0
/home/eyal/zz33.c(102) joined
==14762== warning: Valgrind's pthread_attr_destroy does nothing
==14762== your program may misbehave as a result
/home/eyal/zz33.c(107) pthread_attr_destroy=0
/home/eyal/zz33.c(119) test done
$ ldd ~/zz33
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7fc7000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7e8b000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000)
$ ls -l /lib/tls/libpthread.so.0
lrwxrwxrwx 1 root root 18 Oct 21 09:42 /lib/tls/libpthread.so.0 -> libpthread-0.60.so
$ ls -l /lib/tls/libc.so.6
lrwxrwxrwx 1 root root 13 Oct 21 09:42 /lib/tls/libc.so.6 -> libc-2.3.2.so
$ ls -l /lib/ld-linux.so.2
lrwxrwxrwx 1 root root 11 Oct 21 09:42 /lib/ld-linux.so.2 -> ld-2.3.2.so
--
Eyal Lebedinsky (ey...@ey...) <http://samba.org/eyal/>
|
|
From: Tom H. <th...@cy...> - 2004-11-06 11:04:32
|
In message <418...@ey...>
Eyal Lebedinsky <ey...@ey...> wrote:
> While I am back on the list I might as well report another problem.
> Using execvp in a threaded environment provokes some errors from
> the child process.
There are a couple of bugs on the bug tracker about this already.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|