Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-08-17 23:54:29


GCC 2.95.2 has known EH bugs...
You might try GCC-3.0. I don't know if they've fixed the bugs yet or not,
sorry.
-Dave

----- Original Message -----
From: "Andreas Dietrich" <quasi_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, August 17, 2001 2:52 PM
Subject: Re: [boost] BPL crash

> On Fri, Aug 17, 2001 at 11:31:12AM -0400, David Abrahams wrote:
> > Well, I don't think this is too hard to figure out, even for the
> > uninitiated. Just look at
> > /home/dada/boost_1_23_0/boost/python/conversions.hpp:327, as indicated
> > below. My theory is borne out:
> >
> > inline PyObject* to_python(PyObject* p)
> > {
> > Py_INCREF(p); <<<<<<<<<<<<
> > return p;
> > }
>
> Ok. You are right ;-) I was confused, because I was pretty sure
> that it crashed before test even got called. Here is why:
>
> #include <Python.h>
> #include <stdexcept>
> namespace {
>
> PyObject *test(int l,int h){
> throw std::runtime_error("hello");
> return 0;
> }
> }
> #include <boost/python/class_builder.hpp>
> namespace python = boost::python;
> BOOST_PYTHON_MODULE_INIT(crash) {
> try {
> python::module_builder this_module("crash");
> this_module.def(test,"test");
> }
> catch(...) {
> python::handle_exception();
> }
> }
>
> This snippet also leads to a segfault, unfortunately a different one:
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1024 (LWP 8469)]
> 0x40254753 in __sjpopnthrow () from /usr/lib/libstdc++-libc6.2-2.so.3
>
> So it looks like my compiler is broken :-(. I still think the orignal code
> should not seg-fault, but return None to python, but this should be
trivial
> to add.
>
>
> Andreas
> --
> "We've heard that a million monkeys at a million keyboards could produce
the
> complete works of Shakespeare. Now, thanks to the Internet, we know this
is not
> true." -- Robert Wilensky
>
>
> Info: http://www.boost.org Unsubscribe: <mailto:boost-unsubscribe_at_yahoogr
oups.com>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk