On Thu, Jul 7, 2011 at 6:38 AM, John Wiegley <[email protected]> wrote:
> Hyrum K Wright <[email protected]> writes:
>
>> $ python
>
> Could you try using "ledger python" instead of just "python"?
>
> I've seen this problem before, it'll just take a moment to remember.

That does work.  I can run the demo.py file, but anything spontaneous
elicits a segfault of the Python interpreter.  For instance:

$ gdb ./ledger
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/hwright/dev/ledger/ledger...done.
(gdb) r python
Starting program: /home/hwright/dev/ledger/ledger python
[Thread debugging using libthread_db enabled]
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:37:12)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ledger
>>> dir(ledger)
>>>
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff26ae4df in ?? () from /usr/lib/python2.7/lib-dynload/readline.so
(gdb) bt
#0  0x00007ffff26ae4df in ?? () from /usr/lib/python2.7/lib-dynload/readline.so
#1  0x00007ffff76d1930 in PyOS_Readline () from /usr/lib/libpython2.7.so.1.0
#2  0x00007ffff76d2595 in ?? () from /usr/lib/libpython2.7.so.1.0
#3  0x00007ffff76d36f8 in PyTokenizer_Get () from /usr/lib/libpython2.7.so.1.0
#4  0x00007ffff76cea34 in ?? () from /usr/lib/libpython2.7.so.1.0
#5  0x00007ffff77a92d1 in PyParser_ASTFromFile () from
/usr/lib/libpython2.7.so.1.0
#6  0x00007ffff77aa259 in PyRun_InteractiveOneFlags ()
   from /usr/lib/libpython2.7.so.1.0
#7  0x00007ffff77aa4de in PyRun_InteractiveLoopFlags ()
   from /usr/lib/libpython2.7.so.1.0
#8  0x00007ffff77aabcc in PyRun_AnyFileExFlags () from
/usr/lib/libpython2.7.so.1.0
#9  0x00007ffff77bf477 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#10 0x0000000000618ddc in ledger::python_interpreter_t::python_command (
    this=0xd21bf0, args=...) at src/pyinterp.cc:303
#11 0x000000000061f873 in boost::_mfi::mf1<ledger::value_t,
ledger::python_interpreter_t, ledger::call_scope_t&>::operator()
(this=0x7fffffffdc08, p=0xd21bf0, a1=...)
    at /usr/include/boost/bind/mem_fn_template.hpp:165
#12 0x000000000061f033 in
boost::_bi::list2<boost::_bi::value<ledger::python_interpreter_t*>,
boost::arg<1> >::operator()<ledger::value_t,
boost::_mfi::mf1<ledger::value_t, ledger::python_interpreter_t,
ledger::call_scope_t&>, boost::_bi::list1<ledger::call_scope_t&> >
(this=0x7fffffffdc18, f=..., a=...)
    at /usr/include/boost/bind/bind.hpp:303
#13 0x000000000061ec0a in boost::_bi::bind_t<ledger::value_t,
boost::_mfi::mf1<ledger::value_t, ledger::python_interpreter_t,
ledger::call_scope_t&>,
boost::_bi::list2<boost::_bi::value<ledger::python_interpreter_t*>,
boost::arg<1> > >::operator()<ledger::call_scope_t>
(this=0x7fffffffdc08, a1=...)
    at /usr/include/boost/bind/bind_template.hpp:32
#14 0x000000000061e4b9 in
boost::detail::function::function_obj_invoker1<boost::_bi::bind_t<ledger::value_t,
boost::_mfi::mf1<ledger::value_t, ledger::python_interpreter_t,
ledger::call_scope_t&>,
boost::_bi::list2<boost::_bi::value<ledger::python_interpreter_t*>,
boost::arg<1> > >, ledger::value_t, ledger::call_scope_t&>::invoke (
    function_obj_ptr=..., a0=...)
    at /usr/include/boost/function/function_template.hpp:132
#15 0x0000000000444fa1 in boost::function1<ledger::value_t,
ledger::call_scope_t&>::operator() (this=0x7fffffffdc00, a0=...)
    at /usr/include/boost/function/function_template.hpp:1013
#16 0x000000000042a328 in ledger::global_scope_t::execute_command
(this=0xd20b60,
    args=..., at_repl=false) at src/global.cc:232
#17 0x000000000042a56b in ledger::global_scope_t::execute_command_wrapper (
    this=0xd20b60, args=..., at_repl=false) at src/global.cc:242
#18 0x000000000041c0c6 in main (argc=2, argv=0x7fffffffe648,
envp=0x7fffffffe660)
    at src/main.cc:121
(gdb)

Obviously, I'd like to do more than run 'dir(ledger)'.  Unfortunately,
most everything I tried caused a segfault; this is just the simplest
example.

I don't know if there is a better way to debug this.

-Hyrum

Reply via email to