Re: Stack Overflow Question

Christian Tismer <[email protected]> Thu, 8 Oct 2015 15:28:06 +0200
Newsgroups gmane.comp.python.stackless
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============6297534071679014840==
Content-Type: multipart/alternative;
 boundary="------------050305080007010204030508"

This is a multi-part message in MIME format.
--------------050305080007010204030508
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Sir! :-)

Sure it did!

I was so happy that we now could use Stackless with PySide
with no extras needed.

cheers -- Chris


On 07.10.15 11:45, Kristján Valur Jónsson wrote:
> Ah, I see that it did indeed get into 2.7:
>
> https://bitbucket.org/stackless-dev/stackless/commits/949c518c67c75a1655097a3f03e0a57f308a454a 
>
>
>
> On 7 October 2015 at 09:27, Kristján Valur Jónsson <[email protected] 
> <mailto:[email protected]>> 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 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]
>     <mailto:[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] <mailto:[email protected]>
>         http://www.stackless.com/mailman/listinfo/stackless
>
>
>
>
>
> _______________________________________________
> Stackless mailing list
> [email protected]
> http://www.stackless.com/mailman/listinfo/stackless


-- 
Christian Tismer             :^)   [email protected]
Software Consulting          :     http://www.stackless.com/
Karl-Liebknecht-Str. 121     :     https://github.com/PySide
14482 Potsdam                :     GPG key -> 0xFB7BEE0E
phone +49 173 24 18 776  fax +49 (30) 700143-0023


--------------050305080007010204030508
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Sir! :-)<br>
      <br>
      Sure it did!<br>
      <br>
      I was so happy that we now could use Stackless with PySide<br>
      with no extras needed.<br>
      <br>
      cheers -- Chris<br>
      <br>
      <br>
      On 07.10.15 11:45, Kristján Valur Jónsson wrote:<br>
    </div>
    <blockquote
cite="mid:CAP8kY6b=OXaS7gVeMF5=V-xQwo+w2_WtMxLBb+dPxrAVwFxvvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org"
      type="cite">
      <div dir="ltr">Ah, I see that it did indeed get into 2.7:
        <div><br>
          <div><a moz-do-not-send="true"
href="https://bitbucket.org/stackless-dev/stackless/commits/949c518c67c75a1655097a3f03e0a57f308a454a">https://bitbucket.org/stackless-dev/stackless/commits/949c518c67c75a1655097a3f03e0a57f308a454a</a> <br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 7 October 2015 at 09:27, Kristján
          Valur Jónsson <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:[email protected]" target="_blank">[email protected]</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hi Robert.
              <div>Wow, it's been a long time since I tried using the
                boost_python wrappers.</div>
              <div>It is likely that a lot of code is in 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
                libraries 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 </div>
              <div><a moz-do-not-send="true"
                  href="https://bitbucket.org/stackless-dev/stackless/commits/0f781d2f"
                  target="_blank">https://bitbucket.org/stackless-dev/stackless/commits/0f781d2f</a><br>
              </div>
              <div><br>
              </div>
              <div>As far as I can see, this never went into 2,.7</div>
              <div>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.</div>
              <div><br>
              </div>
              <div>Can you check with recent versions of python 3?</div>
            </div>
            <div class="gmail_extra"><br>
              <div class="gmail_quote">
                <div>
                  <div class="h5">On 25 September 2015 at 16:13, Robert
                    Babiak <span dir="ltr">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:[email protected]" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a></a>&gt;</span>
                    wrote:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="h5">
                      <div dir="ltr">
                        <div>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. </div>
                        <div><br>
                        </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. <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 environment? </b></div>
                        <div><br>
                        </div>
                        Factory returning boost exposed python object
                        seg faults<br>
                        <a moz-do-not-send="true"
                          href="http://stackoverflow.com/q/32784954/2446566?sem=2"
                          target="_blank">http://stackoverflow.com/q/32784954/2446566?sem=2</a>
                        <div><br>
                        </div>
                        <div>Thanks Robert.</div>
                      </div>
                      <br>
                    </div>
                  </div>
                  _______________________________________________<br>
                  Stackless mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:[email protected]"
                    target="_blank">[email protected]</a><br>
                  <a moz-do-not-send="true"
                    href="http://www.stackless.com/mailman/listinfo/stackless"
                    rel="noreferrer" target="_blank">http://www.stackless.com/mailman/listinfo/stackless</a><br>
                </blockquote>
              </div>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Stackless mailing list
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a class="moz-txt-link-freetext" href="http://www.stackless.com/mailman/listinfo/stackless">http://www.stackless.com/mailman/listinfo/stackless</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Christian Tismer             :^)   <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
Software Consulting          :     <a class="moz-txt-link-freetext" href="http://www.stackless.com/">http://www.stackless.com/</a>
Karl-Liebknecht-Str. 121     :     <a class="moz-txt-link-freetext" href="https://github.com/PySide">https://github.com/PySide</a>
14482 Potsdam                :     GPG key -&gt; 0xFB7BEE0E
phone +49 173 24 18 776  fax +49 (30) 700143-0023
</pre>
  </body>
</html>

--------------050305080007010204030508--


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