[prev in list] [next in list] [prev in thread] [next in thread]
List: pthreads-devel
Subject: Re: [pthreads-devel] Bug in pth_native.c ? + FreeBSD port
From: Arun Sharma <arun () sharmas ! dhs ! org>
Date: 2001-05-20 20:38:43
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic