Re: Stack Overflow Question

Kristján Valur Jónsson <[email protected]> Wed, 7 Oct 2015 09:45:43 +0000
Newsgroups gmane.comp.python.stackless
Message-ID <CAP8kY6b=OXaS7gVeMF5=V-xQwo+w2_WtMxLBb+dPxrAVwFxvvw@mail.gmail.com>
--===============0584417692090251085==
Content-Type: multipart/alternative; boundary=047d7bacb5b02ee5e70521809c2e

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

Ah, I see that it did indeed get into 2.7:

https://bitbucket.org/stackless-dev/stackless/commits/949c518c67c75a1655097=
a3f03e0a57f308a454a



On 7 October 2015 at 09:27, Kristj=C3=A1n Valur J=C3=B3nsson <sweskman@gmai=
l.com>
wrote:

> 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 on=
e
> in regular Python.  C extensions that add their own extensions to it, lik=
e
> 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. I=
f
>> 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 ge=
t a
>> segmentation fault. Python reports that the returned object is of the cl=
ass
>> that the factory produced (derived class) but attempts to access the
>> derived classes methods causes the seg fault, but accessing the base cla=
ss
>> 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=3D2
>>
>> Thanks Robert.
>>
>> _______________________________________________
>> Stackless mailing list
>> [email protected]
>> http://www.stackless.com/mailman/listinfo/stackless
>>
>
>

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

<div dir=3D"ltr">Ah, I see that it did indeed get into 2.7:<div><br><div><a=
 href=3D"https://bitbucket.org/stackless-dev/stackless/commits/949c518c67c7=
5a1655097a3f03e0a57f308a454a">https://bitbucket.org/stackless-dev/stackless=
/commits/949c518c67c75a1655097a3f03e0a57f308a454a</a>=C2=A0<br></div><div><=
br></div></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 7 October 2015 at 09:27, Kristj=C3=A1n Valur J=C3=B3nsson <span dir=
=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">sweskm=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div d=
ir=3D"ltr">Hi Robert.<div>Wow, it&#39;s been a long time since I tried usin=
g the boost_python wrappers.</div><div>It is likely that a lot of code is i=
n there that does all kinds of magic.</div><div>Is it possible that you are=
 running into the same kind of problem that we had with other C python libr=
aries that extend the basic PyObject?</div><div><br></div><div>In february =
2014 I checked in a fix to the way the PyHeapType object was being used by =
stackless, see=C2=A0</div><div><a href=3D"https://bitbucket.org/stackless-d=
ev/stackless/commits/0f781d2f" target=3D"_blank">https://bitbucket.org/stac=
kless-dev/stackless/commits/0f781d2f</a><br></div><div><br></div><div>As fa=
r as I can see, this never went into 2,.7</div><div>Basically, the PyHeapTy=
pe as used by stacklesspython deviates from the one in regular Python.=C2=
=A0 C extensions that add their own extensions to it, like windowing extens=
ions and presumably boost-python, will run into conflicts with stackless in=
ternals.</div><div><br></div><div>Can you check with recent versions of pyt=
hon 3?</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote"=
><div><div class=3D"h5">On 25 September 2015 at 16:13, Robert Babiak <span =
dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">rbab=
[email protected]</a>&gt;</span> wrote:<br></div></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><div><div class=3D"h5"><div dir=3D"ltr"><div>I have posted a questio=
n over on stack overflow. One guy has commented that my code works for him.=
 He didn&#39;t say he used stackless, so it is possible that this is someth=
ing that might only occurs with stackless. If any of you have a moment to c=
heck out the question and chime in, I would be grateful.=C2=A0</div><div><b=
r></div><div>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.=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>Fact=
ory returning boost exposed python object seg faults<br><a href=3D"http://s=
tackoverflow.com/q/32784954/2446566?sem=3D2" target=3D"_blank">http://stack=
overflow.com/q/32784954/2446566?sem=3D2</a><div><br></div><div>Thanks Rober=
t.</div></div>
<br></div></div>_______________________________________________<br>
Stackless mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Stackless@stac=
kless.com</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>
</blockquote></div><br></div>

--047d7bacb5b02ee5e70521809c2e--


--===============0584417692090251085==
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
--===============0584417692090251085==--