[Top][All Lists]

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

[Tinycc-devel] Segmentation fault in tccelf.c:2189, strcmp

From: Diego Bauche Madero
Subject: [Tinycc-devel] Segmentation fault in tccelf.c:2189, strcmp
Date: Tue, 25 Oct 2005 17:06:48 -0400
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Here is a bug i came across when compiling an application, i don't
really know where it is, though i thought it may help if i give you guys
some information:

Starting program: /home/rewt/tcc-0.9.23/tcc -IGL
/usr/X11R6/lib/libX11.so.6 /usr/X11R6/lib/libXext.so.6
/usr/X11R6/lib/libGLU.so /usr/X11R6/lib/libglut.so.3 -lGL -IGLU -lm -o
libellenbeck-fract libellenbeck-fract.c

Program received signal SIGSEGV, Segmentation fault.
0xb7e76c28 in strcmp () from /lib/tls/libc.so.6
(gdb) x/i $pc
0xb7e76c28 <strcmp+8>:  mov    (%ecx),%al
(gdb) i r ecx eax
ecx            0x4f6fb954       1332722004
eax            0x26     38
(gdb) x/x *$ecx
Cannot access memory at address 0x4f6fb954
(gdb) bt
#0  0xb7e76c28 in strcmp () from /lib/tls/libc.so.6
#1  0x0805c3fa in tcc_load_dll (s1=0x8070008, fd=8, filename=0xbfd66900
"/usr/lib/libGL.so.1", level=1) at tccelf.c:2189
#2  0x0805bf0c in tcc_add_file_internal (s1=0x8070008,
filename=0xbfd66900 "/usr/lib/libGL.so.1", flags=1) at tcc.c:9923
#3  0x0805c0f5 in tcc_add_dll (s=0x8070008, filename=0x808cb11
"libGL.so.1", flags=2) at tcc.c:9983
#4  0x0805c385 in tcc_load_dll (s1=0x8070008, fd=7, filename=0xbfd696c1
"/usr/X11R6/lib/libGLU.so", level=0) at tccelf.c:2192
#5  0x0805bf0c in tcc_add_file_internal (s1=0x8070008,
filename=0xbfd696c1 "/usr/X11R6/lib/libGLU.so", flags=0) at tcc.c:9923
#6  0x0805e653 in main (argc=12, argv=0xbfd67714) at tcc.c:10642

(I took away the `static' definition of tcc_load_dll by the way)

At tccelf.c line 2182:
    /* load all referenced DLLs */
    for(i = 0, dt = dynamic; i < nb_dts; i++, dt++) {
        switch(dt->d_tag) {
        case DT_NEEDED:
            name = dynstr + dt->d_un.d_val;
            for(i = 0; i < s1->nb_loaded_dlls; i++) {
                dllref = s1->loaded_dlls[i];
                if (!strcmp(name, dllref->name))
                    goto already_loaded;

During the strcmp(name,dllref->name) call, `name' points to 0x4f6fb954,
which is not a valid address, being dynstr = 0x80d4fe8 and dt->d-un =
{d_val = 0x4762696c, d_ptr = 0x4762696c}

If more information is needed (i.e. core file), please let me know.

- Diego Bauche Madero

reply via email to

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