GNOME Bugzilla – Bug 166350
Gedit crashed when insert date and time.
Last modified: 2005-07-30 09:35:59 UTC
Distribution: Debian 3.1 Package: gedit Severity: normal Version: GNOME2.8.1 2.8.2 Gnome-Distributor: Debian Synopsis: Gedit crashed when insert date and time. Bugzilla-Product: gedit Bugzilla-Component: general Bugzilla-Version: 2.8.2 BugBuddy-GnomeVersion: 2.0 (2.8.0) Description: Description of the crash: If user do not select a system preinstalled format string when he or she insert date and time using `the selected format', gedit will crashed. Steps to reproduce the crash: 1. Run gedit, open a new document(Ctrl_N); 2. Click `Edit' menu, select `Insert Date and Time'; 3. Select option `Use the selected format'(Attention: there is NONE datetime format string be focused!) 4. Click `Insert' button, then gedit is crashed now. Expected Results: None How often does this happen? Everytime I do like above. Additional Information: In step 3, if I select one system preinstalled format string, the gedit will ok.I think there should have a check to prevent user does not selected a format string. Debugging Information: Backtrace was generated from '/usr/bin/gedit' (no debugging symbols found) Using host libthread_db library "/lib/tls/libthread_db.so.1". (no debugging symbols found) `system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols. (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread 1090513728 (LWP 8847)] (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) 0x4055e4ee in __waitpid_nocancel () from /lib/tls/libpthread.so.0
+ Trace 55332
Thread 1 (Thread 1090513728 (LWP 8847))
------- Bug moved to this database by unknown@bugzilla.gnome.org 2005-02-04 23:23 ------- Unknown platform unknown. Setting to default platform "Other". Unknown milestone "unknown" in product "gedit". Setting to default milestone for this product, '---' The original reporter of this bug does not have an account here. Reassigning to the person who moved it here, unknown@bugzilla.gnome.org. Previous reporter was xieyanbo@gmail.com. Setting to default status "UNCONFIRMED". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one.
I cannot reproduce here... here the list is never empty and there is always an item selected. I need some info: 1) You wrote: "Attention: there is NONE datetime format string be focused!" To clarify, do you mean "the list is empty" or "the list has various formats, but none is selected"? 2) what is the value of the following gconf key: /apps/gedit-2/plugins/time/selected_format ? (You can use gconf-editor to check) 3) It would be cool if you could post a stack-trace which includes debugging symbols
1) The fact is "the list has various formats, but none is selected". 2) The value of "/apps/gedit-2/plugins/time/selected_format" is "%x %X". 3) There has a backtrace, using a gedit `core' file that created with: When gedit show error dialog first, click "Restart Application" button, then "insert data and time" again, a core dump file got. Hope it's helpful.(libscim is a input method library, i use it input chinese character.) gedit core backtrace -------------------- 0$ gdb /usr/bin/gedit core GNU gdb 6.3-debian Copyright 2004 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 "i386-linux"...(no debugging symbols found) Using host libthread_db library "/lib/tls/libthread_db.so.1". (no debugging symbols found) Core was generated by `/usr/bin/gedit'. Program terminated with signal 11, Segmentation fault. warning: current_sos: Can't read pathname for load map: / Reading symbols from /usr/lib/libeel-2.so.2...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libeel-2.so.2 Reading symbols from /usr/lib/libgnomeui-2.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnomeui-2.so.0 Reading symbols from /usr/X11R6/lib/libSM.so.6...(no debugging symbols found)...done. Loaded symbols for /usr/X11R6/lib/libSM.so.6 Reading symbols from /usr/X11R6/lib/libICE.so.6... (no debugging symbols found)...done. Loaded symbols for /usr/X11R6/lib/libICE.so.6 Reading symbols from /usr/lib/libgailutil.so.17...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgailutil.so.17 Reading symbols from /usr/lib/libglade-2.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libglade-2.0.so.0 Reading symbols from /usr/lib/libbonoboui-2.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libbonoboui-2.so.0 Reading symbols from /usr/lib/libgnome-2.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnome-2.so.0 Reading symbols from /usr/lib/libgnomevfs-2.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnomevfs-2.so.0 Reading symbols from /usr/lib/libbonobo-2.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libbonobo-2.so.0 Reading symbols from /usr/lib/libgconf-2.so.4...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgconf-2.so.4 Reading symbols from /usr/lib/libbonobo-activation.so.4...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libbonobo-activation.so.4 Reading symbols from /usr/lib/libORBit-2.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libORBit-2.so.0 Reading symbols from /usr/lib/libgthread-2.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgthread-2.0.so.0 Reading symbols from /usr/lib/libgtksourceview-1.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgtksourceview-1.0.so.0 Reading symbols from /usr/lib/libgnomeprintui-2-2.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnomeprintui-2-2.so.0 Reading symbols from /usr/lib/libgnomeprint-2-2.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnomeprint-2-2.so.0 Reading symbols from /usr/lib/libgnomecanvas-2.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnomecanvas-2.so.0 Reading symbols from /usr/lib/libxml2.so.2... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libxml2.so.2 Reading symbols from /lib/tls/libpthread.so.0...(no debugging symbols found)...done. Loaded symbols for /lib/tls/libpthread.so.0 Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /usr/lib/libart_lgpl_2.so.2... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libart_lgpl_2.so.2 Reading symbols from /usr/lib/libpangoft2-1.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libpangoft2-1.0.so.0 Reading symbols from /usr/lib/libgtk-x11-2.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgtk-x11-2.0.so.0 Reading symbols from /usr/lib/libgdk-x11-2.0.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libgdk-x11-2.0.so.0 Reading symbols from /usr/lib/libatk-1.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libatk-1.0.so.0 Reading symbols from /usr/lib/libgdk_pixbuf-2.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgdk_pixbuf-2.0.so.0 Reading symbols from /lib/tls/libm.so.6... (no debugging symbols found)...done. Loaded symbols for /lib/tls/libm.so.6 Reading symbols from /usr/lib/libpangoxft-1.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libpangoxft-1.0.so.0 Reading symbols from /usr/lib/libpangox-1.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libpangox-1.0.so.0 Reading symbols from /usr/lib/libpango-1.0.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libpango-1.0.so.0 Reading symbols from /usr/lib/libgobject-2.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgobject-2.0.so.0 Reading symbols from /usr/lib/libgmodule-2.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgmodule-2.0.so.0 Reading symbols from /lib/tls/libdl.so.2... (no debugging symbols found)...done. Loaded symbols for /lib/tls/libdl.so.2 Reading symbols from /usr/lib/libglib-2.0.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libglib-2.0.so.0 Reading symbols from /lib/libpopt.so.0...(no debugging symbols found)...done. Loaded symbols for /lib/libpopt.so.0 Reading symbols from /lib/tls/libc.so.6... (no debugging symbols found)...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /usr/lib/libXrender.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libXrender.so.1 Reading symbols from /usr/X11R6/lib/libXext.so.6...(no debugging symbols found)...done. Loaded symbols for /usr/X11R6/lib/libXext.so.6 Reading symbols from /usr/X11R6/lib/libX11.so.6... (no debugging symbols found)...done. Loaded symbols for /usr/X11R6/lib/libX11.so.6 Reading symbols from /usr/lib/libgnome-keyring.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnome-keyring.so.0 Reading symbols from /usr/lib/libjpeg.so.62...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libjpeg.so.62 Reading symbols from /usr/lib/libesd.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libesd.so.0 Reading symbols from /usr/lib/libaudiofile.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libaudiofile.so.0 Reading symbols from /usr/lib/libgnutls.so.11...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgnutls.so.11 Reading symbols from /usr/lib/libhowl.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libhowl.so.0 Reading symbols from /lib/tls/libresolv.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/tls/libresolv.so.2 Reading symbols from /lib/tls/librt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/tls/librt.so.1 Reading symbols from /usr/lib/libORBitCosNaming-2.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libORBitCosNaming-2.so.0 Reading symbols from /usr/lib/libfontconfig.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libfontconfig.so.1 Reading symbols from /usr/lib/libfreetype.so.6...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libfreetype.so.6 Reading symbols from /lib/ld-linux.so.2... (no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /usr/X11R6/lib/libXrandr.so.2...(no debugging symbols found)...done. Loaded symbols for /usr/X11R6/lib/libXrandr.so.2 Reading symbols from /usr/X11R6/lib/libXi.so.6...(no debugging symbols found)...done. Loaded symbols for /usr/X11R6/lib/libXi.so.6 Reading symbols from /usr/lib/libXft.so.2... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libXft.so.2 Reading symbols from /usr/lib/libXcursor.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libXcursor.so.1 Reading symbols from /usr/lib/libtasn1.so.2...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libtasn1.so.2 Reading symbols from /usr/lib/libgcrypt.so.11... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libgcrypt.so.11 Reading symbols from /usr/lib/libgpg-error.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libgpg-error.so.0 Reading symbols from /usr/lib/libexpat.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libexpat.so.1 Reading symbols from /lib/tls/libnsl.so.1... (no debugging symbols found)...done. Loaded symbols for /lib/tls/libnsl.so.1 Reading symbols from /lib/tls/libnss_compat.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/tls/libnss_compat.so.2 Reading symbols from /lib/tls/libnss_nis.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/tls/libnss_nis.so.2 Reading symbols from /lib/tls/libnss_files.so.2... (no debugging symbols found)...done. Loaded symbols for /lib/tls/libnss_files.so.2 Reading symbols from /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2...(no debugging symbols found)...done. Loaded symbols for /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 Reading symbols from /usr/lib/gconv/ISO8859-1.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gconv/ISO8859-1.so Reading symbols from /usr/lib/gtk-2.0/2.4.0/loaders/libpixbufloader-png.so... (no debugging symbols found)...done. Loaded symbols for /usr/lib/gtk-2.0/2.4.0/loaders/libpixbufloader-png.so Reading symbols from /usr/lib/libpng12.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libpng12.so.0 Reading symbols from /usr/lib/gnome-vfs-2.0/modules/libfile.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gnome-vfs-2.0/modules/libfile.so Reading symbols from /usr/lib/libfam.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libfam.so.0 Reading symbols from /usr/lib/libstdc++.so.5...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libstdc++.so.5 Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libgcc_s.so.1 Reading symbols from /usr/lib/gtk-2.0/2.4.0/engines/libpixmap.so... (no debugging symbols found)...done. Loaded symbols for /usr/lib/gtk-2.0/2.4.0/engines/libpixmap.so Reading symbols from /usr/lib/gtk-2.0/2.4.0/loaders/libpixbufloader-xpm.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gtk-2.0/2.4.0/loaders/libpixbufloader-xpm.so Reading symbols from /usr/lib/gedit-2/plugins/libshell_output.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libshell_output.so Reading symbols from /usr/lib/gedit-2/plugins/libdocinfo.so... (no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libdocinfo.so Reading symbols from /usr/lib/gedit-2/plugins/libsample.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libsample.so Reading symbols from /usr/lib/gedit-2/plugins/libtime.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libtime.so Reading symbols from /usr/lib/gedit-2/plugins/libindent.so... (no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libindent.so Reading symbols from /usr/lib/gedit-2/plugins/libtaglist.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libtaglist.so Reading symbols from /usr/lib/gedit-2/plugins/libsort.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libsort.so Reading symbols from /usr/lib/gedit-2/plugins/libspell.so... (no debugging symbols found)...done. Loaded symbols for /usr/lib/gedit-2/plugins/libspell.so Reading symbols from /usr/lib/libaspell.so.15...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libaspell.so.15 Reading symbols from /usr/lib/pango/1.4.0/modules/pango-basic-fc.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/pango/1.4.0/modules/pango-basic-fc.so Reading symbols from /usr/lib/pango/1.4.0/modules/pango-arabic-fc.so... (no debugging symbols found)...done. Loaded symbols for /usr/lib/pango/1.4.0/modules/pango-arabic-fc.so Reading symbols from /usr/lib/pango/1.4.0/modules/pango-hangul-fc.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/pango/1.4.0/modules/pango-hangul-fc.so Reading symbols from /usr/lib/gtk-2.0/2.4.0/immodules/im-scim.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gtk-2.0/2.4.0/immodules/im-scim.so Reading symbols from /usr/lib/libscim-1.0.so.0... (no debugging symbols found)...done. Loaded symbols for /usr/lib/libscim-1.0.so.0 Reading symbols from /usr/lib/scim-1.0/1.0.0/Config/socket.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/scim-1.0//1.0.0/Config/socket.so Reading symbols from /usr/lib/scim-1.0/1.0.0/IMEngine/socket.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/scim-1.0//1.0.0/IMEngine/socket.so
+ Trace 55351
I can confirm this happens in 2.8.1
Uhm OK. I fixed the crash in CVS HEAD: the problem happened when we had in gconf a format that is not part of the default list, so that no item was selected, thus causing the crash. I committed the patch straight away because it fixes the crash and because enforcing that an item is always selected should be done anyway... however I still would like to know how you ended up with that format in gconf: - if you edited it with gconf-editor (like I did), fine (there is nothing we can do) - if instead you put it there by using the dialog, there is something else wrong because at that point "custom format" should be selected.
Created attachment 37387 [details] [review] committed patch here is the patch that was committed (for reference). It makes sure that the selection is set to BROWSE (1 and only 1 row selected) and that if the format we get from gconf is not one of our list we fall back to select the first row.
From comment #2: "2) The value of "/apps/gedit-2/plugins/time/selected_format" is "%x %X"." It seems it is one of the formats in formats[]. So probably the crash is due to another problem. Ryan: do you have a stack trace with debugging symbols? Xie: Ryan: which is your locale?
It may be we should use g_ascii_strncmp.
ops... g_ascii_strncmp. does not exist Ryan: what is the value of your "/apps/gedit-2/plugins/time/selected_format" gconf key?
I don't have a gedit built with symbols yet, but it clearly segfaults in libtime.so. I only have LANG set and it crashes for en and jp I do not have such a key in my GConf. there is time/ for selected_format to be in. I'm going to build a gedit with symbols now...
Sorry for my late reply. My locale is: 0$ locale LANG=zh_CN.UTF-8 LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL= Sometimes I use en_US.UTF-8 or zh_CN.GBK, but this bug always follow me :( So I insert date using custom format now :)
Ryan: any news on this bug? (libtime.so is the gedit plugin) Xie: Ryan: it would be possible to have a stack trace with debugging symbols.
After ./configure CFLAGS=-g && make && sudo make install, I got this backtrace: (gdb) bt
+ Trace 56220
Oh, I use gedit source version 2.8.2 to create the backtrace above.
And: (gdb) frame
+ Trace 56221
Xie: sorry for the very late reply. Are you still able to reproduce this crash? From the stack trace you attached. Could you please print the value of "sel_format" and if possible of "formats[sel_format]"? What is returned by the following command? gconftool-2 -g /apps/gedit-2/plugins/time/selected_format
Re-reading this bug, I think the pbor's patch already fixed this problem. Are you guys able to reproduce this crash with 2.10.x? I'm going to attach a patch the makes the get_format_from_list a bit more robust.
Created attachment 49931 [details] [review] Patch
I have just committed the above patch. Closing the bug as FIXED. 2005-07-29 Paolo Maggi <paolo@gnome.org> Fixes bug #166350 (Gedit crashed when insert date and time) * time/time.c (get_format_from_list): return 0 if no format is selected (should never happen). Please, reopen it if you are still able to reproduce with the upcoming 2.10.4 or later.
I download gedit-2.10.3.tar.bz2 from ftp.gnome.org and build it, it's perfect! The dialog of insert data and time can remember and highlight the format last choose. Or just select the first when there is no choose last one. Thanks for pbor and paolo's great jobs!
thanks for testing and confirming.