Dave Angel wrote:
Gabriel Genellina wrote: ...
06 May 2009 00:43:25 -0300, Mohamed Lrhazi <lrh...@gmail.com> escribió:
My code sends a pointer to a Python function to a C library, using
ctypes module. When my program restarts, after a crash or normal
exit... it cannot start again without sigfaulting

Do you mean that, if you delete the .pyc files your program runs properly, but if you keep the .pyc files your program crashes?
That's very strange...

1) Is it true (as Gabriel asks) that deleting the .pyc files solves the problem? 2) If so, have you investigated to see which one of them gets corrupted? This isn't necessarily the problem, it could also be timing, or related to the order of the memory allocation pool. 3) When you get the segment fault, what does you C debugger show? What's happening at the time of the crash?
4) Is either the C code or the Python code multithreaded?
5) Are you running it under a Python debugger?

Could this have to do with a manifest floating point constant
being a "Not A Number" or "Infinity"?  That is the last .pyc-
related problem I know about.

To the original poster:
Please give a _lot_ more detail about the full Python version,
OS type and version, and so on.  Otherwise, it becomes
tempting to say, "that is too bad, sorry you have troubles."
One way to isolate the problem (if it is, indeed .pyc-loading
related) is to delete individual .pyc files until you find the
suspect, then cut that one in pieces and re-isolate until you
have a small bit of code with the issue.  This is why we point
people to smart-questions(*) so often.

(*) http://www.catb.org/~esr/faqs/smart-questions.html

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to