public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* I am getting SIGSEGV in alloca, what could be the cause ?
@ 2007-09-11 16:31 Mayank Kumar
  2007-09-11 17:59 ` David Daney
  0 siblings, 1 reply; 5+ messages in thread
From: Mayank Kumar @ 2007-09-11 16:31 UTC (permalink / raw)
  To: binutils

Hi
With binutils 2.17 compiled programs on interix, I am sometimes getting crashes like

+++++++++++++++++++++++++++++++++++
Program received signal SIGSEGV, Segmentation fault.
0x00405f57 in _alloca () at dfa.c:1777
1777                  pos[j] = lastpos[j];

+++++++++++++++++++++++++++++++++++

Is it because the program is running out of stack space or is there some other reason.
The crash occurs when that 2.17 linked binary is run. This occurs for some programs
Only and not always. Any pointers in this area  would be helpful. I am trying to
Compile GNU packages only.


Thanks
Mayank


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I am getting SIGSEGV in alloca, what could be the cause ?
  2007-09-11 16:31 I am getting SIGSEGV in alloca, what could be the cause ? Mayank Kumar
@ 2007-09-11 17:59 ` David Daney
  2007-09-11 18:14   ` Mayank Kumar
  0 siblings, 1 reply; 5+ messages in thread
From: David Daney @ 2007-09-11 17:59 UTC (permalink / raw)
  To: Mayank Kumar; +Cc: binutils

Mayank Kumar wrote:
> Hi
> With binutils 2.17 compiled programs on interix, I am sometimes getting crashes like
> 
> +++++++++++++++++++++++++++++++++++
> Program received signal SIGSEGV, Segmentation fault.
> 0x00405f57 in _alloca () at dfa.c:1777
> 1777                  pos[j] = lastpos[j];
> 
> +++++++++++++++++++++++++++++++++++
> 
> Is it because the program is running out of stack space or is there some other reason.
> The crash occurs when that 2.17 linked binary is run. This occurs for some programs
> Only and not always. Any pointers in this area  would be helpful. I am trying to
> Compile GNU packages only.

Your debugger should allow you to examine registers and code so you can 
figure out which address caused the fault.  If it is near a page 
boundary on the stack, a stack overflow would be indicated.

David Daney

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: I am getting SIGSEGV in alloca, what could be the cause ?
  2007-09-11 17:59 ` David Daney
@ 2007-09-11 18:14   ` Mayank Kumar
  2007-09-11 18:46     ` Andreas Schwab
  2007-09-17 14:25     ` Nick Clifton
  0 siblings, 2 replies; 5+ messages in thread
From: Mayank Kumar @ 2007-09-11 18:14 UTC (permalink / raw)
  To: David Daney; +Cc: binutils

HI David,
But the same GNU packages compile and run well without issues with an older linker. So I am assuming that the GNU code that I am compiling would not have any error.

Thanks
Mayank


-----Original Message-----
From: David Daney [mailto:ddaney@avtrex.com]
Sent: Tuesday, September 11, 2007 11:29 PM
To: Mayank Kumar
Cc: binutils@sources.redhat.com
Subject: Re: I am getting SIGSEGV in alloca, what could be the cause ?

Mayank Kumar wrote:
> Hi
> With binutils 2.17 compiled programs on interix, I am sometimes getting crashes like
>
> +++++++++++++++++++++++++++++++++++
> Program received signal SIGSEGV, Segmentation fault.
> 0x00405f57 in _alloca () at dfa.c:1777
> 1777                  pos[j] = lastpos[j];
>
> +++++++++++++++++++++++++++++++++++
>
> Is it because the program is running out of stack space or is there some other reason.
> The crash occurs when that 2.17 linked binary is run. This occurs for some programs
> Only and not always. Any pointers in this area  would be helpful. I am trying to
> Compile GNU packages only.

Your debugger should allow you to examine registers and code so you can
figure out which address caused the fault.  If it is near a page
boundary on the stack, a stack overflow would be indicated.

David Daney

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I am getting SIGSEGV in alloca, what could be the cause ?
  2007-09-11 18:14   ` Mayank Kumar
@ 2007-09-11 18:46     ` Andreas Schwab
  2007-09-17 14:25     ` Nick Clifton
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2007-09-11 18:46 UTC (permalink / raw)
  To: Mayank Kumar; +Cc: David Daney, binutils

Mayank Kumar <mayank@microsoft.com> writes:

> HI David,
> But the same GNU packages compile and run well without issues with an older linker. So I am assuming that the GNU code that I am compiling would not have any error.

That does not tell anything.  One of the properties of undefined
behaviour is that it shows up when you expect it the least.  The real
error can be anywhere.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I am getting SIGSEGV in alloca, what could be the cause ?
  2007-09-11 18:14   ` Mayank Kumar
  2007-09-11 18:46     ` Andreas Schwab
@ 2007-09-17 14:25     ` Nick Clifton
  1 sibling, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2007-09-17 14:25 UTC (permalink / raw)
  To: Mayank Kumar; +Cc: David Daney, binutils

Hi Mayank,

> But the same GNU packages compile and run well without issues 
> with an older linker.

Is it only the linker that you change in order to make things work ?  If you 
are changing the linker and the compiler and maybe even the libraries that are 
linked in, then any of these things could be the source of the problem.

Or it could still be a problem in your code which is only being exposed by the 
newer linker.  Without more information it is impossible to say.

By the way release 2.18 is now out, so please give that a go and see if it 
changes anything for you.  If it does not then the best way to proceed is to 
put together a *small* testcase that reproduces the problem and then to post it 
to this list.

>> Is it because the program is running out of stack space or is there some other reason.

Almost certainly some other reason.  Running out of stack space is a very rare 
bug, and one that you can usually check for quite easily by increasing the 
amount of stack space available to the process.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-17 14:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-11 16:31 I am getting SIGSEGV in alloca, what could be the cause ? Mayank Kumar
2007-09-11 17:59 ` David Daney
2007-09-11 18:14   ` Mayank Kumar
2007-09-11 18:46     ` Andreas Schwab
2007-09-17 14:25     ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).