Bug 1144347 - yast2 kdump crashes
yast2 kdump crashes
Status: CONFIRMED
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: YaST2
Leap 15.0
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: YaST Team
Jiri Srain
https://trello.com/c/L1JbWt5O
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-05 15:37 UTC by Michal Suchanek
Modified: 2019-08-12 16:44 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
console log (60.25 KB, text/plain)
2019-08-05 15:37 UTC, Michal Suchanek
Details
yast logs (2.92 MB, application/x-xz)
2019-08-06 08:46 UTC, Michal Suchanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Suchanek 2019-08-05 15:37:42 UTC
Created attachment 812839 [details]
console log

kitsune:/home/michal # yast2 kdump
No protocol specified
No protocol specified
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204: [BUG] Segmentation fault at 0x0000000000000002
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0024 e:000023 CFUNC  :call_yast_function
c:0003 p:0061 s:0015 e:000014 BLOCK  /usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204 [FINISH]
c:0002 p:0457 s:0011 E:0012c8 EVAL   /usr/lib/YaST2/bin/y2start:56 [FINISH]
c:0001 p:0000 s:0003 E:001390 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/usr/lib/YaST2/bin/y2start:56:in `<main>'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204:in `block (2 levels) in import'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204:in `call_yast_function'

-- Machine register context ------------------------------------------------
 RIP: 0x0000000000000002 RBP: 0x00007fe927a26fc8 RSP: 0x00007fe923989808
 RAX: 0x000055a9597bbcd8 RBX: 0x000055a95995bdd0 RCX: 0x0000000000000001
 RDX: 0x0000000000000001 RDI: 0x00007ffd5357cd50 RSI: 0x00007fe927652838
  R8: 0x00007fe91c011318  R9: 0x0000000000000000 R10: 0x000055a959acb490
 R11: 0x0000000000000206 R12: 0x00007fe92cd65080 R13: 0x000055a959aca920
 R14: 0x00007fe923989ac8 R15: 0x000055a95995be60 EFL: 0x0000000000010206

-- C level backtrace information -------------------------------------------
/sbin/yast2: line 455:  3708 Segmentation fault      (core dumped) $ybindir/y2start $module "$@" "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS
Comment 1 José Iván López González 2019-08-06 08:25:09 UTC
Hi Michal,

I was not able to reproduce the error with an clean installation of Leap 15.0. Could you please attach the complete YaST logs? See https://en.opensuse.org/openSUSE:Report_a_YaST_bug

Thanks
Comment 2 Michal Suchanek 2019-08-06 08:33:46 UTC
I cannot reproduce it either.

I was low on disk space so wanted to move the dump target to free some.

Moved it by hand and no longer see yast issue.

So this is probably result of running out of disk space somewhere (I have only separate /home).

It might be that yast cannot work under such conditions but the error reported is extremely unfriendly. It even appears in terminal only when X11 frontend is used.
Comment 3 Michal Suchanek 2019-08-06 08:46:56 UTC
Created attachment 812927 [details]
yast logs
Comment 4 José Iván López González 2019-08-06 08:53:30 UTC
Ok, thanks. Well, in that case, there is no a YaST issue (IMHO). Yes, the error is unfriendly. But I am not sure what should be the YaST behavior is such low disk space scenario. Maybe we need a Fate/Jira to solve it in a general way (each YaST module might do different things under such scenario). 

Do you mind if we close this bug? You could open a feature request if you consider YaST should do something better when there is no free disk space.
Comment 5 Michal Suchanek 2019-08-06 10:08:44 UTC
While trying to reproduce different exception was thrown and it was handled gracefully. The particular problem here is that a C extension does not check a NULL somewhere and segfaults which is not something the native code can easily handle. Can you determine where is the NULL pointer dereferenced from the console log as-is?

And if not can yast improve the default exception handler to aid in debugging such issues?
Comment 6 Ladislav Slezák 2019-08-06 11:02:02 UTC
Catching the segafults is a bit tricky in Ruby as segfaults usually happen in a C code.

But I found this example: https://github.com/charliesome/charlie.bz/blob/master/posts/recovering-from-segfaults-in-ruby.md so maybe we could improve it a bit.

The question is why YaST crashed in this case and how to avoid that. If we cannot easily reproduce it then fixing will be very difficult (or even impossible).
Comment 7 José Iván López González 2019-08-06 11:50:41 UTC
Michal, could you please try to reproduce it again and tell us the steps to do it? If I understood you correctly, you already tried it but you were not able. In that case, as Ladislav commented, we only could try to "catch" segfaults from ruby code (if such thing is possible, I am not completely sure), but the real source of the problem will be still there. Thanks!
Comment 8 Michal Suchanek 2019-08-06 14:34:22 UTC
(gdb) bt full
#0  0x0000000000000002 in ?? ()
No symbol table info available.
#1  0x00007ffff15d8520 in YQUI::~YQUI() () from /usr/lib64/yui/libyui-qt.so.8
No symbol table info available.
#2  0x00007ffff15da809 in YQUI::~YQUI() () from /usr/lib64/yui/libyui-qt.so.8
No symbol table info available.
#3  0x00007ffff42c45d8 in YUILoader::deleteUI() () from /usr/lib64/libyui.so.8
No symbol table info available.
#4  0x00007ffff7594d78 in __run_exit_handlers () from /lib64/libc.so.6
No symbol table info available.
#5  0x00007ffff7594dca in exit () from /lib64/libc.so.6
No symbol table info available.
#6  0x00007fffe99196d1 in QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**) ()
   from /usr/lib64/libQt5XcbQpa.so.5
