misc/133735: Multi-threaded 32 bit cores can't be used on 64 bit systems

Stephen Sanders ssanders at opnet.com
Tue Apr 14 14:00:05 PDT 2009


>Number:         133735
>Category:       misc
>Synopsis:       Multi-threaded 32 bit cores can't be used on 64 bit systems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 14 21:00:04 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Sanders
>Release:        6.3 - 64 Bit
>Organization:
OPNET
>Environment:
FreeBSD alt-4100-1.lab.opnet.com 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Tue Mar 31 14:11:07 PDT 2009     pmai at focus7.networkphysics.com:/u1/builds/ping/NP/FreeBSD/package/NPbabkernel/bld-tmp/sys/amd64/compile/NPBAB  amd64

>Description:
The following program will produce a core file.  

Running the program on a FreeBSD 6.3/64 bit system will produce a core file.  Attempts to use gdb on the core will fail on the following error:

Core was generated by `threadcore'.
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 0x280a05a808053000 (runnable)]
Cannot get thread info: generic error
(gdb) 

--------------------------- The Program ------------------
#include <sys/types.h>
#include <signal.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <err.h>

void *thr(void *a)
{
    int *ip = (int *)a;
    printf("started thread %d\n", *ip);
    pause();
    return 0;
}

int main(int argc, char **argv)
{
    const int THREADCOUNT =4;
    int i;
    pthread_t threads[THREADCOUNT];

    for (i =0; i < THREADCOUNT; i++)
       if (pthread_create(&threads[i], 0, thr, (void *)&i) != 0)
           errx(-1, "cannot create thread");

    sleep(1);
    kill(0, SIGBUS);
    return 0;
}

>How-To-Repeat:
Compile the program in the description section on a FreeBSD 6.3/32 bit system.  Run it on a 6.3/64 bit system and attempt to look at the  core file ('info threads' for example)

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list