oaken-source / graprof

a profiling and trace analysis tool - see the website for downloads and additional information
http://graprof.grapentin.org
GNU General Public License v3.0
13 stars 1 forks source link

Crashing graprof #2

Closed stefanbeller closed 11 years ago

stefanbeller commented 11 years ago

(tested on the 0.5 tarball version from your website)

When just linking to the graprof library, but forgetting to enable "-g -finstrument-functions" I get a crash of graprof.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000401ba0 in function_compare (f=f@entry=0x0, addr=addr@entry=4197364) at function.c:371
371   res = (strcmp(f->name, name) || strcmp(f->file, file));
(gdb) bt full
#0  0x0000000000401ba0 in function_compare (f=f@entry=0x0, addr=addr@entry=4197364) at function.c:371
        name = 0x61f6b0 "inspectFile"
        file = <optimized out>
        res = 0
#1  0x0000000000402234 in memory_malloc (size=<optimized out>, caller=4197364, result=10777168, time=<optimized out>) at memory.c:209
        b = 0x609790
        func = 0x0
#2  0x000000000040150d in trace_malloc (buf=0x609721) at trace.c:75
        size = <optimized out>
        caller = <optimized out>
        result = <optimized out>
        time = <optimized out>
#3  trace_read (filename=<optimized out>) at trace.c:159
        sign = <optimized out>
        trace = 0x6094c0
        trace_buf = 0x609700
        trace_bufsize = 125
        trace_ended = <optimized out>
        trace_index = 1
#4  0x0000000000401018 in main (argc=<optimized out>, argv=<optimized out>) at graprof.c:62
        args = {binary_filename = 0x7fffffffecd7 "./entropy", trace_filename = 0x7fffffffece1 "trace.out", tasks = 2, out_filename = 0x0}
        res = <optimized out>
oaken-source commented 11 years ago

The reason for this is, that I have currently no means of checking if a given trace file was really generated with a given binary. As soon as I figure something out, I will look into this.

oaken-source commented 11 years ago

fixed on two different levels. the main cause for this was an error in the addr_translate code, where it would segfault if debug information was found for function name, but not for file name, which in turn was caused by the wrong binary being provided for a given trace. both of which are fixed in develop for review.