amd64/110655: 32 bit threaded applications crash on amd64 SMP kernel.

Martin M. Mladenov fm at mtweb.org
Thu Mar 22 06:10:07 UTC 2007


>Number:         110655
>Category:       amd64
>Synopsis:       32 bit threaded applications crash on amd64 SMP kernel.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-amd64
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 22 06:10:06 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Martin M. Mladenov
>Release:        FreeBSD 6.2-RELEASE-p3 amd64
>Organization:
>Environment:
System: FreeBSD c8 6.2-RELEASE-p3 FreeBSD 6.2-RELEASE-p3 #2: Wed Mar 21 06:31:50 MST 2007 root at c8:/usr/obj/usr/src/sys/SM6015TTV amd64
>Description:
   32 bit applications using the posix threads library crash when calling pthread_create on an SMP amd64 kernel. This happens
	 with existing binaries, built natively on a x86 machine, as well as binaries built with cc -m32 on the amd64 system. 
  	 A backtrace for the example in the next section yields:
	
	Core was generated by `pthread-crash'.
	Program terminated with signal 11, Segmentation fault.
	Reading symbols from /usr/lib32/libpthread.so.2...(no debugging symbols found)...done.
	Loaded symbols for /usr/lib32/libpthread.so.2
	Reading symbols from /usr/lib32/libc.so.6...(no debugging symbols found)...done.
	Loaded symbols for /usr/lib32/libc.so.6
	Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
	Loaded symbols for /libexec/ld-elf.so.1
	#0  0x0804d100 in ?? ()
	[New Thread 0x805301408053200 (runnable)]
	[New Thread 0x2809f1c808053000 (runnable)]
	Cannot get thread info: generic error
	(gdb) bt
	#0  0x0804d100 in ?? ()
	
	This has been reproduced on two machines with completely different hardware. 	


>How-To-Repeat:
   The problem can be reproduced by the following code (pthread_crash.c):
        #include <stdio.h>
        #include <pthread.h>

        void *thread(void *data) {
          puts("Thread.");
          return NULL;
        }
 
        int main() {
          pthread_t pth;
          void *pv;
          pthread_create(&pth,NULL,thread,NULL);
          pthread_join(pth,&pv);
          return 0;
        }
        The code is compiled with:
        cc -m32 -B/usr/lib32 -pthread -o pthread-crash pthread-crash.c
	This code runs fine when compiled to 64 bit.

>Fix:
Non known.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-amd64 mailing list