[OpenAFS-devel] LWP and clang
Benjamin Kaduk
kaduk@MIT.EDU
Wed, 16 Oct 2013 15:39:05 -0400 (EDT)
On Wed, 16 Oct 2013, Benjamin Kaduk wrote:
> On Wed, 16 Oct 2013, Marc Dionne wrote:
>
>>>
>>> Hmm, the example I have handy (aklog.core from ~tip-of-1.6.x) shows the
>>> faulting line of source as:
>>> rx_lwp.c:174:
>>> 174 char name[MAXTHREADNAMELENGTH] = "srv_0";
>>
>> Crashing here which is probably the first write into stack memory
>> after starting the rx_ListenerProc LWP, so that would seem consistent
>> with having a bogus stack pointer after switching lwps.
>
> I can access memory at $rsp at the faulting instruction, but it seems to only
> be 8-byte aligned, which may be the issue. (This is on amd64.)
>
> I will look around a bit more.
Yeah, if I tweak rsp before stepping into the listener proc from
Create_Process_Part2, there's no SIGBUS.
Switching FBSD to use the same block as sys_x86_darwin_80 at line 396 of
lwp.c lets aklog run to completion. I'm not sure what it will take to
convince me that this is right for the right reasons, though.
-Ben