sax.make_parser() segfaults

Discussion in 'Python' started by Frank Millman, Nov 29, 2005.

  1. Hi all

    I am using Python 2.4.1. I have machines running FC4, RH9, and MSW
    Server 2003 for testing.

    If I call sax.make_parser() from the interpreter or from a stand-alone
    program, it works fine on all machines, but in the following setup it
    works correctly on MSW, but segfaults on both FC4 and RH9.

    The setup is a client program running wxPython as a gui, and Twisted as
    a means of connecting to a server. Both wxPython's and Twisted's main
    loops seem to be running ok. I have made a remote call to a Twisted
    server, which has returned an xml string. In the callback routine, I
    print the xml for debugging purposes, which looks fine, then I call
    'parser = sax.make_parser()'. At that point it segfaults.

    I added a 'print sax' command just before the call to ensure it is
    valid. It displays <module 'xml.sax' from
    '/usr/lib/python2.4/xml/sax/__init__.pyc'>, which looks correct.

    A little digging reveals that the segfault occurs in
    xml/parsers/expat.py, when it tries to execute 'from pyexpat import *'.

    On FC4 and RH9, pyexpat.so is in python2.4/lib-dynload. On MSW, there
    is a pyexpat.pyd in Python24/DLLSs, and a pyexpat.lib in Python24/libs.
    I don't know if any of this is relevant, but I thought I would supply
    as much info as possible. As mentioned above, I do not have the problem
    with MSW.

    Any suggestions will be much appreciated.

    Thanks

    Frank Millman
    Frank Millman, Nov 29, 2005
    #1
    1. Advertising

  2. Frank Millman wrote:
    > Hi all
    >
    > I am using Python 2.4.1. I have machines running FC4, RH9, and MSW
    > Server 2003 for testing.
    >
    > If I call sax.make_parser() from the interpreter or from a stand-alone
    > program, it works fine on all machines, but in the following setup it
    > works correctly on MSW, but segfaults on both FC4 and RH9.
    >
    > The setup is a client program running wxPython as a gui, and Twisted as
    > a means of connecting to a server.


    Progress report - I have narrowed it down to wxPython. I wrote small
    stand-alone programs, one using Twisted, one using wxPython. Twisted
    works fine, wxPython segfaults.

    If no-one here can help, I will try asking on the wxPython mailing
    list.

    Frank
    Frank Millman, Nov 30, 2005
    #2
    1. Advertising

  3. Frank Millman wrote:
    > > Hi all
    > >
    > > I am using Python 2.4.1. I have machines running FC4, RH9, and MSW
    > > Server 2003 for testing.
    > >
    > > If I call sax.make_parser() from the interpreter or from a stand-alone
    > > program, it works fine on all machines, but in the following setup it
    > > works correctly on MSW, but segfaults on both FC4 and RH9.
    > >
    > > The setup is a client program running wxPython as a gui, and Twisted as
    > > a means of connecting to a server.

    >
    > Progress report - I have narrowed it down to wxPython. I wrote small
    > stand-alone programs, one using Twisted, one using wxPython. Twisted
    > works fine, wxPython segfaults.
    >


    No-one? I thought that a error like this in a standard module would be
    of some concern, even if it turns out that the fault is with wxPython.

    Anyway, I have found a workaround.

    I call sax.make_parser() from the main line of the program, before
    starting the wxPython main loop. The reference it returns is global,
    and can be used anywhere within the program. This seems to work ok.

    Frank
    Frank Millman, Dec 1, 2005
    #3
  4. "Frank Millman" <> writes:

    >> > If I call sax.make_parser() from the interpreter or from a stand-alone
    >> > program, it works fine on all machines, but in the following setup it
    >> > works correctly on MSW, but segfaults on both FC4 and RH9.

    [...]
    >> Progress report - I have narrowed it down to wxPython. I wrote small
    >> stand-alone programs, one using Twisted, one using wxPython. Twisted
    >> works fine, wxPython segfaults.


    Could this be the following python bug:
    https://sourceforge.net/tracker/index.php?func=detail&aid=1075984&group_id=5470&atid=105470

    Bernhard

    --
    Intevation GmbH http://intevation.de/
    Skencil http://skencil.org/
    Thuban http://thuban.intevation.org/
    Bernhard Herzog, Dec 1, 2005
    #4
  5. Bernhard Herzog wrote:
    > "Frank Millman" <> writes:
    >
    > >> > If I call sax.make_parser() from the interpreter or from a stand-alone
    > >> > program, it works fine on all machines, but in the following setup it
    > >> > works correctly on MSW, but segfaults on both FC4 and RH9.

    > [...]
    > >> Progress report - I have narrowed it down to wxPython. I wrote small
    > >> stand-alone programs, one using Twisted, one using wxPython. Twisted
    > >> works fine, wxPython segfaults.

    >
    > Could this be the following python bug:
    > https://sourceforge.net/tracker/index.php?func=detail&aid=1075984&group_id=5470&atid=105470
    >
    > Bernhard
    >
    > --


    The symptoms certainly look the same - thanks for this link.

    It also fits in with my workaround, as someone commented 'if you import
    pyexpat first, it looks fine', which is effectively what I am doing.

    Many thanks for the response.

    Frank
    Frank Millman, Dec 1, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Yampolsky

    axis cpp questions ...?wsdl segfaults

    Rob Yampolsky, May 3, 2005, in forum: Java
    Replies:
    0
    Views:
    475
    Rob Yampolsky
    May 3, 2005
  2. Naveen Parihar

    Weird segfaults

    Naveen Parihar, Apr 1, 2004, in forum: C++
    Replies:
    3
    Views:
    410
    John Harrison
    Apr 6, 2004
  3. Skeleton Man

    fixing random segfaults

    Skeleton Man, Jun 4, 2006, in forum: Perl
    Replies:
    0
    Views:
    2,017
    Skeleton Man
    Jun 4, 2006
  4. Robert Mens

    sprintf segfaults

    Robert Mens, Oct 25, 2003, in forum: C Programming
    Replies:
    3
    Views:
    828
    Kelsey Bjarnason
    Oct 26, 2003
  5. David Douthitt

    Statically-linked binary SegFaults

    David Douthitt, May 20, 2004, in forum: C Programming
    Replies:
    1
    Views:
    381
    Malcolm
    May 20, 2004
Loading...

Share This Page