0

I have python3.7 installed in my RPi. When I call 'python3' as shown below I get the following error:

user@raspberrypi:~ /user_folder $ python3
Segmentation fault

When I run it using gdb I get the following error:

(gdb) run
Starting program: /usr/bin/python3

Program received signal SIGSEGV, Segmentation fault.
0x001100b0 in PyErr_SetObject ()

I tried uninstalling/reinstalling python3, but it did not work. Also, python 2 works well without any issue.

Can someone please tell me how to fix this?

Nht_e0
  • 140
  • 4
  • 15

1 Answers1

0

From https://kb.iu.edu/d/aqsj

A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core . Segfaults are caused by a program trying to read or write an illegal memory location.

I'd suggest that you restart the pi and if that doesn't work - if possible - reinstall the OS. Also this might help: https://www.raspberrypi.org/forums/viewtopic.php?t=267915

EDIT: This is probably caused by a C++ or C error, as stated in the link above. It might also be something related to your modules.

Unless something is up with Python itself it is most likely that a segfault is occurring in some module you are using, which is likely written in C or C++.

Arca Ege Cengiz
  • 315
  • 3
  • 16
  • Restarting didn't work and I am trying my best to save the current OS. Thing is, this occurred out of the blue. I didn't install or update anything. It will be nice to know what happened so that I can avoid it in the future – Nht_e0 Feb 23 '21 at 18:30