Date: Sun, 20 May 2001 13:38:43 -0700 From: Arun Sharma <arun@sharmas.dhs.org> To: Bill Abt <babt@us.ibm.com> Cc: pthreads-devel@dwoss.lotus.com, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: [pthreads-devel] Bug in pth_native.c ? + FreeBSD port Message-ID: <20010520133843.A27038@sharmas.dhs.org> In-Reply-To: <OFF39B6B79.434C6E57-ON85256A52.004128C4@raleigh.ibm.com>; from babt@us.ibm.com on Sun, May 20, 2001 at 08:05:19AM -0400 References: <OFF39B6B79.434C6E57-ON85256A52.004128C4@raleigh.ibm.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 20, 2001 at 08:05:19AM -0400, Bill Abt wrote: > Yeah, your right about slot. It should be allocated off the heap... Hmm, > that would probably explain a few inconsistencies we've seen as well. > Thanks!!!! > > As far as incorporating your changes into the release, sure!!! Another > platform/os would be great. > Ok, the patch is here: http://sharmas.dhs.org/~adsharma/ngpt-freebsd.patch.txt Rough edges: (a) @NATIVE@ needs to be substituted with pth_native.c or pth_native_freebsd.c depending on the platform. I'm not too good at autoconf. (b) The changes to pth_lib.c can probably be ignored. They're there to fix compilation errors on FreeBSD and it's not clear to me what the correct solution is. (c) This is a mysterious bug that I'm not able to solve even after fighting with it for a couple of days: - void (* volatile mctx_starting_func)(void); + static void (* volatile mctx_starting_func)(void); This variable gets corrupted on FreeBSD after a context switch. I suspect that this could be a compiler issue, but haven't been able to pin point the problem. I'm using: $ gcc -v Using builtin specs. gcc version 2.95.3 20010315 (release) Datapoints: 1. Increasing the stack size, didn't help. It also makes it unlikely that someone is accidentally stepping on the malloc'ed stack. 2. The problem disappeared after I put some debug statements in the surrounding code. This might have tickled the compiler in such a way that the problem got masked. Making the variable static makes the problem go away. This shouldn't be a problem, since all threads get bootstrapped the same way ? -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010520133843.A27038>