Segmentation fault? What now?

This is the place for queries that don't fit in any of the other categories.

Segmentation fault? What now?

Postby ekyle » Fri Sep 23, 2016 1:22 am

I have a few hundred line Python program. It does not finish properly:

On Windows (mem test passed, and fresh installed python)

> Process finished with exit code -1073741819 (0xC0000005)
> C:\Users\kyle\code\ActiveData>c:\Python27\python.exe --version
> Python 2.7.12

Similar on Linux (AWS CentOS derivative)

> Segmentation fault
> [ec2-user@ip-172-31-0-135 ActiveData]$ python --version
>' Python 2.7.10
"
I do not know where to begin. The program [1] appears simple, but it interacts with a large ES cluster (so this bug may be data dependent). There are also a number of other threads spawned by the libraries that could be causing this problem. The program fails consistently; but the exact point appears to change. It also happens when debugging; but it does not seem to happen at the same point. At no point is Python using too much memory (a known source of unexplained exits). I am will start bisecting the problem, but I suspect this Heisenbug will not reveal itself easily.

In the meantime, I hope someone else has seen this, and suggest what type of problem it is.

Thank you

[1a] https://github.com/klahnakoski/ActiveDa ... _shards.sh
[1b] https://github.com/klahnakoski/ActiveDa ... _shards.py
Last edited by micseydel on Fri Sep 23, 2016 2:52 am, edited 1 time in total.
Reason: Initial post lock.
ekyle
 
Posts: 2
Joined: Fri Sep 23, 2016 12:54 am

Re: Segmentation fault? What now?

Postby micseydel » Fri Sep 23, 2016 3:04 am

Can you give any more context on this? When did it start happening? Have you eliminated any large swathes of code as culprits? By the git blame, it looks like you've written all those code yourself over many months - is any of it substantially from somewhere else? Is it possible to give instructions to make this runnable by someone else?

You mentioned bisecting so I suspect you have a decent idea about this, but once I had an issue of similar scale and I literally deleted half of the code at a time until I found a small area to examine. The fewer lines of code, the more likely you'll get people to really take the time to look at it.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Segmentation fault? What now?

Postby ekyle » Fri Sep 23, 2016 7:50 pm

Thank you for the response. I have no expectation that anyone be able to run the code, especially since it happens only after it accumulated some amount of state, and gets that state from another server.

I am hoping that particular exit code, or segfault, may remind someone about situations Python does this. Or maybe this is just a standard Python exit code?
ekyle
 
Posts: 2
Joined: Fri Sep 23, 2016 12:54 am


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 11 guests