Solved Linux Ubuntu minimal = No automatic gdb stack trace on crash
#1
This is a long standing issue I have been unable to figure out. Some help and clews and perhaps a patch suggestion would go a long way into solving this.

The target: Install Ubuntu minimal and when Kodi crashes get a crashlog with stacktrace automatically.
Achieved allow ulimit c unlimited by default and installed gdb both required to get coredumps.

Looking at https://github.com/xbmc/xbmc/blob/master...kodi.sh.in more specifically https://github.com/xbmc/xbmc/blob/master...#L101-L105

Neither systemd-coredumpctl or coredumpctl exist on Ubuntu minimal up to 14.04LTS I wonder if that's the reason why this fails

It seems that there should be some fairly straight forward way to keep a minimal Ubuntu/Linux install and also benefit from automatic core dumps and processing into the Kodi crashlog for easy processing but thers not.

Anyone has any ideas or suggestions how to achieve this it would be great.

ulimit -a http://paste.ubuntu.com/11904917/

cat /proc/sys/kernel/core_pattern $HOME/core.%e.%p.%h.%t
Reply
#2
Seems you cannot use shell vars in /proc/sys/kernel/core_pattern, you must use full paths.
e.g. /tmp/core.%e.%p.%h.%t works for me.


then try this patch please
Code:
--- /usr/bin/kodi    2015-07-13 02:49:20.000000000 +0200
+++ kodi    2015-07-20 10:43:36.578679742 +0200
@@ -113,7 +113,10 @@
     fi
     single_stacktrace "$BASEDIR" 5
     # find in userdata dir
-    single_stacktrace $USERDATA_DIR/ 5
+    single_stacktrace $HOME/ 5
+    # try /proc/sys/kernel/core_pattern
+    [ -d $(dirname $(cat /proc/sys/kernel/core_pattern)) ] && single_stacktrace $(dirname $(cat /proc/sys/kernel/core_pattern)) 1
+
   else
     echo "gdb not installed, can't get stack trace." >> $FILE
   fi
Reply
#3
Ah, never occurred to me about that nugget. Thx for pointing it out.

Also thank you for patch will try and report back.
Reply
#4
Good news that patch works a treat was testing the freeze on shutdown which happens still, and issued kill -6 kodipid after of course changing the core path to full path obviously.

result -> http://pastebin.com/0S70WZUh resounding sucess.

Thank you, thank you, thank you 6 years of searching solved by 2 lines of code Wink
Reply
#5
thanks for reporting and testing
https://github.com/xbmc/xbmc/pull/7558
Reply
#6
Very welcome, I saw that PR Smile, thx, finally solved this years long issue, Big Grin

Marking as solved and will document it on wiki how to setup for this in minimal Ubuntu scenario.
Reply

Logout Mark Read Team Forum Stats Members Help
Linux Ubuntu minimal = No automatic gdb stack trace on crash0