No symbol table info available.
#7  0x00007fffe9bd83cb in ?? () from /usr/lib64/qt5/plugins/platforms/libqxcb.so
No symbol table info available.
#8  0x00007ffff011d88d in QPlatformIntegrationFactory::create(QString const&, QStringList const&, int&, char**, QString const&) () from /usr/lib64/libQt5Gui.so.5
No symbol table info available.
#9  0x00007ffff012da2a in QGuiApplicationPrivate::createPlatformIntegration() () from /usr/lib64/libQt5Gui.so.5
No symbol table info available.
#10 0x00007ffff012e50d in QGuiApplicationPrivate::createEventDispatcher() () from /usr/lib64/libQt5Gui.so.5
No symbol table info available.
#11 0x00007fffefb697d5 in QCoreApplicationPrivate::init() () from /usr/lib64/libQt5Core.so.5
No symbol table info available.
#12 0x00007ffff012fd5c in QGuiApplicationPrivate::init() () from /usr/lib64/libQt5Gui.so.5
No symbol table info available.
#13 0x00007ffff08f7999 in QApplicationPrivate::init() () from /usr/lib64/libQt5Widgets.so.5
No symbol table info available.
#14 0x00007ffff15d73f6 in YQUI::initUI() () from /usr/lib64/yui/libyui-qt.so.8
No symbol table info available.
#15 0x00007ffff15da844 in YQUI::idleLoop(int) () from /usr/lib64/yui/libyui-qt.so.8
No symbol table info available.
#16 0x00007ffff429ab7c in YUI::uiThreadMainLoop() () from /usr/lib64/libyui.so.8
No symbol table info available.
#17 0x00007ffff429ad3e in start_ui_thread(void*) () from /usr/lib64/libyui.so.8
No symbol table info available.
#18 0x00007ffff7345569 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#19 0x00007ffff7654a2f in clone () from /lib64/libc.so.6
No symbol table info available.
Comment 9 Michal Suchanek 2019-08-06 14:42:28 UTC
0x00007ffff15d8520 in YQUI::~YQUI (this=0x555555d72080, __in_chrg=<optimized out>) at /usr/src/debug/libyui-qt-2.49.2-lp150.1.1.x86_64/src/YQUI.cc:325

320	    {
321		qApp->exit();
322		qApp->deleteLater();
323	    }
324	
325	    delete _signalReceiver;
326	}
327	
328	void
329	YQUI::uiThreadDestructor()

I have no idea how to debug delete. It probably calls non-existent callback because something is not set up when it is invoked.

(gdb) p _signalReceiver
$1 = (YQUISignalReceiver *) 0x7fffffffcfd0
(gdb) p * _signalReceiver
$2 = {<QObject> = {<No data fields>}, static staticMetaObject = {d = {
      superdata = 0x7ffff00129e0 <QObject::staticMetaObject>, 
      stringdata = 0x7ffff16008e0 <qt_meta_stringdata_YQUISignalReceiver>, 
      data = 0x7ffff1600860 <qt_meta_data_YQUISignalReceiver>, 
      static_metacall = 0x7ffff15f3920 <YQUISignalReceiver::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}}
Comment 10 Michal Suchanek 2019-08-06 14:45:30 UTC
FTR it is reproducible only from single session that was started at the time there was no disk space.
Comment 11 José Iván López González 2019-08-06 14:59:12 UTC
Ok, thanks for the clue. We will try to fix the problem at some level: a) avoiding segfault or, b) catching segfault from ruby code.

Thanks for the report!
Comment 12 Michal Suchanek 2019-08-12 16:44:11 UTC
To reproduce:

# dd if=/dev/zero of=/junk
dd: writing to '/junk': No space left on device
# exit
> su
Password:
# yast2 kdump
IO Error (xmlDocFormatDump failed).
"/usr/lib/YaST2/bin/y2start [\"kdump\", \"qt\", \"-name\", \"YaST2\", \"-icon\", \"yast\"]"
No protocol specified
No protocol specified
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204: [BUG] Segmentation fault at 0x0000000000000002
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0024 e:000023 CFUNC  :call_yast_function
c:0003 p:0061 s:0015 e:000014 BLOCK  /usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204 [FINISH]
c:0002 p:0496 s:0011 E:001788 EVAL   /usr/lib/YaST2/bin/y2start:58 [FINISH]
c:0001 p:0000 s:0003 E:001960 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/usr/lib/YaST2/bin/y2start:58:in `<main>'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204:in `block (2 levels) in import'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:204:in `call_yast_function'

-- Machine register context ------------------------------------------------
 RIP: 0x0000000000000002 RBP: 0x00007fb2badc0fc8 RSP: 0x00007fb2b6d23808
 RAX: 0x0000561c92c17ac8 RBX: 0x0000561c92f063c0 RCX: 0x0000000000000001
 RDX: 0x0000000000000001 RDI: 0x00007ffd66404b00 RSI: 0x00007fb2ba9ec838
  R8: 0x00007fb2b0011318  R9: 0x0000000000000000 R10: 0x0000561c92f28420
 R11: 0x0000000000000206 R12: 0x00007fb2c00ff080 R13: 0x0000561c92f278b0
 R14: 0x00007fb2b6d23ac8 R15: 0x0000561c92f06450 EFL: 0x0000000000010206

-- C level backtrace information -------------------------------------------
/sbin/yast2: line 455: 25932 Segmentation fault      (core dumped) $ybindir/y2start $module "$@" "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS