[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C threads on NetBSD 4.0 i386

From: David Ayers
Subject: Re: Objective C threads on NetBSD 4.0 i386
Date: Sun, 06 Jan 2008 22:35:06 +0100
User-agent: Icedove (X11/20071020)

Richard Frith-Macdonald wrote:

On 6 Jan 2008, at 17:19, David Wetzel wrote:


 objc_thread_detach (@selector(hash), o, nil);

returns NULL on all boxes. Also on NetBSD 3.1 where NSThread is working with GNUstep.

Any Ideas?

I don't see how that's possible unless you are linking something wrong ... if objc_thread_detach() returns NULL then NSThread cannot work ...

It doesn't actually return NULL on NetBSD 3.1. There seems to be a promotion/printf issue, undefined behavior or some serious bug. For:

printf("return value is %p %d\n int:%d retval:%d NULL:%d, COMP:%d\n",
          retval, (retval == NULL),
          sizeof(int), sizeof(retval),
          sizeof(NULL), sizeof(retval==NULL));

I get:

return value is 0xbb000000 0
 int:4 retval:4 NULL:4, COMP:4

since it is based on objc_thread_detach() and will raise an exception if that returns NULL (since NULL is the error return from that function ... not a great piece of design, but it's what the objc runtime provides).

But on the 4.0 version we really get 0x0. Now I'll poke a bit but I think Dave W. will actually have to install a debug version of gcc/libobjc for me to figure out what's going on here.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]