Re: PR_GetThreadID() fails with SEGV

Julien R Pierre - Sun Microsystems <[email protected]> Wed, 24 Jun 2009 17:20:26 -0700
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
Jon,

Jon Leighton wrote:
> I'm using NSPR 4.8 on Solaris 5.10, and OpenSolaris 5.11, and if I call 
> PR_GetThreadID(PR_GetCurrentThread()), it fails with SEGV.  The same 
> code works fine on a number of other platforms.  Is there an issue with 
> PR_GetThreadID() on Solaris/OpenSolaris, or something different I need 
> to do?  Thanks for any help.
> 
> - Jon

I just tried the following on Solaris 10 x86 (32 bits). I experienced no 
problem.

         PRThread* prt = PR_GetCurrentThread();
         PRUint32 tid;
         tid = PR_GetThreadID(prt);
         printf("Thread id : %d.\n", tid);

Please provide a crash stack. Even for a deprecated function, I would 
not expect a crash. Are you passing a valid PRThread* pointer ?