From nobody@FreeBSD.org  Thu Mar 22 06:13:05 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id AAD0C16A409
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Mar 2007 06:13:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B1A013C4BF
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Mar 2007 06:13:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2M6D5ta084769
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Mar 2007 06:13:05 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l2M684JS076860;
	Thu, 22 Mar 2007 06:08:04 GMT
	(envelope-from nobody)
Message-Id: <200703220608.l2M684JS076860@www.freebsd.org>
Date: Thu, 22 Mar 2007 06:08:04 GMT
From: "Martin M. Mladenov"<fm@mtweb.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 32 bit threaded applications crash on amd64 SMP kernel.
X-Send-Pr-Version: www-3.0

>Number:         110656
>Category:       amd64
>Synopsis:       32 bit threaded applications crash on amd64 SMP kernel.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 22 06:20:04 GMT 2007
>Closed-Date:    Thu Mar 22 07:34:34 GMT 2007
>Last-Modified:  Thu Mar 22 07:34:34 GMT 2007
>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@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:
None known.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Thu Mar 22 07:34:01 UTC 2007 
State-Changed-Why:  
Duplicate of amd/110655. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110656 
>Unformatted:
