tinycc-devel
[Top][All Lists]
Advanced

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

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


From: Evan Langlois
Subject: Re: [Tinycc-devel] Segmentation fault in tccelf.c:2189, strcmp
Date: Tue, 25 Oct 2005 21:02:10 -0500

On Tue, 2005-10-25 at 17:06 -0400, Diego Bauche Madero wrote:
>     /* 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 dynstr and dt->d_un.d_val are the values you say they are, then name
is quite correct.  You added the pointers!  I see no reason at all to
fault the compiler.  You should also likely want to use strncmp so you
have some sort of upper bound on your string compare, just in case.

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

Have you compiled with another compiler to verify that this isn't a
problem in the source and not the compiler?







reply via email to

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