This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Weird startup issue with -fsplit-stack


On Tue, May 20, 2014 at 7:18 AM, Dmitry Antipov <dmantipov@yandex.ru> wrote:
>
> I'm trying to support -fsplit-stack in GNU Emacs. The most important problem
> is that
> GC uses conservative scanning of a C stack, so I need to iterate over stack
> segments.
> I'm doing this by using  __splitstack_find, as described in
> libgcc/generic-morestack.c;
> but now I'm facing the weird issue with startup:
>
> Core was generated by `./temacs --batch --load loadup bootstrap'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __morestack () at ../../../gcc-4.9.0/libgcc/config/i386/morestack.S:486
> 486             pushq   %rax
> (gdb) bt 10
> #0  __morestack () at ../../../gcc-4.9.0/libgcc/config/i386/morestack.S:486
> #1  0x00000000005f15df in __morestack () at
> ../../../gcc-4.9.0/libgcc/config/i386/morestack.S:502
> #2  0x00000000005f15df in __morestack () at
> ../../../gcc-4.9.0/libgcc/config/i386/morestack.S:502
> #3  0x00000000005f15df in __morestack () at
> ../../../gcc-4.9.0/libgcc/config/i386/morestack.S:502

This is the call to __morestack_block_signals in morestack.S.  It
should only be possible if __morestack_block_signals or something it
calls directly has a split stack.  __morestack_block_signals has the
no_split_stack attribute, meaning that it should never call
__morestack.  __morestack_block_signals only calls pthread_sigmark or
sigprocmask, neither of which should be compiled with -fsplit-stack.
So something has gone wrong, but I don't know what.

I would recommend tracing the code instruction by instruction to see
why __morestack_block_signals calls back into __morestack.  Or, if
that analysis is wrong, see what else is happening.

I can advise but I don't have time to look at this in detail.  Sorry.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]