stack_info::walk and alloca don't mix

Ryan Johnson
Tue May 3 15:51:00 GMT 2011

On 03/05/2011 11:43 AM, Corinna Vinschen wrote:
> On May  3 10:59, Ryan Johnson wrote:
>> Hi all,
>> FYI in case anyone else has been seeing strange crashes inside calls
>> to api_fatal():
>> It seems that functions which use alloca() set up a non-standard
>> stack frame which confuses both stack_info::walk and windbg. The
>> former tends to either enter an infinite loop or end up executing
>> code in la-la land; the latter crashes instantly. Worse, if an
> I'm not really concerned about windbg.  What about just fixing
> stack_info::walk so that at least it doesn't enter an infinite loop?
Agree about windbg, though the instadeath makes it hard to debug certain 
dll initialization bugs I'm trying to hunt down.

The problem is, I don't know how to reliably prevent stack_info::walk 
going to la-la land. It's pure luck whether it crashes directly, goes 
into an infinite loop, or goes into the crash-dump-crash loop. The 
middle case we could avoid for the simple
case of a bp which points to itself, but not longer cycles. The other 
two are just hard.

If you have any ideas on how I could detect at least some of the 
failures modes, I'd be happy to investigate them further, though.


More information about the Cygwin-developers mailing list