misc/133734: 32 bit libthr failing pthread_create()
Stephen Sanders
ssanders at opnet.com
Tue Apr 14 13:50:04 PDT 2009
>Number: 133734
>Category: misc
>Synopsis: 32 bit libthr failing pthread_create()
>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 20:50:03 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Stephen Sanders
>Release: 7.1
>Organization:
OPNET
>Environment:
FreeBSD vm7-1-64 7.1-RELEASE FreeBSD 7.1-RELEASE #1: Tue Mar 17 09:07:55 EDT 2009 root at vm.7.1.64:/usr/obj/usr/src/sys/GENERIC amd64
QEMU emulation running on Fedora 10.
32 bit library support installed.
5.3/6.3 compatibility libraries installed.
>Description:
The following program will drop core in pthread_create() with an invalid argument error:
#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);
return 0;
}
** an example execution **
[root at vm7-1-64 ~/tmp]# ./threadcore
Fatal error 'can not create signal daemon thread!
' at line 236 in file /usr/src/lib/libpthread/thread/thr_sig.c (errno = 22)
>How-To-Repeat:
Cut and paste the program in the description. Compile it on a FreeBSD 6.3/32bit system and run the program on a FreeBSD 7.1 64 bit system.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list