FAQ
Ack! Help!

Anyone ever seen this? I am trying to call the method of a class instance
and it dies with the message in the subject.

I placed debug statements everywhere and it doesn't seem to even touch the
called code! It dies while calling the code...

Anyone know what's up? I am using threads and I think that is the problem
but it is still one of the weirdest things.

Also, with digital creations now hosting python and all that, do you think
they will create a better navigatable site for python.org? I'm up for hire
to do it myself if no one has time :) The point is the site search engine
doesn't work at all and I was trying to look for help on this subject...
There is a LOT of info on the site, but I can't seem to find any help
whenever I have a problem...

Thanks,
Dan
dan at eevolved.com

Search Discussions

  • Dan Parisien at Jan 30, 2001 at 8:50 pm
    Dan Parisien wrote:

    I have more info. It is a thread problem. The program is a socket server
    with a custom crypto module. I launch a thread to start the main loop to
    listen for new connections. For each new connection, I launch a new thread
    that handles that connection. In that thread I try and call a method from
    my crypto module and I get the error in the subject.

    If I do not use a thread for the server loop, it does not give the error.
    The method is called fine, the data decrypted, then unpickled and life is
    good. There is a problem however... I have no ____ing clue why that
    happens. Does anyone in python devel know what triggers that error msg?

    thanks,
    Dan

    Ack! Help!

    Anyone ever seen this? I am trying to call the method of a class instance
    and it dies with the message in the subject.

    I placed debug statements everywhere and it doesn't seem to even touch the
    called code! It dies while calling the code...

    Anyone know what's up? I am using threads and I think that is the problem
    but it is still one of the weirdest things.

    Also, with digital creations now hosting python and all that, do you think
    they will create a better navigatable site for python.org? I'm up for hire
    to do it myself if no one has time :) The point is the site search engine
    doesn't work at all and I was trying to look for help on this subject...
    There is a LOT of info on the site, but I can't seem to find any help
    whenever I have a problem...

    Thanks,
    Dan
    dan at eevolved.com
  • Fredrik Lundh at Jan 30, 2001 at 9:29 pm

    Dan Parisien wrote:
    If I do not use a thread for the server loop, it does not give the error.
    The method is called fine, the data decrypted, then unpickled and life is
    good. There is a problem however... I have no ____ing clue why that
    happens. Does anyone in python devel know what triggers that error msg?
    it's triggered if Py_InitModule is called (usually by an extension
    module) before the interpreter itself has been initialized.

    on Windows, this can happen if a new version of the interpreter
    picks up an extension linked against an older version of the Python
    DLL, and that DLL is still present. The runtime linker will then load
    the old DLL (without calling Py_Initialize), and the module ends up
    calling the wrong version of Py_InitModule, in an uninitialized DLL.

    Cheers /F
  • Dan Parisien at Jan 30, 2001 at 10:14 pm

    Fredrik Lundh wrote:

    Dan Parisien wrote:
    If I do not use a thread for the server loop, it does not give the
    error. The method is called fine, the data decrypted, then unpickled and
    life is good. There is a problem however... I have no ____ing clue why
    that happens. Does anyone in python devel know what triggers that error
    msg?
    it's triggered if Py_InitModule is called (usually by an extension
    module) before the interpreter itself has been initialized.

    on Windows, this can happen if a new version of the interpreter
    picks up an extension linked against an older version of the Python
    DLL, and that DLL is still present. The runtime linker will then load
    the old DLL (without calling Py_Initialize), and the module ends up
    calling the wrong version of Py_InitModule, in an uninitialized DLL.

    Cheers /F
    Thank you for your quick reply.

    I grepped the python source code and found that output error. I've tested
    the module under many conditions and it works fine. It only crashes if the
    socket server is in its own thread and each connection has their own thread.

    I hope this is a flaw in my code and not in python because I rely on having
    one or more socket servers in their own thread on a listen loop (which I
    had to remove because of this weird problem).

    The module in question was compiled on a Mandrake Linux 7.2 system using
    gcc 2.95.3 and swig 1.3u-20001002-1724 (Alpha 3) (ha! say that 3 times
    fast).

    Except for this newsgroup, are there other areas where I can get help on a
    subject like this?

    Thank you again (this will probably never end ;)
    Dan
  • Mark Hammond at Jan 30, 2001 at 10:36 pm

    Dan Parisien wrote:

    Dan Parisien wrote:

    I have more info. It is a thread problem. The program is a socket server
    with a custom crypto module. I launch a thread to start the main loop to

    This is pretty complicated! The best I can do is point you at the
    CEnterLeavePython class in the Win32 extensions. Check out
    pywintypesmodule.cpp and pywintypes.h - these can be accessed via CVS -
    instructions at http://starship.python.net/crew/mhammond/cvs.html

    This is obviously windows only, and will have some trouble porting to
    Linux due to the lack of portable Thread Local Storage (TLS). The
    PyXPCOM extensions have a more portable implementation, but it uses the
    Netscape Portable Runtime (NSPR) for TLS, so probably isnt what you want.

    Hope this helps...

    Mark.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJan 30, '01 at 6:03p
activeJan 30, '01 at 10:36p
posts5
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase