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 159255 - Using editable cell renderers and running threads crashes
Using editable cell renderers and running threads crashes
Status: RESOLVED NOTABUG
Product: pygtk
Classification: Bindings
Component: gtk
Git Master
Other Linux
: Normal critical
: ---
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-11-24 00:13 UTC by Tiago Cogumbreiro
Modified: 2005-10-29 13:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Piece of code that reproduces the problem. (1.28 KB, text/plain)
2004-11-24 00:15 UTC, Tiago Cogumbreiro
Details

Description Tiago Cogumbreiro 2004-11-24 00:13:12 UTC
The attached example code does the following. From a certain interval of time it
does a gst operation in the background using gst.Thread. When this operations is
concluded it sends an idle callback to the mainloop which adds elements to a
TreeView. However editing the cell values (using editable cell renderers) while
the elements are added crashes the application. This only happens when the idle
call is sent from the gst.Thread callback. To reproduce it just double click a
row to edit it and a segmentation fault or a an sigterm is sent. Python
sometimes shows this message before crashing:

Fatal Python error: GC object already tracked
Comment 1 Tiago Cogumbreiro 2004-11-24 00:15:22 UTC
Created attachment 34079 [details]
Piece of code that reproduces the problem.
Comment 2 Johan (not receiving bugmail) Dahlin 2004-11-24 10:09:27 UTC
Backtrace

(gdb) bt
  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 raise
    from /lib/tls/libc.so.6
  • #2 abort
    from /lib/tls/libc.so.6
  • #3 Py_FatalError
    from /usr/lib/libpython2.3.so.1.0
  • #4 PyFrame_New
    from /usr/lib/libpython2.3.so.1.0
  • #5 PyEval_EvalCodeEx
    from /usr/lib/libpython2.3.so.1.0
  • #6 PyFunction_SetClosure
    from /usr/lib/libpython2.3.so.1.0
  • #7 PyObject_Call
    from /usr/lib/libpython2.3.so.1.0
  • #8 PyEval_CallObjectWithKeywords
    from /usr/lib/libpython2.3.so.1.0
  • #9 PyObject_CallObject
    from /usr/lib/libpython2.3.so.1.0
  • #10 pyg_closure_marshal
    at pygtype.c line 776
  • #11 IA__g_closure_invoke
    at gclosure.c line 437
  • #12 signal_emit_unlocked_R
    at gsignal.c line 2442
  • #13 IA__g_signal_emit_valist
    at gsignal.c line 2201
  • #14 IA__g_signal_emit
    at gsignal.c line 2245
  • #15 gtk_cell_renderer_text_new
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 gtk_cell_renderer_text_new
    from /usr/lib/libgtk-x11-2.0.so.0
  • #17 gtk_marshal_VOID__UINT_STRING
    from /usr/lib/libgtk-x11-2.0.so.0
  • #18 IA__g_closure_invoke
    at gclosure.c line 437
  • #19 signal_emit_unlocked_R
    at gsignal.c line 2442
  • #20 IA__g_signal_emit_valist
    at gsignal.c line 2211
  • #21 IA__g_signal_emit
    at gsignal.c line 2245
  • #22 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #23 gtk_window_propagate_key_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #24 gtk_window_propagate_key_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 IA__g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 636
  • #26 g_type_class_meta_marshal
    at gclosure.c line 514
  • #27 IA__g_closure_invoke
    at gclosure.c line 437
  • #28 signal_emit_unlocked_R
    at gsignal.c line 2480
  • #29 IA__g_signal_emit_valist
    at gsignal.c line 2201
  • #30 IA__g_signal_emit
    at gsignal.c line 2245
  • #31 gtk_window_get_role
    from /usr/lib/libgtk-x11-2.0.so.0
  • #32 gtk_widget_is_focus
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 gtk_tree_view_scroll_to_cell
    from /usr/lib/libgtk-x11-2.0.so.0
  • #34 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #35 g_type_class_meta_marshal
    at gclosure.c line 514
  • #36 IA__g_closure_invoke
    at gclosure.c line 437
  • #37 signal_emit_unlocked_R
    at gsignal.c line 2480
  • #38 IA__g_signal_emit_valist
    at gsignal.c line 2201
  • #39 IA__g_signal_emit
    at gsignal.c line 2245
  • #40 gtk_widget_grab_focus
    from /usr/lib/libgtk-x11-2.0.so.0
  • #41 gtk_tree_view_set_search_equal_func
    from /usr/lib/libgtk-x11-2.0.so.0
  • #42 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #43 IA__g_closure_invoke
    at gclosure.c line 437
  • #44 signal_emit_unlocked_R
    at gsignal.c line 2442
  • #45 IA__g_signal_emit_valist
    at gsignal.c line 2201
  • #46 IA__g_signal_emit_by_name
    at gsignal.c line 2269
  • #47 gtk_cell_editable_remove_widget
    from /usr/lib/libgtk-x11-2.0.so.0
  • #48 gtk_tree_view_set_search_equal_func
    from /usr/lib/libgtk-x11-2.0.so.0
  • #49 gtk_tree_view_set_model
    from /usr/lib/libgtk-x11-2.0.so.0
  • #50 gtk_marshal_VOID__UINT_STRING
    from /usr/lib/libgtk-x11-2.0.so.0
  • #51 IA__g_closure_invoke
    at gclosure.c line 437
  • #52 signal_emit_unlocked_R
    at gsignal.c line 2442
  • #53 IA__g_signal_emit_valist
    at gsignal.c line 2201
  • #54 IA__g_signal_emit
    at gsignal.c line 2245
  • #55 gtk_tree_model_row_changed
    from /usr/lib/libgtk-x11-2.0.so.0
  • #56 gtk_list_store_set_value
    from /usr/lib/libgtk-x11-2.0.so.0
  • #57 _pygtk_tree_model_set_row
    at gtk-types.c line 1220
  • #58 _wrap_gtk_list_store_append
    at gtktreeview.override line 1399
  • #59 PyCFunction_Call
    from /usr/lib/libpython2.3.so.1.0
  • #60 _PyEval_SliceIndex
    from /usr/lib/libpython2.3.so.1.0
  • #61 PyEval_EvalCodeEx
    from /usr/lib/libpython2.3.so.1.0
  • #62 PyFunction_SetClosure
    from /usr/lib/libpython2.3.so.1.0
  • #63 PyObject_Call
    from /usr/lib/libpython2.3.so.1.0
  • #64 PyEval_CallObjectWithKeywords
    from /usr/lib/libpython2.3.so.1.0
  • #65 PyObject_CallObject
    from /usr/lib/libpython2.3.so.1.0
  • #66 handler_marshal
    at gobjectmodule.c line 1445
  • #67 g_idle_dispatch
    at gmain.c line 3821
  • #68 IA__g_main_context_dispatch
    at gmain.c line 1947
  • #69 g_main_context_iterate
    at gmain.c line 2578
  • #70 IA__g_main_loop_run
    at gmain.c line 2782
  • #71 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #72 _wrap_gtk_main
    at gtk.override line 867
  • #73 _PyEval_SliceIndex
    from /usr/lib/libpython2.3.so.1.0
  • #74 PyEval_EvalCodeEx
    from /usr/lib/libpython2.3.so.1.0
  • #75 PyEval_EvalCode
    from /usr/lib/libpython2.3.so.1.0
  • #76 PyErr_Display
    from /usr/lib/libpython2.3.so.1.0
  • #77 PyRun_SimpleFileExFlags
    from /usr/lib/libpython2.3.so.1.0
  • #78 PyRun_AnyFileExFlags
    from /usr/lib/libpython2.3.so.1.0
  • #79 Py_Main
    from /usr/lib/libpython2.3.so.1.0
  • #80 main

