Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Debugging a seg fault
#1
Hi,

I have a script running to power a small game, every I can't get past a few loops of the game without it throwing a Seg Fault - looking at the script with faulthandler it is showing the seg fault comes from the python 'requests' library. The script makes regular (every 2 second) http requests to check the state of the game which is store in a web app. The game waits for GPIO input from 6 sources using GPIO.add_event_detect and once the event is detected it makes a post request and removes the event, this request is made which the game is making it's regular requests.

Here is the most recent call back:

Thread 0x76f06010 (most recent call first):
File "/usr/lib/python3.5/http/cookiejar.py", line 950 in set_ok
File "/usr/lib/python3.5/http/cookiejar.py", line 1665 in extract_cookies
File "/home/pi/.local/lib/python3.5/site-packages/requests/cookies.py", line 132 in extract_cookies_to_jar
File "/home/pi/.local/lib/python3.5/site-packages/requests/sessions.py", line 677 in send
File "/home/pi/.local/lib/python3.5/site-packages/requests/sessions.py", line 526 in request
File "/home/pi/.local/lib/python3.5/site-packages/requests/sessions.py", line 679 in send
File "/home/pi/.local/lib/python3.5/site-packages/requests/adapters.py", line 533 in send
File "/home/pi/.local/lib/python3.5/site-packages/requests/cookies.py", line 132 in extract_cookies_to_jar
File "/usr/lib/python3.5/http/cookiejar.py", line 1669 in extract_cookies
File "/usr/lib/python3.5/http/cookiejar.py", line 1629 in make_cookies
File "/usr/lib/python3.5/http/cookiejar.py", line 1563 in _cookies_from_attrs_set
File "/usr/lib/python3.5/http/cookiejar.py", line 1462 in _normalized_cookie_tuples
File "/usr/lib/python3.5/socket.py", line 576 in readinto
File "/usr/lib/python3.5/http/client.py", line 915 in send
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connection.py", line 182 in connect
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/connection.py", line 170 in _new_conn
File "/home/pi/.local/lib/python3.5/site-packages/urllib3/util/connection.py", line 71 in create_connection
Segmentation fault

Has anyone come across this before? Happy to share script if required.

Thanks
Reply
#2
This stack overflow shows some possible reasons for the seg fault, with possible solutions.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  make: *** [Makefile:29: all] Segmentation fault Anldra12 2 1,881 May-01-2022, 06:17 PM
Last Post: Anldra12
  Segmentation fault (core dumped) hobbyist 1 10,494 Jun-07-2021, 12:56 PM
Last Post: supuflounder
  Segmentation fault with large files kusal1 3 2,765 Oct-01-2019, 07:32 AM
Last Post: Gribouillis
  OpenCV - Segmentation fault samtwilliams 6 7,277 Sep-18-2019, 12:01 AM
Last Post: Larz60+
  Segmentation fault when connecting to modbus device with Libmodbus alice 0 2,447 Dec-18-2018, 04:03 PM
Last Post: alice
  calling python function in c++ callback getting segmentation fault error Jotirling 3 7,172 Oct-26-2017, 08:55 AM
Last Post: Larz60+
  Compiler fault or some kind of weird referencing bug? Joseph_f2 11 9,174 May-09-2017, 08:50 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020