On Monday 09 May 2005 16:31, Markus Schulz wrote:
> Hello,
>
> i've got segmentation faults with every self-made program based on pthread
> library in my debian-sarge guest system.
> On my host there is an debian-sarge 2.6.11.6-skas3-v8-rc5 running.
Move /lib/tls to /lib/tls.away and retry. Then, feel free to send me your test 
programs: I'm working to fix this, but I've had some difficulties, and having 
some simple test program (such as the below one, which I'll be testing ASAP) 
would be nice. Anyhow, for this week I'm really busy, so I'll be working on 
this later.

> for instance this simple program segfaults:
> ********************
> #include <pthread.h>
> #include <stdio.h>
> #include <unistd.h>
>
> void * thread (void *dummy) {
>         for (;;)  {
>                 sleep(10);
>         }
> }
>  int main () {
>         pthread_t tid;
>         if (pthread_create(&tid, NULL, thread, NULL) != 0) {
>                 fprintf(stderr, "Error creating thread\n");
>                 return 1;
>         }
>         sleep(100);
>         pthread_join(tid, NULL);
>         return 0;
> }
> ********************
> compiled with:
> gcc -g -Wall -o threadtest thread-test.c -lpthread
>
> strace ./threadtest returns:(last lines)
> ********************
> open("/lib/tls/libc.so.6", O_RDONLY)    = 3
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`Z\1\000"..., 512)
> = 512
> fstat64(3, {st_mode=S_IFREG|0644, st_size=1254468, ...}) = 0
> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
> 0) = 0x4002b000
> old_mmap(NULL, 1264780, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> 0x4002c000 old_mmap(0x40156000, 36864, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED, 3, 0x129000) = 0x40156000
> old_mmap(0x4015f000, 7308, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
> MAP_ANONYMOUS, -1, 0) = 0x4015f000
> close(3)                                = 0
> set_thread_area({entry_number:-1 -> -1, base_addr:0x4002b900,
> limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
> seg_not_present:0, useable:1}) = -1 ENOSYS (Function not implemented)
> modify_ldt(1, {entry_number:0, base_addr:0x4002b900, limit:1048575,
> seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
> seg_not_present:0, useable:1},16) = 0
> munmap(0x40018000, 13832)               = 0
> set_tid_address(0x4002b948)             = 16564
> rt_sigaction(SIGRTMIN, {0x400205d0, [], SA_SIGINFO}, NULL, 8) = 0
> rt_sigprocmask(SIG_UNBLOCK, [RTMIN], NULL, 8) = 0
> getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
> mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|
> MAP_ANONYMOUS, -1, 0) = 0x40161000
> brk(0)                                  = 0x804a000
> brk(0x806b000)                          = 0x806b000
> brk(0)                                  = 0x806b000
> mprotect(0x40161000, 4096, PROT_NONE)   = 0
> clone(child_stack=0x40960b48, 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=0x40960bf8,
> {entry_number:0, base_addr:0x40960bb0, limit:1048575, seg_32bit:1,
> contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0,
> useable:1}, child_tidptr=0x40960bf8) = 16565
> rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
> rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
> nanosleep({100, 0}, 0xbffff684)         = ? ERESTART_RESTARTBLOCK (To be
> restarted)
> +++ killed by SIGSEGV +++
> ********************
>
> any ideas why this happens?
>
> Markus Schulz

-- 
Paolo Giarrusso, aka Blaisorblade
Skype user "PaoloGiarrusso"
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to