xfdesktop throws the following error on a Sempron 64 bit FC6 install. GLib-ERROR **: gmem.c:135: failed to allocate 4294967296 bytes aborting... As requested, here is a GDB output: gdb GNU gdb Red Hat Linux (6.5-8.fc6rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". (gdb) quit [kxk@snotux ~]$ gdb xfdesktop GNU gdb Red Hat Linux (6.5-8.fc6rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run Starting program: /usr/bin/xfdesktop [Thread debugging using libthread_db enabled] [New Thread 47305245138352 (LWP 29807)] GLib-ERROR **: gmem.c:135: failed to allocate 4294967296 bytes aborting... GLib-ERROR **: gmem.c:135: failed to allocate 4294967296 bytes aborting... Program received signal SIGABRT, Aborted. [Switching to Thread 47305245138352 (LWP 29807)] 0x0000003605a301b5 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x0000003605a301b5 in raise () from /lib64/libc.so.6 #1 0x0000003605a31b20 in abort () from /lib64/libc.so.6 #2 0x000000360aa35050 in g_logv () from /lib64/libglib-2.0.so.0 #3 0x000000360aa350d3 in g_log () from /lib64/libglib-2.0.so.0 #4 0x000000360aa33dd9 in g_malloc () from /lib64/libglib-2.0.so.0 #5 0x000000360aa449b9 in g_strndup () from /lib64/libglib-2.0.so.0 #6 0x000000360aa44bcb in g_ascii_strup () from /lib64/libglib-2.0.so.0 #7 0x00002b061c100cc3 in _mcs_channel_new (name=0x430926 "BACKDROP", dpy=0x6550e0) at mcs-channel.c:88 #8 0x00002b061c10260c in mcs_client_add_channel (client=0x66c6a0, channel_name=0x430926 "BACKDROP") at mcs-client.c:125 #9 0x0000000000411415 in settings_init () at settings.c:110 #10 0x0000000000410845 in main (argc=1, argv=0x7fff8e9aa0f8) at main.c:333 (gdb)
Created attachment 868 Patch to avoid use of GDK_SCREEN() Might be unrelated, but I think use of GDK_SCREEN() is to be avoided as it's not multi-head safe (search for GDK_MULTIHEAD_SAFE in /usr/include/gtk-2.0/gdk/gdkx.h). I do not know about the version on gtk that is used in FC6 nor what gtk+ patches are applied for FC6, though. You may want to apply this patch that uses GdkScreen/GdkDisplay functions. Might be worth applying, even if it doesn't fix that bug, it's better not to use GDK_DISPLAY() anyhow IMHO.
(In reply to comment #1) > Patch to avoid use of GDK_SCREEN() Read GDK_DISPLAY() here...
Olivier, what does this have to do with this bug?
The crash happens in one of the first calls of xfdesktop, while initiating the mcs channel, ie at the very beginning of xfdesktop. Therefore, I'm exploring anything that could leads to the crash I couldn't explain otherwise. I've also experienced random crashes when xfdesktop is started w/out a mcs manager running and w/out and settings initiated (read fresh install). I'm trying to help.
Tried that patch, same result, gdb output below. As an aside xfce-setting-show does it as well. gdb xfdesktop GNU gdb Red Hat Linux (6.5-8.fc6rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run Starting program: /usr/bin/xfdesktop [Thread debugging using libthread_db enabled] [New Thread 47990731197872 (LWP 20375)] xfce-mcs-manager-Message: Standard XSETTINGS manager already detected for screen 0 GLib-ERROR **: gmem.c:135: failed to allocate 4294967296 bytes aborting... GLib-ERROR **: gmem.c:135: failed to allocate 4294967296 bytes aborting... Program received signal SIGABRT, Aborted. [Switching to Thread 47990731197872 (LWP 20375)] 0x0000003605a301b5 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x0000003605a301b5 in raise () from /lib64/libc.so.6 #1 0x0000003605a31b20 in abort () from /lib64/libc.so.6 #2 0x000000360aa35050 in g_logv () from /lib64/libglib-2.0.so.0 #3 0x000000360aa350d3 in g_log () from /lib64/libglib-2.0.so.0 #4 0x000000360aa33dd9 in g_malloc () from /lib64/libglib-2.0.so.0 #5 0x000000360aa449b9 in g_strndup () from /lib64/libglib-2.0.so.0 #6 0x000000360aa44bcb in g_ascii_strup () from /lib64/libglib-2.0.so.0 #7 0x00002ba5b6373cc3 in _mcs_channel_new (name=0x430946 "BACKDROP", dpy=0x6550e0) at mcs-channel.c:88 #8 0x00002ba5b637560c in mcs_client_add_channel (client=0x66ed90, channel_name=0x430946 "BACKDROP") at mcs-client.c:125 #9 0x000000000041140c in settings_init () at settings.c:112 #10 0x0000000000410835 in main (argc=1, argv=0x7ffff4736e28) at main.c:333 (gdb)
Good to know. Can you run gdb on xfce-setting-show too then? Also, does the xfce-mcs-manager run? => "ps -ef | grep xfce-mcs-manager"
gdb xfce-mcs-manager GNU gdb Red Hat Linux (6.5-8.fc6rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run Starting program: /usr/bin/xfce-mcs-manager [Thread debugging using libthread_db enabled] [New Thread 47787236229344 (LWP 26981)] xfce-mcs-manager-Message: Standard XSETTINGS manager already detected for screen 0 GLib-ERROR **: gmem.c:135: failed to allocate 4294967296 bytes aborting... Program received signal SIGABRT, Aborted. [Switching to Thread 47787236229344 (LWP 26981)] 0x0000003605a301b5 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x0000003605a301b5 in raise () from /lib64/libc.so.6 #1 0x0000003605a31b20 in abort () from /lib64/libc.so.6 #2 0x000000360aa35050 in g_logv () from /lib64/libglib-2.0.so.0 #3 0x000000360aa350d3 in g_log () from /lib64/libglib-2.0.so.0 #4 0x000000360aa33dd9 in g_malloc () from /lib64/libglib-2.0.so.0 #5 0x000000360aa449b9 in g_strndup () from /lib64/libglib-2.0.so.0 #6 0x000000360aa44bcb in g_ascii_strup () from /lib64/libglib-2.0.so.0 #7 0x00002b7654f895d3 in _mcs_channel_new (name=0x2b765a11aa32 "orage", dpy=0x61b5c0) at mcs-channel.c:88 #8 0x00002b7654f8b785 in mcs_manager_add_channel (manager=0x6353d0, channel_name=0x2b765a11aa32 "orage") at mcs-manager.c:190 #9 0x00002b765a118294 in mcs_plugin_init () from /usr/lib/xfce4/mcs-plugins/orage_plugin.so #10 0x0000000000402fe2 in main (argc=1, argv=0x7fff55b24208) at xfce-mcs-manager.c:132 (gdb)
gdb xfce-setting-show GNU gdb Red Hat Linux (6.5-8.fc6rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1". (gdb) run Starting program: /usr/bin/xfce-setting-show [Thread debugging using libthread_db enabled] [New Thread 46973410869456 (LWP 26931)] xfce-mcs-manager-Message: Standard XSETTINGS manager already detected for screen 0 GLib-ERROR **: gmem.c:135: failed to allocate 4294967296 bytes aborting... Program exited normally. (gdb) bt No stack. (gdb) quit
Did you try earlier versions? Did it work with, say, beta1 or even Xfce 4.2?
Ok, I think I know what's going on, the problem is with using -1 as string length in g_ascii_strup(). See that post: http://linuxfromscratch.org/pipermail/cross-lfs/2005-November/000209.html I've committed a fix to libxfce4mcs, can you try? You can grab a copy of current SVN here: http://foo-projects.org/~olivier/preview/ You need to rebuild and install this lib, and apps should be fine.
Taking the bug, it's not xfdesktop related.
Thanks Olivier... while using GDK_DISPLAY() isn't really a big deal (because our multihead-use only ever uses one default Display/GdkDisplay), I'm going to replace most of that libX11 code with the equivalent gdk code.
(In reply to comment #12) > Thanks Olivier... while using GDK_DISPLAY() isn't really a big deal (because > our multihead-use only ever uses one default Display/GdkDisplay), I'm going to > replace most of that libX11 code with the equivalent gdk code. > humm, for Xfce 4.6 right?...
Hi Olivier, Tried the svn of libxfce4mcs, and xfdesktop now works fine, but xfce-setting-show still crashes. Thanks for the help.
Unfortunately, our code is correct, using -1 as length is a documented way of letting the function manage the length iteslf, and works fine on x86_64 (I'm using Ubuntu on an AMD64 system myself) http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.html#g-ascii-strup len : length of str in bytes, or -1 if str is nul-terminated. It means that the problem lies either in you distribution, in the compiler or in the glibc. Did you use any GCC flags? How are set $CFLAGS and $LDFLAGS ?
Also, it seems that the backtrace for xfce-setting-show is incomplete. May I ask you rebuild the xfce-mcs-manager module with --enable-debug just like you did with xfdesktop, and redo the backtrace? TIA.
Actually, from your comment #8, I would say that xfce-setting show works, but xfce-mcs-manager dies. That means that it can be either the manager iteself or any of the modules it loads. Ideally, what you should do is: From a terminal, run gdb xfce-mcs-manager From another terminal run xfes-setting show, I think it will kill xfce-mcs-manager where you'll be able to do a backtrace
Note that there are several other use cases of g_ascii_strup/strdown(..., -1) in the code, among different modules. I'll try to change these too. I'm not quite sure we should fix code that's aren't broken, though....
I've updated the following modules: - xfwm4 - xfce-mcs-plugins - libxfce4mcs And uploaded snapshots to http://foo-projects.org/~olivier/preview/ You may update to rev. r23839 and try... Thanks in advance.
libxfce4mcs and xfwm build fine, but xfce-mcs-plugins throws the following: gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DLOCALEDIR=\"/usr/share/locale\" -I/usr/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0 -I/usr/include/cairo -DUSE_XF86VM -I/usr/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0 -I/usr/include/cairo -DUSE_XRANDR -fno-strict-aliasing -Werror -Wall -g -O2 -g -Wall -DXFCE_DISABLE_DEPRECATED -MT display_plugin_la-display_plugin.lo -MD -MP -MF .deps/display_plugin_la-display_plugin.Tpo -c display_plugin.c -fPIC -DPIC -o .libs/display_plugin_la-display_plugin.o cc1: warnings being treated as errors display_plugin.c: In function 'confirm_timeout_cb': display_plugin.c:159: warning: cast from pointer to integer of different size display_plugin.c:170: warning: cast to pointer from integer of different size make[3]: *** [display_plugin_la-display_plugin.lo] Error 1 make[3]: Leaving directory `/home/kxk/tmptar/xfce-mcs-plugins-4.3.99.3svn-23839/plugins/display_plugin' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/kxk/tmptar/xfce-mcs-plugins-4.3.99.3svn-23839/plugins' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/kxk/tmptar/xfce-mcs-plugins-4.3.99.3svn-23839' make: *** [all] Error 2
There is nothing wrong in the code there, so it's gcc that's wrong. Btw, it's just a warning ,the build fails because of -Werror. Can you try to reconfigure that module without debug (ie --disable-debug) ?
Compiles and works fine with the --disable-debug option. I can now run the settings program. Still some wierdness with beryl, but thats another story.
Ok, thanks for your time testing it. Would have been more insteresting if you could have test xfwm4 instead of using Beryl... Anyway, closing. Thanks again.