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 540696 - gobject.markup_escape_text() causes python to segfault
gobject.markup_escape_text() causes python to segfault
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
2.14.x
Other All
: Normal critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-28 22:40 UTC by Ashish SHUKLA (आशीष शुक्ल)
Modified: 2008-06-29 14:54 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Ashish SHUKLA (आशीष शुक्ल) 2008-06-28 22:40:32 UTC
Steps to reproduce:
1. Start python

/home/abbe $ python
Python 2.5.2 (r252:60911, Jun 29 2008, 03:10:54) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> 

2. import gobject module.

>>> import gobject

3. Invoke gobject.markup_escape_text() with non-empty string argument.

>>> print gobject.markup_escape_text('Hi')




Stack trace:
abbe [~] chateau% gdb `which python2.5`
GNU gdb 6.1.1 [FreeBSD]
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 "amd64-marcel-freebsd"...
(gdb) core-file python.core 
warning: core file may not match specified executable file.
Core was generated by `python'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libutil.so.7...done.
Loaded symbols for /lib/libutil.so.7
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libthr.so.3...done.
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/python2.5/lib-dynload/readline.so...done.
Loaded symbols for /usr/local/lib/python2.5/lib-dynload/readline.so
Reading symbols from /lib/libreadline.so.7...done.
Loaded symbols for /lib/libreadline.so.7
Reading symbols from /lib/libncurses.so.7...done.
Loaded symbols for /lib/libncurses.so.7
Reading symbols from /usr/local/lib/python2.5/site-packages/gtk-2.0/gobject/_gobject.so...done.
Loaded symbols for /usr/local/lib/python2.5/site-packages/gtk-2.0/gobject/_gobject.so
Reading symbols from /usr/local/lib/libgobject-2.0.so.0...done.
Loaded symbols for /usr/local/lib/libgobject-2.0.so.0
Reading symbols from /usr/local/lib/libglib-2.0.so.0...done.
Loaded symbols for /usr/local/lib/libglib-2.0.so.0
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /usr/local/lib/libintl.so.8...done.
Loaded symbols for /usr/local/lib/libintl.so.8
Reading symbols from /usr/local/lib/libicui18n.so.38...done.
Loaded symbols for /usr/local/lib/libicui18n.so.38
Reading symbols from /usr/local/lib/libpcre.so.0...done.
Loaded symbols for /usr/local/lib/libpcre.so.0
Reading symbols from /usr/local/lib/libicuuc.so.38...done.
Loaded symbols for /usr/local/lib/libicuuc.so.38
Reading symbols from /usr/local/lib/libicudata.so.38...done.
Loaded symbols for /usr/local/lib/libicudata.so.38
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
  • #0 append_escaped_text
    at gmarkup.c line 1952
  • #0 append_escaped_text
    at gmarkup.c line 1952
  • #1 IA__g_markup_escape_text
    at gmarkup.c line 2022
  • #2 ??
    from /usr/local/lib/python2.5/site-packages/gtk-2.0/gobject/_gobject.so
  • #3 PyCFunction_Call
    at ./../Objects/methodobject.c line 77
  • #4 call_function
    at ./../Python/ceval.c line 3573
  • #5 PyEval_EvalFrameEx
    at ./../Python/ceval.c line 2272
  • #6 PyEval_EvalCodeEx
    at ./../Python/ceval.c line 2836
  • #7 PyEval_EvalCode
    at ./../Python/ceval.c line 494
  • #8 run_mod
    at ./../Python/pythonrun.c line 1273
  • #9 PyRun_InteractiveOneFlags
  • #10 PyRun_InteractiveLoopFlags
    at ./../Python/pythonrun.c line 723
  • #11 PyRun_AnyFileExFlags
    at ./../Python/pythonrun.c line 692
  • #12 Py_Main
    at ./../Modules/main.c line 523
  • #13 main
    at ./../Modules/python.c line 23


Other information:
OS: FreeBSD 7.0-RELEASE-p2
Architecture: AMD64

i386 users aren't having this issue.
Comment 1 Johan (not receiving bugmail) Dahlin 2008-06-28 23:14:18 UTC
This works fine for me on x86/linux.
Comment 2 Gustavo Carneiro 2008-06-29 10:50:06 UTC
Works fine for me on x86_64/linux.  But checking the code I found an error, regarding int vs Py_ssize_t.
Comment 3 Gustavo Carneiro 2008-06-29 10:58:37 UTC
Fixed in 2-14 and trunk.
Comment 4 Ashish SHUKLA (आशीष शुक्ल) 2008-06-29 14:54:04 UTC
Thanks for fixing this bug, Gustavo. The fix works :) .