0

One of my RPis has a problem with python3:

root@sent121:~# python3
Segmentation fault

When debugging a print('hello') script I get

root@sent121:~# dbg python3
-bash: dbg: command not found
root@sent121:~# gdb python3
GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...(no debugging symbols found)...done.
(gdb) run /tmp/hello.py
Starting program: /usr/bin/python3 /tmp/hello.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x76fbaa6c in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
(gdb)

There is nothing special about this particular RPi - there are ~20 like him managed the same way and it is the only one and they work fine. But magical things happen with computers and I get it that the binary is somehow corrupted.

I tried to reinstall it but ...

root@sent121:~# apt install python3 --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 25 not upgraded.
Need to get 0 B/21.6 kB of archives.
After this operation, 0 B of additional disk space will be used.
Segmentation fault
E: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 returned an error code (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10

I am not sure how to interpret it - either the install depends on python3 or an upstream library is corrupted (impacting some binaries). This is not a generalized issue, it touches only some of the libraries so it may be a python3 problem:

root@sent121:~# lsb_release -a
Segmentation fault
root@sent121:~# uname -a
Linux sent121 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux
root@sent121:~# curl http://google.com > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   266  100   266    0     0    348      0 --:--:-- --:--:-- --:--:--   348

Are there deb binaries for python3 I could install with dpkg which seems to be ok?

root@sent121:~# dpkg --version
Debian 'dpkg' package management program version 1.18.24 (armhf).

This RPi is far away from me so I would prefer to solve the issue remotely rather than reinstall the card (which I will arrange for is needed)

1

Try to reinstall it manually

$ cd ~

$ wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz

$ sudo tar -xzf Python-3.6.4.tgz
$ cd Python-3.6.4

$ sudo ./configure
$ sudo make
$ sudo make altinstall

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.