Re: Stack Overflow Question

Kristján Valur Jónsson <[email protected]> Wed, 7 Oct 2015 09:27:45 +0000
Newsgroups gmane.comp.python.stackless
Message-ID <CAP8kY6bNTyc7xR0r8=ELi4u7-d63_bHGpX=7ry3mMbqwuEsZPQ@mail.gmail.com>
--===============4200043941604499102==
Content-Type: multipart/alternative; boundary=047d7bae47c6f241e90521805ba1

--047d7bae47c6f241e90521805ba1
Content-Type: text/plain; charset=UTF-8

Hi Robert.
Wow, it's been a long time since I tried using the boost_python wrappers.
It is likely that a lot of code is in there that does all kinds of magic.
Is it possible that you are running into the same kind of problem that we
had with other C python libraries that extend the basic PyObject?

In february 2014 I checked in a fix to the way the PyHeapType object was
being used by stackless, see
https://bitbucket.org/stackless-dev/stackless/commits/0f781d2f

As far as I can see, this never went into 2,.7
Basically, the PyHeapType as used by stacklesspython deviates from the one
in regular Python.  C extensions that add their own extensions to it, like
windowing extensions and presumably boost-python, will run into conflicts
with stackless internals.

Can you check with recent versions of python 3?

On 25 September 2015 at 16:13, Robert Babiak <[email protected]> wrote:

> I have posted a question over on stack overflow. One guy has commented
> that my code works for him. He didn't say he used stackless, so it is
> possible that this is something that might only occurs with stackless. If
> any of you have a moment to check out the question and chime in, I would be
> grateful.
>
> In short what I am seeing is if my derived class is returned (as a pointer
> to the base class) from the factory function to python then I get a
> segmentation fault. Python reports that the returned object is of the class
> that the factory produced (derived class) but attempts to access the
> derived classes methods causes the seg fault, but accessing the base class
> methods works.
>
> *Another question, is anyone aware of an issue with exposing polymorphic
> classes via a factory in an embedded stackless environment? *
>
> Factory returning boost exposed python object seg faults
> http://stackoverflow.com/q/32784954/2446566?sem=2
>
> Thanks Robert.
>
> _______________________________________________
> Stackless mailing list
> [email protected]
> http://www.stackless.com/mailman/listinfo/stackless
>

--047d7bae47c6f241e90521805ba1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Robert.<div>Wow, it&#39;s been a long time since I trie=
d using the boost_python wrappers.</div><div>It is likely that a lot of cod=
e is in there that does all kinds of magic.</div><div>Is it possible that y=
ou are running into the same kind of problem that we had with other C pytho=
n libraries that extend the basic PyObject?</div><div><br></div><div>In feb=
ruary 2014 I checked in a fix to the way the PyHeapType object was being us=
ed by stackless, see=C2=A0</div><div><a href=3D"https://bitbucket.org/stack=
less-dev/stackless/commits/0f781d2f">https://bitbucket.org/stackless-dev/st=
ackless/commits/0f781d2f</a><br></div><div><br></div><div>As far as I can s=
ee, this never went into 2,.7</div><div>Basically, the PyHeapType as used b=
y stacklesspython deviates from the one in regular Python.=C2=A0 C extensio=
ns that add their own extensions to it, like windowing extensions and presu=
mably boost-python, will run into conflicts with stackless internals.</div>=
<div><br></div><div>Can you check with recent versions of python 3?</div></=
div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 25 Septemb=
er 2015 at 16:13, Robert Babiak <span dir=3D"ltr">&lt;<a href=3D"mailto:rba=
[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<b=
r><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>I have posted a ques=
tion over on stack overflow. One guy has commented that my code works for h=
im. He didn&#39;t say he used stackless, so it is possible that this is som=
ething that might only occurs with stackless. If any of you have a moment t=
o check out the question and chime in, I would be grateful.=C2=A0</div><div=
><br></div><div>In short what I am seeing is if my derived class is returne=
d (as a pointer to the base class) from the factory function to python then=
 I get a segmentation fault. Python reports that the returned object is of =
the class that the factory produced (derived class) but attempts to access =
the derived classes methods causes the seg fault, but accessing the base cl=
ass methods works.=C2=A0<br></div><div><br></div><div><b>Another question, =
is anyone aware of an issue with exposing polymorphic classes via a factory=
 in an embedded stackless=C2=A0environment?=C2=A0</b></div><div><br></div>F=
actory returning boost exposed python object seg faults<br><a href=3D"http:=
//stackoverflow.com/q/32784954/2446566?sem=3D2" target=3D"_blank">http://st=
ackoverflow.com/q/32784954/2446566?sem=3D2</a><div><br></div><div>Thanks Ro=
bert.</div></div>
<br>_______________________________________________<br>
Stackless mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"http://www.stackless.com/mailman/listinfo/stackless" rel=3D"nore=
ferrer" target=3D"_blank">http://www.stackless.com/mailman/listinfo/stackle=
ss</a><br></blockquote></div><br></div>

--047d7bae47c6f241e90521805ba1--


--===============4200043941604499102==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless
--===============4200043941604499102==--