Cygwin, xffm: core dump

edscott wilson garcia edscott at xfce.org
Thu Sep 30 15:30:08 CEST 2004


El jue, 30-09-2004 a las 03:47, boekhold at emirates.net.ae escribió:
> Hi Edscott,
> 
> I've finally been able to test xffm for the first time under cygwin (the
> gmodule bug I mentioned earlier has been fixed), and I immediately get a
> coredump when running xffm:
> 
> (gdb) set environment DISPLAY :1.0
> (gdb) run
> I/O warning : failed to load external entity
> "/home/Maarten/.config/xfce4/xffm/xffmrc.xml"
> ** Message: xffm: module
> /opt/xfce/lib/xfce4/modules/cygxfce4_mime_icons.dll successfully loaded
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x004130da in get_config (rcfile=0x10089228
> "/home/Maarten/.config/xfce4/xffm/xffmrc.xml") at settings.c:173
> 
> Do you have any idea?

The line where it segfaults is where the module is loaded. So I assume
that the problem must occur during the module initialization. This is
done by load_module() (xffm/libs/module.c) and  g_module_check_init()
(libxfcegui4/xfce4-modules/mime-icons/mime_icons.c).

Possible reasons for a segfault? Maybe g_new0() does not work right on
cygwin. Thus line 107 of mime_icons.c would lead to a segfault:

    xfmime_icon_fun = g_new0 (xfmime_icon_functions,1);

You could try changing it to:

    xfmime_icon_fun =
      (xfmime_icon_functions *)malloc(sizeof(xfmime_icon_functions));

The above does not seem likely. Also, in settings.c, just before the
segfault at line 170, there is a 

	xmlFreeDoc(xmlconfig);

Maybe the segfault can be avoided by using:

	if (xmlconfig) xmlFreeDoc(xmlconfig);

Does the file /home/Maarten/.config/xfce4/xffm/xffmrc.xml exists after
the first time you get the segfault? It should. If it does not, then the
segfault should come from one of the settings.c functions:

write_xffm_config()
write_config()
xffm_write_xml()
save_sb()

Also, the segfault could be caused by load_module(), but I see no reason
for that.

If it is none of the above, then the segfault is happening somewhere
before this segment of code is reached and the signal is received later
on. This usually happens to me when a junk pointer is freed. With a
traceback you can see the program flow and should be fairly easy (since
crash comes on startup) to look through the code that is executed for
"free" instructions.

> 
> (I'm using DDD at the moment as debugger, but it's really slow/crappy
> under cygwin. Does anybody know of another/better graphical gdb front-end?)
> 

Valgrind maybe? 

regards,

Edscott 




More information about the Xfce4-dev mailing list