This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: [Cygwin64] dash segfault
On 2013-03-11 06:51, Peter Rosin wrote:
> Thread 1 (Thread 9636.0xb268):
> #0 strlen (str=0x1 <Address 0x1 out of bounds>)
> at /usr/src/debug/cygwin-1.7.18-2/newlib/libc/string/strlen.c:68
> #1 0x00000001800bf65e in strdup (s=0x1 <Address 0x1 out of bounds>)
> at /usr/src/debug/cygwin-1.7.18-2/winsup/cygwin/malloc_wrapper.cc:213
> #2 0x00000001801114eb in _sigfe () from /usr/bin/cygwin1.dll
> #3 0x0000000000229d70 in ?? ()
> #4 0x0000000100416a31 in findvar (vpp=0x6fffff841c8,
> name=0x6fffff841c8 "old_library=") at ../../src/var.c:700
> #5 0x0000000100415dd7 in setvareq (s=0x6fffff841c8 "old_library=", flags=4)
> at ../../src/var.c:298
Hmm, frames #4 and #5 don't match, as var.c:298 doesn't call findvar, it
calls memalloc.c:savestr, which is a wrapper around strdup (line 83). That
fits better with frames #1 and #0. So, the stack still seems trashed?
Anyway, inspired by frame #0, I wrote the following silly program:
#include <string.h>
int main(void)
{
return strlen((const char *)1);
}
and it too crashes into gdb without any usable backtrace. Maybe that
could be fixed before debugging the bigger problem?
Cheers,
Peter