468,115 Members | 2,079 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,115 developers. It's quick & easy.

Py2exe and extension issues

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++?

Jul 18 '05 #1
2 1577

kd*******@yahoo.com wrote:
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

Jul 18 '05 #2
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.

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Thomas Heller | last post: by
6 posts views Thread by Luc Saffre | last post: by
reply views Thread by Marco Aschwanden | last post: by
5 posts views Thread by Thomas Heller | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
reply views Thread by Larry Bates | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.