From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 22 06:10:06 2007 Return-Path: X-Original-To: freebsd-amd64@hub.freebsd.org Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB09116A4F4 for ; Thu, 22 Mar 2007 06:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id CAF6413C4BE for ; Thu, 22 Mar 2007 06:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l2M6A60n047265 for ; Thu, 22 Mar 2007 06:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l2M6A6YL047261; Thu, 22 Mar 2007 06:10:06 GMT (envelope-from gnats) Resent-Date: Thu, 22 Mar 2007 06:10:06 GMT Resent-Message-Id: <200703220610.l2M6A6YL047261@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Martin M. Mladenov" Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47FB616A4EF for ; Thu, 22 Mar 2007 06:09:58 +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 3845913C45D for ; Thu, 22 Mar 2007 06:09:58 +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 l2M69wk8081101 for ; Thu, 22 Mar 2007 06:09:58 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l2M64ueJ075601; Thu, 22 Mar 2007 06:04:56 GMT (envelope-from nobody) Message-Id: <200703220604.l2M64ueJ075601@www.freebsd.org> Date: Thu, 22 Mar 2007 06:04:56 GMT From: "Martin M. Mladenov" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: amd64/110655: 32 bit threaded applications crash on amd64 SMP kernel. X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2007 06:10:07 -0000 >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@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 #include 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: