[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: git-merge-changelog crash

From: Bruno Haible
Subject: Re: git-merge-changelog crash
Date: Sat, 18 Jul 2009 10:56:59 +0200
User-agent: KMail/1.9.9

Rolf Bjarne Kvinge wrote:
> >> Attached are three files (o-file, a-file and b-file) which when run with
> >> git-merge-changelog causes an assertion in:
> >>
> >> #3  0x08049985 in main (argc=Cannot access memory at address 0x34a6) at
> >> git-merge-changelog.c:1469
> >> 1469                                       ASSERT (entry_equals 
> >> (ancestor_file.entries[i],
> >
> > Could you please indicate
> >   - Which version of git-merge-changelog.c are you using? The ones inthe 
> > gnulib
> >     repository have that ASSERT line at a different line number than 1469.
> feb2268308fe0aa483e9614c714cd66480ba033e
> I added a couple of prinfs which probably shifted that line a bit.

$ git checkout feb2268308fe0aa483e9614c714cd66480ba033e
$ grep -n 'ASSERT (entry_equals (ancestor_file.entries' 
1579:                           ASSERT (entry_equals (ancestor_file.entries[i],

Either your "adding a couple of printfs" removed 110 lines of code, or you were
actually testing an older version. I think the latter is more likely, since with
these older versions I reproduce the assertion failure with your three files.

Actually it is the same bug as reported by Eric. The line number printed by gdb
is confusing. With the source code prior to the fix, I get

- when I compile with -g and no optimization:
#0  0x00007f0aa9c9d5c5 in raise () from /lib64/libc.so.6
#1  0x00007f0aa9c9ebb3 in abort () from /lib64/libc.so.6
#2  0x00000000004015c8 in compute_mapping (file1=0x7fffb21ddcc0, 
    file2=0x7fffb21ddca0, result=0x7fffb21ddd00) at git-merge-changelog.c:368
#3  0x000000000040338f in main (argc=4, argv=0x7fffb21de078)
    at git-merge-changelog.c:1046

- when I compile with -g -O2:
#0  0x00007fcfba31d5c5 in raise () from /lib64/libc.so.6
#1  0x00007fcfba31ebb3 in abort () from /lib64/libc.so.6
#2  0x0000000000401eba in main (argc=<value optimized out>, 
    argv=<value optimized out>) at git-merge-changelog.c:1467

So, when -O2 was used, gcc decided to inline compute_mapping and to merge all
calls to abort() inside main() into a single one. Bottom line: Always recompile
with "g -O0" before attempting to obtain a stack trace!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]