Runtime error while developing gnome applet.




I am trying to develop a panel applet and I have run into a problem that I
can't find the cause of.  I get a segmentation violation at a constant point
in my program from malloc though g_malloc.  The backtrace from gdb is:

Program received signal SIGSEGV, Segmentation fault.
0x40482609 in chunk_free (ar_ptr=0x40512580, p=0xa09926da) at malloc.c:3003
malloc.c:3003: No such file or directory.
(gdb) backtrace
#0  0x40482609 in chunk_free (ar_ptr=0x40512580, p=0xa09926da) at malloc.c:3003
#1  0x4048238d in chunk_alloc (ar_ptr=0x40512580, nb=64) at malloc.c:2515
#2  0x40481b8a in __libc_malloc (bytes=53) at malloc.c:2616
#3  0x8049199 in linsert (olist=0x8098718, 
    name=0x80990d8 "/home/govind/.enlightenment/backgrou\t")
    at gBackGround.c:32
#4  0x80495fe in init () at gBackGround.c:146
#5  0x8049487 in main (argc=1, argv=0xbffffb34) at gBackGround.c:103
#6  0x40441cb3 in __libc_start_main (main=0x8049254 <main>, argc=1, 
    argv=0xbffffb34, init=0x8048dc4 <_init>, fini=0x804968c <_fini>, 
    rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffffb2c)
d    at ../sysdeps/generic/libc-start.c:78

the error comes from:
(char )g_malloc(sizeof(char)*(strlen(name)+1))

name should actually be:
"/home/govind/.enlightenment/backgrounds/pics2/14.jpg"

weather this is gdb truncating it or some other problem I don't know.

If you need to see the source code I can send it to an indavidual or
the list, I just didn't want to waste bandwidth if someone knew
without it.

Thaks in advance.

                                        -Govind Salinas



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