After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 614205 - gedit crashes when I save a PHP file
gedit crashes when I save a PHP file
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.29.x
Other Linux
: Normal critical
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-28 22:31 UTC by Jean-Philippe Fleury
Modified: 2010-03-29 20:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
File making gedit to crash (142.70 KB, text/plain)
2010-03-29 14:55 UTC, Jean-Philippe Fleury
  Details
Log file when the crash is reproduced under valgrind (156.77 KB, application/x-gzip)
2010-03-29 14:56 UTC, Jean-Philippe Fleury
  Details
patch (1.15 KB, patch)
2010-03-29 18:10 UTC, Paolo Borelli
none Details | Review

Description Jean-Philippe Fleury 2010-03-28 22:31:31 UTC
gedit 2.29.9 (on Gnome 2.29.92 and Ubuntu 10.04 Beta 1) always crashes when I try to save (Ctrl+s) a specific PHP file. So I just have to open the PHP file, modify a line and do "Ctrl+s". Then gedit crashes.

Here's the backtrace:

GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/gedit...Reading symbols from /usr/lib/debug/usr/bin/gedit...done.
done.
(gdb) handle SIG33 pass nostop noprint
Signal        Stop	Print	Pass to program	Description
SIG33         No	No	Yes		Real-time event 33
(gdb) set pagination 0
(gdb) run
Starting program: /usr/bin/gedit 
[Thread debugging using libthread_db enabled]
[New Thread 0xb705cb70 (LWP 17523)]
[New Thread 0xb680cb70 (LWP 17542)]
sys:1: Warning: g_object_ref: assertion `G_IS_OBJECT (object)' failed

Program received signal SIGSEGV, Segmentation fault.
0x0068286f in IA__g_cancellable_is_cancelled (cancellable=0x8d91aa8) at /build/buildd/glib2.0-2.23.6/gio/gcancellable.c:411
411	/build/buildd/glib2.0-2.23.6/gio/gcancellable.c: Aucun fichier ou dossier de ce type.
	in /build/buildd/glib2.0-2.23.6/gio/gcancellable.c
(gdb) backtrace full

Thread 1 (Thread 0xb7fdd750 (LWP 17519))

  • #0 IA__g_cancellable_is_cancelled
    at /build/buildd/glib2.0-2.23.6/gio/gcancellable.c line 411
  • #1 complete_in_idle_cb_for_thread
    at /build/buildd/glib2.0-2.23.6/gio/gsimpleasyncresult.c line 647
  • #2 g_idle_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 4065
  • #3 g_main_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 1960
  • #4 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2513
  • #5 g_main_context_iterate
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2591
  • #6 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.23.6/glib/gmain.c line 2799
  • #7 IA__gtk_main
    at /build/buildd/gtk+2.0-2.20.0/gtk/gtkmain.c line 1219
  • #8 main
    at gedit.c line 744
A debugging session is active.

	Inferior 1 [process 17519] will be killed.

Quit anyway? (y or n)
Comment 1 Paolo Borelli 2010-03-29 07:26:23 UTC
Usual set of questions:

 - does this happen with just this file?
 - is this file special in some way (e.g. encoding)?
 - can you attach the file or is it private?
 - do you have plugins active? does it happen if you deactivate them all?
 - can you reproduce under valgrind and attach the file? (see http://live.gnome.org/Valgrind)
Comment 2 Jean-Philippe Fleury 2010-03-29 14:53:28 UTC
(In reply to comment #1)
>  - does this happen with just this file?

I'm not sure. Since I updated to gedit 2.29.9, I experienced many gedit crashes, but I don't know if they are all related to this file. At least, I finally noticed that I can always reproduce the crash with this file.

>  - is this file special in some way (e.g. encoding)?

No. I was modifying this file several times a week before my update to gedit 2.29.9, and I never had any crashes.

>  - can you attach the file or is it private?

Attached. Not all "Ctrl+s" make gedit to crash, but to always reproduce the bug, go to the line 1921, find the only function of the line:

superRawurlencode ($urlCat)

and remove the space between the name of the function and the parentheses enclosing the argument, so:

superRawurlencode($urlCat)

Then do "Ctrl+s". The crash will occur, and a file ".goutputstream-[A-Z0-9]{6}" will be created in the same folder.

>  - do you have plugins active? does it happen if you deactivate them all?

I deactivated all plugins, and gedit still crashes.

>  - can you reproduce under valgrind and attach the file? (see
> http://live.gnome.org/Valgrind)

Attached.
Comment 3 Jean-Philippe Fleury 2010-03-29 14:55:07 UTC
Created attachment 157385 [details]
File making gedit to crash
Comment 4 Jean-Philippe Fleury 2010-03-29 14:56:41 UTC
Created attachment 157386 [details]
Log file when the crash is reproduced under valgrind
Comment 5 Paolo Borelli 2010-03-29 18:10:20 UTC
Created attachment 157397 [details] [review]
patch

Thanks for the detailed bugreport!

This patch should fix the issue: we were hitting a buffer overflow in an uncommon codepath (the file had to have utf8 in strategic positions)
Comment 6 Paolo Borelli 2010-03-29 20:01:15 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.