[Users] [Bug 2734] hangs when requesting 'help()' in python plugin console

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Tue Oct 16 10:20:24 CEST 2012


http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=2734





--- Comment #4 from Ricardo Mones  2012-10-16 10:20:23 ---
I've been trying to debug this a bit more, see session below. 

Ideas which come to my mind after this are:
 * Also happens with python 2.6
 * Don't understand why some lines appear to be executed twice
   when stepping, but appear once in source code. Anyway it
   seems harmless.
 * The python_plugin delegates execution to PyRun_String so
   not much to blame on the plugin in this regard
 * The help() command is a bit different, because it doesn't
   return, but creates its own prompt instead. My suspect is
   the hang is because it's inner loop is waiting for some
   command (the bt after interrupting shows it in a read())
 * But the help() execution seems not to be inheriting caller's
   stdin/stdout, so unable to receive or generate anything on
   python_plugin's shell.

Towards some solution ideas:
 * Maybe PyRun_String is not the function to run help()-like lines
 * Or maybe the i/o should be handled differently for them
 * Or just deal with help() in some other special way
 * Or just understand which is different in your system's PyRun_String
   which makes it behave differently

Debug session follows:

Breakpoint 1, parasite_python_run (command=0x1215520 "help()", 
    stdout_logger=0x7fffe528edf0 <parasite_python_shell_log_stdout>, 
    stderr_logger=0x7fffe528eda0 <parasite_python_shell_log_stderr>, 
    user_data=0xb7a1f0) at python-hooks.c:197
197    {
(gdb) step
206        if(!strcmp(command, ""))
(gdb) step
211        while(cp && (*cp != '\0') && g_ascii_isspace(*cp))
(gdb) step
213        if(cp && *cp == '#')
(gdb) step
216        gstate = PyGILState_Ensure();
(gdb) step
218        module = PyImport_AddModule("__main__");
(gdb) step
216        gstate = PyGILState_Ensure();
(gdb) step
218        module = PyImport_AddModule("__main__");
(gdb) step
219        dict = PyModule_GetDict(module);
(gdb) step
221        PyRun_SimpleString("old_stdout = sys.stdout\n"
(gdb) step
219        dict = PyModule_GetDict(module);
(gdb) step
221        PyRun_SimpleString("old_stdout = sys.stdout\n"
(gdb) step
226        obj = PyRun_String(command, Py_single_input, dict, dict);
(gdb) step
^C
Program received signal SIGINT, Interrupt.
0x00007ffff15c7630 in read () from /lib/libc.so.6
(gdb) bt
#0  0x00007ffff15c7630 in read () from /lib/libc.so.6
#1  0x00007ffff1571eb8 in _IO_file_underflow () from /lib/libc.so.6
#2  0x00007ffff157359e in _IO_default_uflow () from /lib/libc.so.6
#3  0x00007fffe4c42b38 in ?? () from /usr/lib/libpython2.6.so.1.0
#4  0x00007fffe4c453d7 in PyFile_GetLine () from /usr/lib/libpython2.6.so.1.0
#5  0x00007fffe4cbad27 in ?? () from /usr/lib/libpython2.6.so.1.0
#6  0x00007fffe4cc4f80 in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#7  0x00007fffe4cc5878 in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#8  0x00007fffe4cc5878 in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#9  0x00007fffe4cc6cc0 in PyEval_EvalCodeEx () from
/usr/lib/libpython2.6.so.1.0
#10 0x00007fffe4c4ca7d in ?? () from /usr/lib/libpython2.6.so.1.0
#11 0x00007fffe4c1f103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#12 0x00007fffe4c30abf in ?? () from /usr/lib/libpython2.6.so.1.0
#13 0x00007fffe4c1f103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#14 0x00007fffe4c2fc86 in ?? () from /usr/lib/libpython2.6.so.1.0
#15 0x00007fffe4c1f103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#16 0x00007fffe4cc38af in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#17 0x00007fffe4cc6cc0 in PyEval_EvalCodeEx ()
#18 0x00007fffe4c4c980 in ?? () from /usr/lib/libpython2.6.so.1.0
#19 0x00007fffe4c1f103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#20 0x00007fffe4c30abf in ?? () from /usr/lib/libpython2.6.so.1.0
#21 0x00007fffe4c1f103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#22 0x00007fffe4c8545c in ?? () from /usr/lib/libpython2.6.so.1.0
#23 0x00007fffe4c1f103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#24 0x00007fffe4cc46b9 in PyEval_EvalFrameEx () from
/usr/lib/libpython2.6.so.1.0
#25 0x00007fffe4cc6cc0 in PyEval_EvalCodeEx () from
/usr/lib/libpython2.6.so.1.0
#26 0x00007fffe4cc6d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#27 0x00007fffe4ce49ec in PyRun_StringFlags () from
/usr/lib/libpython2.6.so.1.0
#28 0x00007fffe528e586 in parasite_python_run (command=0x1215520 "help()", 
    stdout_logger=0x7fffe528edf0 <parasite_python_shell_log_stdout>, 
    stderr_logger=0x7fffe528eda0 <parasite_python_shell_log_stderr>, 
    user_data=0xb7a1f0) at python-hooks.c:226
#29 0x00007fffe528f64c in parasite_python_shell_process_line (
    python_shell=<optimized out>) at python-shell.c:242
#30 parasite_python_shell_key_press_cb (textview=<optimized out>, 
    event=<optimized out>, python_shell=0xb7a1f0) at python-shell.c:337
#31 0x00007ffff6a04c78 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#32 0x00007ffff333b47e in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#33 0x00007ffff33513f7 in ?? () from /usr/lib/libgobject-2.0.so.0
#34 0x00007ffff33528bd in g_signal_emit_valist () from
/usr/lib/libgobject-2.0.so.0
#35 0x00007ffff3352fc3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#36 0x00007ffff6b1af7f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#37 0x00007ffff6b2b45b in gtk_window_propagate_key_event () from
/usr/lib/libgtk-x11-2.0.so.0
#38 0x00007ffff6b2e4eb in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#39 0x00007ffff6a04c78 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#40 0x00007ffff333b47e in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#41 0x00007ffff3351040 in ?? () from /usr/lib/libgobject-2.0.so.0
#42 0x00007ffff33528bd in g_signal_emit_valist () from
/usr/lib/libgobject-2.0.so.0
#43 0x00007ffff3352fc3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#44 0x00007ffff6b1af7f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#45 0x00007ffff69fd234 in gtk_propagate_event () from
/usr/lib/libgtk-x11-2.0.so.0
#46 0x00007ffff69fe21b in gtk_main_do_event () from
/usr/lib/libgtk-x11-2.0.so.0
#47 0x00007ffff66723cc in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#48 0x00007ffff2c846f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#49 0x00007ffff2c88568 in ?? () from /lib/libglib-2.0.so.0
#50 0x00007ffff2c88a75 in g_main_loop_run () from /lib/libglib-2.0.so.0
#51 0x00007ffff69fe6b7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#52 0x00000000004b81da in main (argc=1, argv=0x7fffffffe268) at main.c:1698

-- 
Configure bugmail: http://www.thewildbeast.co.uk/claws-mail/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Users mailing list