This is the mail archive of the cygwin mailing list for the Cygwin 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: Analyzing a SEG FAULT that gdb doesn't help with


On Thu, Jul 30, 2015 at 10:46 AM, Michael Enright  wrote:
> On Thu, Jul 30, 2015 at 7:39 AM, Jon TURNEY  wrote:
>> You need to install the 'cygwin-debuginfo' package for debug symbols for
>> cygwin1.dll
>
> I missed this in my searches. I see now that I should have used the
> "debug" category.
>
>>
>> You also need to point addr2line at those detached debug symbols, as (unlike
>> gdb) it doesn't follow .gnu_debuglink pointers.
>>
>> (I'm assuming you've typoed 6155d363 here and it should be 0x6115D363 as the
>> strace output says)
>
> I've been having trouble getting that number right
>
>>
>> # addr2line -e /usr/lib/debug/usr/bin/cygwin1.dbg 0x6115D363
>> /usr/src/debug/cygwin-2.1.0-1/newlib/libc/machine/i386/strlen.S:64
>

So I set a breakpoint at that location. After hitting it a couple
dozen times I referred back to the stackdump for some register values.

I replaced the original breakpoint with b *0x6115D363 if $ecx==0
When that hit, I did a backtrace:

(gdb) bt
#0  strlen () at
/usr/src/debug/cygwin-2.1.0-1/newlib/libc/machine/i386/strlen.S:64
#1  0x6115bbc6 in __strftime (s=s@entry=0x28c1c8
"(\274\a\200\300\t`\377\210\340`\377\001", maxsize=maxsize@entry=100,
format=0x6e7e86da <js_Null_str+9683> "Z)",
    format@entry=0x6e7e86d8 <js_Null_str+9681> "(%Z)",
tim_p=tim_p@entry=0x28c0ec, era_info=era_info@entry=0x28c078,
alt_digits=alt_digits@entry=0x28c07c)
    at /usr/src/debug/cygwin-2.1.0-1/newlib/libc/time/strftime.c:1344
#2  0x6115d1bd in strftime (s=0x28c1c8
"(\274\a\200\300\t`\377\210\340`\377\001", maxsize=100,
format=0x6e7e86d8 <js_Null_str+9681> "(%Z)", tim_p=0x28c0ec)
    at /usr/src/debug/cygwin-2.1.0-1/newlib/libc/time/strftime.c:673
#3  0x610e9925 in _sigfe () at sigfe.s:38
#4  0x6e7e86d8 in js_Null_str () from /usr/bin/cygmozjs185-1.0.dll
#5  0x0028c0ec in ?? ()
#6  0x800392ec in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Then ...

(gdb) up
#1  0x6115bbc6 in __strftime (s=s@entry=0x28c1c8
"(\274\a\200\300\t`\377\210\340`\377\001", maxsize=maxsize@entry=100,
format=0x6e7e86da <js_Null_str+9683> "Z)",
    format@entry=0x6e7e86d8 <js_Null_str+9681> "(%Z)",
tim_p=tim_p@entry=0x28c0ec, era_info=era_info@entry=0x28c078,
alt_digits=alt_digits@entry=0x28c07c)
    at /usr/src/debug/cygwin-2.1.0-1/newlib/libc/time/strftime.c:1344
1344                  size = strlen (tznam);

Well, let's just kibitz myself:

(gdb) print tznam
$3 = 0xc07a4000 <error: Cannot access memory at address 0xc07a4000>
(gdb) list
1339                    tznam = _tzname[tim_p->tm_isdst > 0];
1340                  /* Note that in case of wcsftime this loop only works for
1341                     timezone abbreviations using the portable
codeset (aka ASCII).
1342                     This seems to be the case, but if that ever
changes, this
1343                     loop needs revisiting. */
1344                  size = strlen (tznam);
1345                  for (i = 0; i < size; i++)
1346                    {
1347                      if (count < maxsize - 1)
1348                        s[count++] = tznam[i];
(gdb) print _tzname
$4 = {0x800cfc48 "\200", <incomplete sequence \356\066>, 0x800cfc44 "PDT"}
(gdb) print _tzname[0]
$5 = 0x800cfc48 "\200", <incomplete sequence \356\066>
(gdb) print _tzname[1]
$6 = 0x800cfc44 "PDT"

So "something happened" when libmozjs tried to convert a time to a
string, and whatever happened has to do with the time zone.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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