I wanted to use ipython for easier exploration of the python
interface, but I got a segmentation fault when I tried to embed it
into the python shell running under ledger:

$ gdb ./build/ledger/debug/ledger
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 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://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from
/home/plouj/git/ledger/build/ledger/debug/ledger...done.
gdb$ run python
[Thread debugging using libthread_db enabled]
Python 2.7.2+ (default, Oct  4 2011, 20:41:12)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from IPython.Shell import IPShellEmbed
>>> ipshell = IPShellEmbed()
>>>
Program received signal SIGSEGV, Segmentation fault.
--------------------------------------------------------------------------[regs]
  EAX: 0x00000000  EBX: 0x00000001  ECX: 0x00E28600  EDX: 0x00000001
o d I t s z a P c
  ESI: 0xF65EB339  EDI: 0x00E2A570  EBP: 0x00000018  ESP: 0xFFFFCBE0
EIP:Error while running hook_stop:
Value can't be converted to integer.
0x00007ffff219c2f1 in ?? () from /usr/lib/python2.7/lib-dynload/readline.so
gdb$ bt
#0  0x00007ffff219c2f1 in ?? () from /usr/lib/python2.7/lib-dynload/readline.so
#1  0x00007ffff76de210 in PyOS_Readline () from /usr/lib/libpython2.7.so.1.0
#2  0x00007ffff76deff5 in ?? () from /usr/lib/libpython2.7.so.1.0
#3  0x00007ffff76dfeb8 in PyTokenizer_Get () from /usr/lib/libpython2.7.so.1.0
#4  0x00007ffff76db3a4 in ?? () from /usr/lib/libpython2.7.so.1.0
#5  0x00007ffff77ae5a6 in PyParser_ASTFromFile () from
/usr/lib/libpython2.7.so.1.0
#6  0x00007ffff77af619 in PyRun_InteractiveOneFlags () from
/usr/lib/libpython2.7.so.1.0
#7  0x00007ffff77af8de in PyRun_InteractiveLoopFlags () from
/usr/lib/libpython2.7.so.1.0
#8  0x00007ffff77afe8c in PyRun_AnyFileExFlags () from
/usr/lib/libpython2.7.so.1.0
#9  0x00007ffff77c1f75 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#10 0x00000000006126f0 in ledger::python_interpreter_t::python_command
(this=0xd14bc0, args=...) at
/home/plouj/git/ledger/src/pyinterp.cc:303
#11 0x0000000000619117 in boost::_mfi::mf1<ledger::value_t,
ledger::python_interpreter_t, ledger::call_scope_t&>::operator()
(this=0x7fffffffd3a8, p=0xd14bc0, a1=...) at
/usr/include/boost/bind/mem_fn_template.hpp:165
#12 0x00000000006188ff 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=0x7fffffffd3b8, f=..., a=...) at
/usr/include/boost/bind/bind.hpp:303
#13 0x00000000006184e7 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=0x7fffffffd3a8, a1=...) at
/usr/include/boost/bind/bind_template.hpp:32
#14 0x0000000000617d9b 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 0x000000000044196a in boost::function1<ledger::value_t,
ledger::call_scope_t&>::operator() (this=0x7fffffffd3a0, a0=...) at
/usr/include/boost/function/function_template.hpp:1013
#16 0x0000000000426e4a in ledger::global_scope_t::execute_command
(this=0xd13b60, args=..., at_repl=0x0) at
/home/plouj/git/ledger/src/global.cc:232
#17 0x000000000042708d in
ledger::global_scope_t::execute_command_wrapper (this=0xd13b60,
args=..., at_repl=0x0) at /home/plouj/git/ledger/src/global.cc:242
#18 0x00000000004189d0 in main (argc=0x2, argv=0x7fffffffde28,
envp=0x7fffffffde40) at /home/plouj/git/ledger/src/main.cc:121

- Ipython embedding commands were taken from
http://folk.uio.no/steikr/doc/python/ipython/node9.html
- ./build/ledger/debug/ledger --version
Ledger 3.0.0-20120217, the command-line accounting tool
- built from master branch (7cc550f)
- config.log: http://plouj.com/debug-ledger-config.log
- ledger python support seems to work otherwise
- ledger is built against these boost libraries:
$ ldd ./build/ledger/debug/ledger|grep boost
        libboost_python-py27.so.1.42.0 =>
/usr/lib/libboost_python-py27.so.1.42.0 (0x00007f250fe4c000)
        libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0
(0x00007f250f736000)
        libboost_filesystem.so.1.42.0 =>
/usr/lib/libboost_filesystem.so.1.42.0 (0x00007f250f521000)
        libboost_system.so.1.42.0 => /usr/lib/libboost_system.so.1.42.0
(0x00007f250f31d000)
        libboost_date_time.so.1.42.0 => /usr/lib/libboost_date_time.so.1.42.0
(0x00007f250f108000)
        libboost_regex.so.1.42.0 => /usr/lib/libboost_regex.so.1.42.0
(0x00007f250eab2000)
- libboost_python is build against:
$ ldd /usr/lib/libboost_python-py27.so.1.42.0
        linux-vdso.so.1 =>  (0x00007fff4c936000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f09cb22d000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007f09cb010000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f09cae0b000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f09cac03000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
(0x00007f09ca8fc000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f09ca677000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x00007f09ca461000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f09ca0c0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f09cb6a9000)
- python is built against:
$ ldd `which python`
        linux-vdso.so.1 =>  (0x00007fff0b30e000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007f3f9dbdb000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3f9d9d7000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3f9d7d3000)
        libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 
(0x00007f3f9d582000)
        libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
(0x00007f3f9d1d3000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f3f9cfba000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3f9cd36000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3f9c995000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3f9de22000)
- OS: Ubuntu Oneiric, Linux durandal 3.0.0-16-generic #29-Ubuntu SMP
Tue Feb 14 12:48:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Reply via email to