Segmentation fault only on Iinux

faulkner faulkner612 at comcast.net
Wed Jun 21 01:25:56 CEST 2006


if you don't know exactly which line of code causes the segfault, use
print statements to determine that. then try to either
redesign/refactor so that line isn't necessary, or protect its
operation somehow.
if you do know, tell us what it is and we might not need to see all
your code.

Kiran wrote:
> Hello All,
>   In my program, I have a main thread which is the GUI (wxPython) and
> then a thread which goes and reads data from a socket.  The reason this
> is in a different thread is because the data might take some time to
> come back, and I want to have the GUI to be responsive during this
> wait.
>
>  When I run my program in Linux,   a segmentation fault occurs.  When I
> run it in Windows XP, it works just fine.
>
> The main thing that would be of interest is as follows:
>   The segmentation fault does NOT occur if I disable the threads and
> read the data all in 1 thread (the main thread [gui's]).  This leads me
> to believe it is some sort of threading problem related to linux.
> However, I personally dont think that it can be something wrong with my
> code, since my program runs perfectly fine in WindowsXP.  I am also
> carefully protecting data that my threads share with the MainGUI using
> a Queue and also a semaphore lock.
>
> I know this is kind of hard to answer without any code, but would
> anybody know of some kind of issue such as this where there is some
> threading problems with Linux and not Windows.  I am happy to send the
> code to anybody who wishes to see it.  I havent posted it here because
> it is kind of lengthy.
>
> Also, I should note that I think we are running Linux Kernel 2.4
> 
> thanks a lot for your help,
> Kiran




More information about the Python-list mailing list