[C++-sig] possible handle_exception_impl error

Mike Rovner mike at bindkey.com
Thu Nov 21 00:46:07 CET 2002


I got a crash with following backtrace:

>>> from PyTcn import *
>>> a=Layer('a')
>>> a.name

Program received signal SIGSEGV, Segmentation fault.
0xfee5618c in ?? () at dyn-string.c:70 from /usr/local/lib/libstdc++.so.5
70      dyn-string.c: No such file or directory.
(gdb) bt
#0  0xfee5618c in ?? () at dyn-string.c:70 from
/usr/local/lib/libstdc++.so.5
#1  0xfe37dc78 in ?? () at EnvInputStream.cpp:72
   from /export/home/mike/BKsrc/CoreLibraries/src/./PyTcn.so
#2  0xfe378fe4 in ?? () at EnvInputStream.cpp:72
   from /export/home/mike/BKsrc/CoreLibraries/src/./PyTcn.so
#3  0xfe376fc8 in ?? () at EnvInputStream.cpp:72
   from /export/home/mike/BKsrc/CoreLibraries/src/./PyTcn.so
#4  0xfe372ea8 in ?? () at EnvInputStream.cpp:72
   from /export/home/mike/BKsrc/CoreLibraries/src/./PyTcn.so
#5  0xfe36eaa8 in ?? () at EnvInputStream.cpp:72
   from /export/home/mike/BKsrc/CoreLibraries/src/./PyTcn.so
#6  0xfe36ad00 in ?? () at EnvInputStream.cpp:72
   from /export/home/mike/BKsrc/CoreLibraries/src/./PyTcn.so
#7  0xfe19008c in ?? () at
/export/home/mike/boost_1_29_0/boost/function/function_template.hpp:320
   from /usr/local/lib/libboost_python_debug.so
#8  0xfe17aeb0 in _ZNK5boost6python7objects8function4callEP7_objectS4_
(this=0x170618,
    args=0x144060, keywords=0x0) at libs/python/src/object/function.cpp:118
#9  0xfe19177c in ?? () at
/export/home/mike/boost_1_29_0/boost/python/type_id.hpp:127
   from /usr/local/lib/libboost_python_debug.so
#10 0xfe191128 in ?? () at
/export/home/mike/boost_1_29_0/boost/function/function_base.hpp:157
   from /usr/local/lib/libboost_python_debug.so
#11 0xfe1aac3c in ?? () at
/export/home/mike/boost_1_29_0/boost/python/type_id.hpp:127
   from /usr/local/lib/libboost_python_debug.so
#12 0xfe17d7c0 in
_ZN5boost6python21handle_exception_implENS_9function0IvNS_21empty_function_p
olicyENS_20empty_function_mixinESaINS_13function_baseEEEE (f=Cannot access
memory at address 0xfdcef45c
) at libs/python/src/errors.cpp:24
#13 0xfe190460 in ?? () at
/export/home/mike/boost_1_29_0/boost/function/function_template.hpp:296
   from /usr/local/lib/libboost_python_debug.so
#14 0xfe17b7d4 in function_call.2 (func=0x170618, args=0x144060, kw=0x0)
    at libs/python/src/object/function.cpp:355
#15 0x9b388 in PyObject_Call (func=0x170618, arg=0x144060, kw=0x0) at
Objects/abstract.c:1688
#16 0x499d4 in PyEval_CallObjectWithKeywords (func=0x170618, arg=0x144060,
kw=0x0)
    at Python/ceval.c:3058
#17 0x98094 in PyObject_CallFunction (callable=0x170618, format=0x144060 "")
    at Objects/abstract.c:1679
#18 0x1f458 in PyObject_GenericGetAttr (obj=0x1386e8, name=0x1187e8) at
Objects/object.c:1270
#19 0x1f0f8 in PyObject_GetAttr (v=0x1386e8, name=0x1187e8) at
Objects/object.c:1105
#20 0x470b4 in eval_frame (f=0x1197b0) at Python/ceval.c:1784
#21 0x48870 in PyEval_EvalCodeEx (co=0x1812e8, globals=0x1197b0,
locals=0x1812e8, args=0x0,
    argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at
Python/ceval.c:2595
#22 0x4b520 in PyEval_EvalCode (co=0x1812e8, globals=0x117d08, locals=0x0)
at Python/ceval.c:481
#23 0x7706c in run_node (n=0x1658b0, filename=0x117d08 "", globals=0x117d08,
locals=0x117d08,
    flags=0x117d08) at Python/pythonrun.c:1079
#24 0x764d8 in PyRun_InteractiveOneFlags (fp=0xffffffff, filename=0xc64e8
"<stdin>",
    flags=0xffbefb54) at Python/pythonrun.c:590
#25 0x76278 in PyRun_InteractiveLoopFlags (fp=0x1063a8, filename=0xc64e8
"<stdin>",
    flags=0xffbefb54) at Python/pythonrun.c:526
#26 0x77d28 in PyRun_AnyFileExFlags (fp=0x1063a8, filename=0xc64e8
"<stdin>", closeit=0,
    flags=0xffbefb54) at Python/pythonrun.c:489
#27 0x1b8c4 in Py_Main (argc=1, argv=0x1) at Modules/main.c:364
(gdb)

Insteresting is #12 IMHO.

Source:

struct  X {
    X(const char* init) : name(init) {}
    const char* Name() { return name.c_str();}
private:
    std::string name;
};

struct Obj : X { ... };

class_<Obj>("Obj").add_property("name", (const char* (Obj::*)())&Obj::Name);









More information about the Cplusplus-sig mailing list