Comment 3 Johan (not receiving bugmail) Dahlin 2004-11-24 10:11:38 UTC
sorry. forgot the backtrace for the second thread (or 8th, since it took a few
iterations before it crashed)
(gdb) bt
  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 __lll_mutex_unlock_wake
    from /lib/tls/libpthread.so.0
  • #2 pthread_cond_signal
    from /lib/tls/libpthread.so.0
  • #3 gst_thread_main_loop
    at gstthread.c line 726
  • #4 g_thread_create_proxy
    at gthread.c line 560
  • #5 start_thread
    from /lib/tls/libpthread.so.0
  • #6 clone
    from /lib/tls/libc.so.6

Comment 4 Johan (not receiving bugmail) Dahlin 2004-11-24 10:13:24 UTC
Moving to PyGTK
Comment 5 Jean-Yves Lefort 2004-12-03 15:08:25 UTC
Duplicate of #160349.
Comment 6 John Ehresman 2004-12-03 17:32:14 UTC
It's pretty clear that the ensure_gil_state call is failing to set a thread
state.  Can you see if the problem is that pyg_find_thread_state() is returning
NULL on the main thread?
Comment 7 Gustavo Carneiro 2005-10-29 13:20:45 UTC
Running this program, I got:

gjc@emperor:tmp$ python test.py  /garbage/music/Summoning/Minas\ Morgul/02\ -\
Lugburz.mp3
...
eos
...
Fatal Python error: Objects/frameobject.c:403 object at 0x80b879c has negative
ref count -1
Aborted (core dumped)

Then I added "gobject.threads_init()" right after importing modules, and then it
works.

Lesson to be taken: for programs that use threads, _any threads_,
gobject.threads_init() _must_ be called.