New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random segfault Nvidia Shield Tube (32-bit) during playback #368
Comments
I can see is that it is failing in socket code. Are you doing anything unusual network-wise? Are you using a network remote to control playback? Is it possible there is a network failure somewhere? This is in code that is not specific to Android, so it is possible that the same failure could occur in a Linux frontend. It looks like you are using the 32-bit build. The original shield is able to run the 64-bit build. They should both work, but you could try the 64-bit build to see if that helps. |
I'm running MythTv 32-bit because it is the 2019 'tube' variant, which is 32 bit I believe. The Shield is connected via Ethernet through a switch to the backend (1 Gbps, full duplex) I'm only having Nvidia Shields as frontends. I could try a Frontend on my Ubuntu laptop and see if I can reproduce. Is there any way to debug the socket communication on the frontend and backend side, and compare? |
Hi, I know 'me too' posts are not welcome, but I did want to add that I have very similar issues, but with a Sony android TV (32-bit build only compatible build). I have random infrequent crashes, and it has been happening for a long time for me (year+, over every build I have tried), but I have only recently got motivated enough to see what might be going on. I think the pertinent log lines (via adb logcat), from 2 separate errors recently:
Sorry, I don't have full traces, etc. and I can't be quite sure this seg fault is the same code path? Fwiw: the crashes are happening mid-playback, no 'interaction' via remote, or otherwise when it crashes. The logs on the frontend show a checkWifi state (it is disabled for me) as the last item before each crash, but I'm not convinced this is related as these are in my logs every 5 seconds, so I think it is just the last item that dropped a log line out. HTH |
This issue is still teasing me. I've done some further investigation. I've also added a recent backtrace. Shield running on: 9.0.0 but also on 9.0.1 (issue was also present before) The segfault is only happening when the Shield is connected over the Ethernet link. When connected via Wireless, no segfault happened so far. Some questions I have open:
Full backtrace: gdb.txt |
will try - may take some time, the only shield TV that can do wireless is used infrequently. But, it crashed last night, which prompted me to switch it to wireless. If it last a week or two like this, then it may well confirm your theory. BTW, I get these crashes on my Shield (Tube version), but also a Sony TV as well. |
My crashes continued (have had 2 since the last post) on wireless, so seems there is either 2 issues, or its not the wired network code. HTH |
Thanks @ddp526 Regards, Charles |
I've recompiled with Qt 5.15.3 but same crashes are happening, unfortunately. |
I've been doing test with Shield Tube (32-bit) and Shield Pro (64-bit). The Shield Pro is running perfectly fine, without any issues. The Shield Tube is having the crashes. |
Look at your backtrace for something like this near the start: Thread 21 "MythSocketThrea" received signal SIGSEGV, Segmentation fault. Search the trace for the string "Thread 21". (substutute the actual number if it is not 21). Thread 21 (Thread 25542.25682): Search your android build directories where you built that same version that crashed. Look for moc_mythsocket.cpp. It should be in android/build/mythtv/libs/libmythbase/moc (for 32bit) |
Thanks @bennettpeter for looking into this.
Happy to recompile and test again. |
It is using Qt slots to call MythSocket::ReadReal, however it is failing in the caller before it can actually do the call. The parameters all seem to have values, but something must be corrupted. Possibly the MythSocket has been destroyed between QMetaObject::invokeMethod in MythSocket::Read and _t->ReadReal in MythSocket::qt_static_metacall. I suggest turning on logging for sockets and network, to see if the socket is destroyed just before the crash, or to see if anything else useful can be found from the log. To turn on logging: Shutdown and restart mythfrontend On Linux use telnet: After the crash, access the log using this from linux This will show the last few minutes of log. You need to get to it soon, because it only stores a few minutes worth of log. Alternatively you can start capturing the log before the crash and keep capturing it until after the crash, but that may slow things down or give you a lot of unnecessary data, especially of you cannot tell when the crash will happen. |
I've run the session. Please find the details below and attached. Thread 22 "MythSocketThrea" received signal SIGSEGV, Segmentation fault. Please let me know if additional logs are required (I did a snippet of the logs, but more available). |
Not sure if it helps, but _a[1] seems inaccessible during segfault. Thread 65 "MythSocketThrea" received signal SIGSEGV, Segmentation fault. |
The log you supplied seems to be from Live TV. It will be easier to debug if this happens on a recording playback. Does it happen on recordings, or only on live TV? If it happens on recordings please get a log from a failure while playing back a recording that is complete (i.e. one that is finished recording before you watch). Or does it only happen when playing a recording that is still in progress? |
Apologies, I'll make a backtrace and log from a finished recording, and update the ticket. |
I rerun the crash, but now it crashes in on ReadStringListReal, but still in the Socket code. Log below as well. Thread 23 "MythSocketThrea" received signal SIGSEGV, Segmentation fault. |
Looking at your debug output, it looks like the first digit of _a[1] has been overwritten. It happens in both of the cases, ReadReal and ReadStringListReal. In one case _a[1] begins with 0x2cc1 and all the other addresses begin with 0xacc1. The others cases have the same problem. It seems the first digit of the address in _a[1] is being changed from 0xa to 0x2 in each case. This is happening between the call to QMetaObject::invokeMethod in mythsocket.cpp and the call from Qt to MythSocket::qt_static_metacall in moc_mythsocket.cpp. It seems to be something going wrong in Qt slot processing. |
Platform:
Nvidia Shield
Version 8.2.3
MythTV version:
20210703-arm-v31.0 fixes/31
Qt version 5.14.1
What steps will reproduce the bug?
It is hard to reproduce. It happens randomly while watching recording or watching LiveTV.
How often does it reproduce? Is there a required condition?
Not known at the moment.
What is the expected behaviour?
The expected behaviour is to continue showing the recording.
What do you see instead?
A full crash of the MythFrontend app on the Shield.
Additional information
The Myth Backend version is:
2:31.0+fixes.202106102123.0680b37c68~ubuntu20.10.1
Full backtrace at: https://pastebin.com/NRaYswn9
The text was updated successfully, but these errors were encountered: