FFP 0.7 arm - Python Segmentation fault

Marvell Kirkwood based
normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

FFP 0.7 arm - Python Segmentation fault

Post by normsland » Sun Jan 08, 2017 9:20 am

Hi All,

Just trying to debug why the latest version of SickRage is causing a segmentation fault on my Zyxel NSA325 NAS. I am running the latest br2:python package.

Code: Select all

funpkg -q python
pip-9.0.1_python2.7-arm-1
python-2.7.13-arm-1
setuptools-33.0.0_python2.7-arm-1
I try to run python from the command rather than start script I get...

Code: Select all

# /ffp/bin/python SickBeard.py
Segmentation fault (core dumped)
I have tried debugging with gdb but I am not getting too far.

Code: Select all

# gdb /ffp/bin/python
GNU gdb (GDB) 7.7
...
Reading symbols from /ffp/bin/python...(no debugging symbols found)...done.
(gdb) run SickBeard.py
Starting program: /ffp/bin/python SickBeard.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/ffp/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x4024dc44 in memcmp () from /ffp/lib/libc.so.0
(gdb) bt
#0  0x4024dc44 in memcmp () from /ffp/lib/libc.so.0
#1  0x40266948 in getenv () from /ffp/lib/libc.so.0
#2  0x401e9254 in ?? () from /ffp/lib/libdl.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Any ideas? I have tried running lddd and I can't see that I am missing any dependences. I have tried turning on debugging on sickrage but as it isn't starting therefore isn't logging anything. Thanks in advance

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: FFP 0.7 arm - Python Segmentation fault

Post by MrDini » Sun Jan 08, 2017 9:27 am

Hi,

Which uClibc version Do You have now? Try to install the latest one with this command:

Code: Select all

slacker -uiA br2:{uClibc,uClibc-solibs}
normsland wrote:I have tried turning on debugging on sickrage but as it isn't starting therefore isn't logging anything.
Yes, because the problem related with the python itself. So if You want to see the debbuging bt, You have to recompile python with debugging enabled.
Thanks nas-central the lot of help! :)

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: FFP 0.7 arm - Python Segmentation fault

Post by normsland » Sun Jan 08, 2017 10:13 am

Already have the latest uClibc libs installed from br2's repository...

Code: Select all

# funpkg -q libc
uClibc-0.9.33.3_git-arm-8
uClibc-solibs-0.9.33.3_git-arm-8
Hmm https://wiki.python.org/moin/DebuggingWithGdb doesn't look like fun :(

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: FFP 0.7 arm - Python Segmentation fault

Post by MrDini » Sun Jan 08, 2017 10:30 am

Okay, try to execute the second and the third command from here.

The package is works for me, So without debug backtrace, that is hard to say, what is the problem exactly...

PS: if nothing helped, try this package also. :)
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2387
Joined: Sun Apr 29, 2012 5:24 pm

Re: FFP 0.7 arm - Python Segmentation fault

Post by barmalej2 » Sun Jan 08, 2017 11:41 am

Can't reproduce, it works for me:
root@NSA310:/i-data/7cf371c4/build# git clone https://github.com/SickRage/SickRage
Cloning into 'SickRage'...
remote: Counting objects: 66615, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 66615 (delta 48), reused 38 (delta 38), pack-reused 66555
Receiving objects: 100% (66615/66615), 66.88 MiB | 986.00 KiB/s, done.
Resolving deltas: 100% (42864/42864), done.
Checking out files: 100% (3520/3520), done.
root@NSA310:/i-data/7cf371c4/build# cd SickRage/
root@NSA310:/i-data/7cf371c4/build/SickRage# /ffp/bin/python SickBeard.py
/i-data/7cf371c4/build/SickRage/sickbeard/logger.py:506: SyntaxWarning: name 'continue_line' is assigned to before global declaration
global continue_line
Unable to find /i-data/7cf371c4/build/SickRage/config.ini, all settings will be default!
13:31:36 INFO::MAIN :: Backing up database before upgrade
13:31:36 INFO::MAIN :: Proceeding with upgrade
13:31:36 INFO::MAIN :: Add minor version numbers to database
13:31:36 INFO::MAIN :: Updated to: 43.1
13:31:36 INFO::MAIN :: Backing up database before upgrade
13:31:36 INFO::MAIN :: Proceeding with upgrade
13:31:36 INFO::MAIN :: Starting SickRage [master] using '/i-data/7cf371c4/build/SickRage/config.ini'
13:31:36 INFO::MAIN :: Generating New API key
13:31:37 INFO::TORNADO :: Starting SickRage on http://0.0.0.0:8081/
13:31:37 INFO::MAIN :: Checking for scene exception updates from http://sickrage.github.io/scene_excepti ... tions.json
13:31:37 INFO::CHECKVERSION :: Checking for updates using GIT
13:31:40 INFO::MAIN :: Checking for XEM scene exception updates for theTVDB
13:31:43 INFO::MAIN :: Checking for scene exception updates for AniDB
^C13:33:27 INFO::MAIN :: Signal 2 caught, saving and exiting...
13:33:27 INFO::EVENT-QUEUE :: Aborting all threads
13:33:27 INFO::EVENT-QUEUE :: Waiting for the DAILYSEARCHER thread to exit
13:33:27 INFO::EVENT-QUEUE :: Waiting for the BACKLOG thread to exit
13:33:27 INFO::EVENT-QUEUE :: Waiting for the SHOWUPDATER thread to exit
13:33:27 INFO::EVENT-QUEUE :: Waiting for the CHECKVERSION thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the SHOWQUEUE thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the SEARCHQUEUE thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the POSTPROCESSOR thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the POSTPROCESSOR thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the TRAKTCHECKER thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the FINDPROPERS thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the FINDSUBTITLES thread to exit
13:33:28 INFO::EVENT-QUEUE :: Waiting for the EVENT-QUEUE thread to exit
13:33:28 INFO::EVENT-QUEUE :: Saving all shows to the database
13:33:28 INFO::EVENT-QUEUE :: Saving config file to disk
13:33:29 INFO::EVENT-QUEUE :: Shutting down Tornado
Make sure that you have all dependent libs installed:

Code: Select all

slacker -UaA br2:{bzip2,db5,expat,gdbm,gettext,libffi,ncurses,openssl,readline,sqlite,uClibc-solibs,zlib}
After installing restart sshd service:

Code: Select all

sh /ffp/start/sshd.sh restart

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: FFP 0.7 arm - Python Segmentation fault

Post by normsland » Sun Jan 08, 2017 1:26 pm

Hi barmalej2

Tried again. Disabled all of my startup files in /ffp/start apart from sshd.sh. Reinstalled all of the dependent libs from both your post and MrDini. Removed all pip installed modules. Still seems to segfault even with a completely new/clean git clone. Do you have ulimit set on your system? Can you share your profiles from /ffp/etc/profile.d/? It might be one of those. Apart from that I am running a NSA325 V1 with firmware NSA325_4.80(AAAJ.1). I am running ffp on a USB stick. Although have tried two different sticks. One that I know is definitely good.

Any ideas would be good. Thanks in advance.

barmalej2
Posts: 2387
Joined: Sun Apr 29, 2012 5:24 pm

Re: FFP 0.7 arm - Python Segmentation fault

Post by barmalej2 » Sun Jan 08, 2017 5:06 pm

Can you share your profiles from /ffp/etc/profile.d/? It might be one of those.
Any profiles wouldn't help you resolve python segfaulting problem. Anyway:

Code: Select all

env
INPUTRC=/ffp/etc/inputrc
SSH_CLIENT=192.168.0.100 49611 22
MAIL=/var/mail/root
USER=root
CXXFLAGS=-march=armv5te -O3
OLDPWD=/i-data/7cf371c4/ffp0.7arm/packages
LESS=-M
HOME=/root
SSH_TTY=/dev/pts/0
LDFLAGS=-L/ffp/lib
PS1=\u@\h:\w\$
PS2=>
LOGNAME=root
NCURSES_NO_UTF8_ACS=1
TERM=xterm
PATH=/ffp/sbin:/usr/sbin:/sbin:/ffp/bin:/usr/bin:/bin
CFLAGS=-march=armv5te -O3
LANG=en_US
XDG_DATA_HOME=/ffp/share
CPPFLAGS=-I/ffp/include
SHELL=/ffp/bin/sh
CXX=g++
CONFIG_SHELL=/ffp/bin/sh
JAVA_HOME=/ffp/opt/java/jre
PWD=/i-data/7cf371c4/ffp0.7arm/packages/nascentral
SSH_CONNECTION=192.168.0.100 49611 192.168.0.3 22
CC=gcc
TZ=EET-2EEST,M3.5.0/3,M10.5.0/4

Code: Select all

alias
ls='LC_ALL=C ls -hv --color --show-control-chars --quoting-style=shell --group-directories-first'
mc='LANG=en_US.UTF-8 mc'
Do you have ulimit set on your system?
No, I don't.
I will to do the same test on fresh ffp stick. Will see, if I can reproduce.

barmalej2
Posts: 2387
Joined: Sun Apr 29, 2012 5:24 pm

Re: FFP 0.7 arm - Python Segmentation fault

Post by barmalej2 » Sun Jan 08, 2017 6:30 pm

It works as expected on fresh ffp stick, with updated default core packages. No doubts culprit is one of your old packages. To figure out, first you need to re-download lddd tool and re-run on your system again. I uploaded updated and a bit optimized version of lddd. It is faster now and has some bugs fixed. If there is no missing libs, then we can use new package manager for ffp (I am testing it right now) to figure out differences between your currently installed packages and packages, that I am using.
Step by step (read to the end first):

Code: Select all

[ -d /ffp/funpkg/cache/br2 ] || mkdir -p /ffp/funpkg/cache/br2
cd /ffp/funpkg/cache/br2
wget -nv http://downloads.zyxel.nas-central.org/Users/barmalej2/ffp/0.7/arm/packages/slapt-get-0.10.2t-arm-2.txz
funpkg -i slapt-get-0.10.2t-arm-2.txz
slapt-get -u
slapt-get --upgrade
Expected output of upgrade command in case of fresh ffp install is:
Reading Package Lists...Done
The following NEW packages will be installed:
db5 gdbm
The following packages will be upgraded:
bash bzip2 coreutils expat findutils gcc-solibs gettext gmp grep libiconv
ncurses openssh openssl pcre perl readline rsync uClibc-solibs util-linux
wget zlib
21 upgraded, 0 reinstalled, 2 newly installed, 0 to remove, 0 not upgraded.
Need to get 22.9MB of archives.
After unpacking 112.0MB of additional disk space will be used.
Do you want to continue? [y/N]
Press N to reject and paste output, what upgrade command offers to you.

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: FFP 0.7 arm - Python Segmentation fault

Post by normsland » Sun Jan 08, 2017 8:42 pm

Output from the new version of lddd after running through a few missing packages and removing old minidlna that I don't use anymore.

Code: Select all

# lddd
Go out and drink some tea, this will take a while :)
STATUS:checking directory... /ffp/lib
STATUS:checking directory... /ffp/sbin
STATUS:checking directory... /ffp/bin
Congratulations! No missing libraries was found in /ffp.
Slapt-get output..

Code: Select all

# slapt-get --upgrade
Reading Package Lists...Done
The following packages will be upgraded:
  bash bzip2 coreutils curl glib grep libevent libxml2 rsync util-linux wget
  zlib
12 upgraded, 0 reinstalled, 0 newly installed, 0 to remove, 0 not upgraded.
Need to get 8.9MB of archives.
After unpacking 45.0MB of additional disk space will be used.
Do you want to continue? [y/N] n
Any advice on the packages I should be upgrading or installing?

barmalej2
Posts: 2387
Joined: Sun Apr 29, 2012 5:24 pm

Re: FFP 0.7 arm - Python Segmentation fault

Post by barmalej2 » Sun Jan 08, 2017 8:52 pm

Upgrade all of proposed in this case, but all of them seems unrelated with your current problem. Run again lddd after upgrade. Can it be that you have several python versions installed (2.*.* and 3.*.* for example)? What output gives you command:

Code: Select all

$(which python) -V
Can you run Sickrage after upgrade?

barmalej2
Posts: 2387
Joined: Sun Apr 29, 2012 5:24 pm

Re: FFP 0.7 arm - Python Segmentation fault

Post by barmalej2 » Sun Jan 08, 2017 9:24 pm

Correction: I see now, that your currently installed bzip2 and zlib are different from those I use. Both are direct dependencies of python core modules. You may want to update them first and re-check to run Sickrage.

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: FFP 0.7 arm - Python Segmentation fault

Post by normsland » Sun Jan 08, 2017 10:26 pm

Unfortunately still no joy. Try upgrading bzip2 and zlib first. Sickrage didn't run. Used slapt-get and it completed fine. Ran again to confirm...

Code: Select all

# slapt-get --upgrade
Reading Package Lists...Done
0 upgraded, 0 reinstalled, 0 newly installed, 0 to remove, 0 not upgraded.

Done
Ran a lddd afterwards to confirm...

Code: Select all

# lddd
Go out and drink some tea, this will take a while :)
STATUS:checking directory... /ffp/lib
STATUS:checking directory... /ffp/sbin
STATUS:checking directory... /ffp/bin
Congratulations! No missing libraries was found in /ffp.
I am running 2.7.13

Code: Select all

# $(which python) -V
Python 2.7.13
Hmm...

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: FFP 0.7 arm - Python Segmentation fault

Post by MrDini » Mon Jan 09, 2017 5:40 am

Did You tried mine package, that I linked?
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2387
Joined: Sun Apr 29, 2012 5:24 pm

Re: FFP 0.7 arm - Python Segmentation fault

Post by barmalej2 » Mon Jan 09, 2017 6:10 am

Ok. That is also variant. Try to install MrDini python with slacker and check if it works. If still not, then:

Code: Select all

slapt-get -i -p python
What packages are proposed to install/upgrade by slapt-get?

normsland
Posts: 69
Joined: Sun Mar 31, 2013 10:07 am

Re: FFP 0.7 arm - Python Segmentation fault

Post by normsland » Mon Jan 09, 2017 10:28 am

Hi Guys,

Thanks for all your help up until now. I have a feeling that my USB stick could be on the way out. I removed the br2 python package using a slacker -r. Then tried to reinstall using a slacker -i to find that the file that it downloaded did not match the md5sum for the file. So I am guessing that there might be something wrong with my USB stick :(. I am thinking of ditching USB and run FFP from HDD via Metarepository. Is there anyway of confirming this before I start again from scratch?

Post Reply