ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
[C++-sig] problem with python::dict[]
by harold fellermann other posts by this author
Feb 26 2003 5:54PM messages near this date
[C++-sig] Re: Enhanced shared_ptr support | Re: [C++-sig] problem with python::dict[]
Hello,

I got your address from 
http://mail.python.org/pipermail/c++-sig/2002-June/001311.html -- so I 
don't know whether you are the right person to ask.
I think I have found an error in the boost.python's dict-interface.

My following code-snippet runs into segmantation fault:

#include <stdlib.h> 
#include <boost/python/dict.hpp> 

using namespace boost::python;

int main()
{
   dict x[750];

   return 0;
}


The problem seems to concern the garbage collector from the 
Python/C-API, as
my debugger tells me, the program crashes in _PyObject_GC_New():


(gdb) run
Starting program: /home/tsb/harold/c_network/pytest
[New Thread 1024 (LWP 25905)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 25905)]
0x0809a909 in PyErr_Occurred ()
(gdb) bt
#0  0x0809a909 in PyErr_Occurred ()
#1  0x080addca in _PyObject_GC_New ()
#2  0x08064edc in PyDict_New ()
#3  0x4003b1f4 in boost::python::detail::dict_base::dict_base() ()
    from /usr/local/lib/libboost_python.so.1.29.0
#4  0x080c6c6c in main () at pytest.c:9
#5  0x401744a2 in __libc_start_main () from /lib/libc.so.6


I tried this with a couple of python-objects and all containers (dict, 
list, ...)
crashed in exactly the same way. Interestingly the program behaves 
normal when
I reduce the number of objects within my array to approx. 700.

My configuration looks as follows:
- python 2.2.1 (#1, Sep 10 2002, 17:49:17)
- gcc 3.2
- boost version 1.29.0

Do you have any idea what is going on here? Is this a known bug, maybe 
even a nowadays fixed one? Or is it only a question of configuration? 
Any help will be appreciated!


thanx,

- harold fellermann -


--
He who wonders discovers that this in itself is wonder.
-- M.C. Escher


_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
harold fellermann
David Abrahams

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved