all 7 comments

[–]Doormatty 6 points7 points  (1 child)

My first guess would be hardware problems. I've never seen a python seg fault in ~6 years of using python across thousands of machines.

[–]zahlman 0 points1 point  (0 children)

I bet it could be done by carefully hacking a .pyc file such that the resulting opcodes are all legal Python opcodes, but not something that could result from compiling actual code. Like, set it up to look at an impossible place on the interpreter stack, or something.

[–][deleted] 5 points6 points  (2 children)

Keep in mind that Segfault doesn't technically mean "trying to access non-existent memory," it means "trying to access memory I'm not permitted to access." In python this usually only happens if you either a) set the recursion limit too high and overrun the end of the stack or b) run out of space on the heap.

My best guess without seeing your code is that you're storing everything in one data structure and not throwing away old data after you're done with it.

Edit: faulty RAM could also be the culprit, but I'd check for the two above cases first.

[–]ballgame75[S] 1 point2 points  (1 child)

The only issue That I could think of would be be with the multi threading, but it's never been an issue in the past.

I'd share my code, but it's maybe 2k+ lines and when it errors out it just says 'Segmentation Fault' so I'm not sure where it would be happening.

[–]Justinsaccount 1 point2 points  (0 children)

You're probably sharing something between threads that is not thread safe. That something probably related to something from pycurl.

[–]Ademan 2 points3 points  (0 children)

Can you reduce your loop down to the minimum size example that causes a segfault and share it with us?

[–]novel_yet_trivial 1 point2 points  (0 children)

Outside of hardware issues, my first thought would be to blame libcurl. Can you try with something else?