Py2exe and extension issues

K

kdahlhaus

Is anyone aware of issues with Py2exe and extensions compiled with
cygwin/mingw for Python 2.3? I have an extension that wraps access to
some C DLLs. The generated executable always segfaults at startup,
although things work fine when running through the normal python
interpreter. I had a guess that perhaps the issue stems from my
extension being compiled with cygwin and py2exe compiled with Visual
C++?
 
J

John Machin

Is anyone aware of issues with Py2exe and extensions compiled with
cygwin/mingw for Python 2.3? I have an extension that wraps access to
some C DLLs. The generated executable always segfaults at startup,
although things work fine when running through the normal python
interpreter. I had a guess that perhaps the issue stems from my
extension being compiled with cygwin and py2exe compiled with Visual
C++?

Some questions:
1. Did it work before (e.g. with Python 2.2, or an earlier version of
py2exe), or has it never worked?
2. Where at start-up does it "segfault"? Doesn't the "Dr Watson" log
file tell you anything? You may need to sprinkle prints and printfs
around your code.
3. Those C DLLs: supplied by whom -- you or an nth party? compiled with
which compiler?
4. Which version(s) of which Windows are you using?

Some hints:
1. Ask on the py2exe mailing list.
2. Your guess may be correct. The usual cause of such a problem is
getting a run-time-library resource on one side of the chasm and trying
to use it on the other side. When the resource is a pointer to a data
structure whose contents are not defined by some standard, anything can
go wrong, and usually does. Examples: (a) malloc() on one side and
free() on the other (b) fopen() on one side and fanything() on the
other. However I would expect these problems to show up under normal
interpreter use.
3. Using py2exe instead of python may merely be exposing a bug in your
code caused by e.g. an uninitialised variable. (-: When you say "things
work fine" in normal interpreter mode, where does this lie in the
continuum between "it ran regression tests and volume tests happily all
night" and "I fired it up and it didn't fall over"? :)

HTH,
John
 
K

kdahlhaus

John,

Thanks, for some reason, I just saw your response. I'll be getting
back to that app in about 2 week and the first item is to look into the
issue.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,219
Messages
2,571,127
Members
47,744
Latest member
FrederickM

Latest Threads

Top