plymouthd crashes on splash show/hide/show request sequence with framebuffer backend
plymouthd crashes when splash is requested to be shown, hidden and shown again. It reproduces always for framebuffer backend, and I think it should reproduce for drm backend as well, but x11 backend should be unaffected.
Steps to reproduce:
- Ensure that frame-buffer backend is used: boot with framebuffer settings and remove drm/x11 backends for plymouth or rebuild plymouth without support for these backend. It might work with drm backend, but I didn't test it. My framebuffer kernel cmdline options are: 'vga=845 video=vesafb:mtrr:2,ywrap'.
- Ensure that graphical splash theme is used.
# plymouth-set-default-theme spinfinity
- Start plymouth daemon:
# plymouthd --attach-to-session
- Now show splash, hide it and show it again. For these steps I'm connecting to machine via ssh and run:
# plymouth show-splash
# plymouth hide-splash
# plymouth show-splash
Result: plymouthd aborts
Expected result: Splash screen should be redisplayed
I'm able to reproduce bug 100% of time using both real machine and virtual machine. OS: Gentoo Linux amd64 plymouth versions affected: both 0.9.4 release and current master branch.
A bit of information from debugger: Terminal is opened when plymouth daemon is starting, not when it displays splash:
#0 ply_terminal_open_device (terminal=terminal@entry=0x41d4a0) at ply-terminal.c:562
#1 0xb7f9752a in ply_terminal_open (terminal=0x41d4a0) at ply-terminal.c:620
#2 0xb7fcbe80 in open_device (backend=0x41d9a0) at ./plugin.c:349
#3 0xb7f9b540 in ply_renderer_open_device (renderer=0x41d630) at ply-renderer.c:184
#4 ply_renderer_open_plugin (plugin_path=0xb7fa0bd0 "/usr/lib/plymouth/renderers/frame-buffer.so", renderer=0x41d630) at ply-renderer.c:241
#5 ply_renderer_open (renderer=renderer@entry=0x41d630) at ply-renderer.c:281
#6 0xb7f91e4c in create_devices_for_terminal_and_renderer_type (manager=0x41d450, terminal=0x41d4a0, renderer_type=<optimized out>, device_path=0x0) at ply-device-manager.c:706
#7 0x0040460a in load_devices (flags=PLY_DEVICE_MANAGER_FLAGS_NONE, state=0xbffff2cc) at main.c:1102
#8 main (argc=5, argv=0xbffff3f4) at main.c:2308
But terminal is closed when splash is hidden:
#0 0xb7f96b1b in ply_terminal_close (terminal=<optimized out>) at ply-terminal.c:705
#1 0x0040d5ed in quit_splash (state=0xbffff2cc) at main.c:1139
#2 0x0040690d in ply_boot_connection_on_request (connection=0x461c70) at ply-boot-server.c:657
#3 0xb7fad80e in ply_event_loop_handle_met_status_for_source (status=PLY_EVENT_LOOP_FD_STATUS_HAS_DATA, source=0x461c00, loop=0x418250) at ply-event-loop.c:1036
#4 ply_event_loop_process_pending_events (loop=0x418250) at ply-event-loop.c:1281
#5 ply_event_loop_process_pending_events (loop=0x418250) at ply-event-loop.c:1212
#6 0xb7fadd78 in ply_event_loop_run (loop=0x418250) at ply-event-loop.c:1312
#7 0x0040464b in main (argc=5, argv=0xbffff3f4) at main.c:2311
After that on second show request, when splash is shown, terminal is actually closed, and this causes an assert:
#4 0xb7dd18b7 in __assert_fail () from /lib/libc.so.6
#5 0xb7fac693 in ply_event_loop_watch_fd (loop=0x418250, fd=-1, status=status@entry=PLY_EVENT_LOOP_FD_STATUS_HAS_DATA,
status_met_handler=status_met_handler@entry=0xb7fcb4b0 <on_key_event>, disconnected_handler=disconnected_handler@entry=0xb7fcc1a0 <on_input_source_disconnected>,
user_data=user_data@entry=0x41ffa0) at ply-event-loop.c:728
#6 0xb7fcc111 in open_input_source (backend=0x41ff90, input_source=0x41ffa0) at ./plugin.c:687
#7 0xb7f9cc0f in ply_renderer_open_input_source (renderer=0x41fc20, input_source=0x41ffa0) at ply-renderer.c:377
#8 0xb7f94d6c in ply_keyboard_watch_for_renderer_input (keyboard=0x420230) at ply-keyboard.c:385
#9 ply_keyboard_watch_for_input (keyboard=keyboard@entry=0x420230) at ply-keyboard.c:385
#10 0xb7f941b3 in ply_device_manager_activate_keyboards (manager=0x41fa40) at ply-device-manager.c:994
#11 0x0040b84d in show_theme (state=0xbffff2ec, theme_path=<optimized out>) at main.c:1764
#12 0x0040c3f7 in show_default_splash (state=0xbffff2ec) at main.c:481
#13 0x0040cbdf in show_default_splash (state=0xbffff2ec) at main.c:985
#14 show_splash (state=0xbffff2ec) at main.c:981
#15 0x0040691d in ply_boot_connection_on_request (connection=0x444480) at ply-boot-server.c:657
#16 0xb7fad80e in ply_event_loop_handle_met_status_for_source (status=PLY_EVENT_LOOP_FD_STATUS_HAS_DATA, source=0x463c10, loop=0x418250) at ply-event-loop.c:1036
#17 ply_event_loop_process_pending_events (loop=0x418250) at ply-event-loop.c:1281
#18 ply_event_loop_process_pending_events (loop=0x418250) at ply-event-loop.c:1212
#19 0xb7fadd78 in ply_event_loop_run (loop=0x418250) at ply-event-loop.c:1312
#20 0x0040464b in main (argc=4, argv=0xbffff414) at main.c:2311
Terminal is deactivated on line 1130 and closed on line 1131. It's not hard to circumvent unneeded terminal closing, but it looks necessary to keep deactivating vt.
For example, if I start plymouth daemon with commnad 'plymouthd --attach-to-session --tty=/dev/tty63', it wouldn't switch me back to current vt on splash hiding. The problem lies in activating vt again. Following is backtrace for initial vt activation:
#0 ply_terminal_activate_vt (terminal=0x41ea40) at ply-terminal.c:916
#1 0xb7fcc5ea in map_to_device (backend=0x41ef40) at ./plugin.c:549
#2 0xb7f99dfe in ply_renderer_map_to_device (renderer=0x41ebd0) at ply-renderer.c:214
#3 ply_renderer_flush_head (renderer=0x41ebd0, head=0x41ef64) at ply-renderer.c:355
#4 0xb7f92777 in ply_pixel_display_flush (display=0x4221c0) at ply-pixel-display.c:114
#5 ply_pixel_display_flush (display=0x4221c0) at ply-pixel-display.c:109
#6 ply_pixel_display_draw_area (display=0x4221c0, x=x@entry=0, y=y@entry=0, width=width@entry=800, height=height@entry=600) at ply-pixel-display.c:161
#7 0xb7fc56ca in view_start_animation (view=0x423540) at ./plugin.c:302
#8 start_animation (plugin=plugin@entry=0x423430) at ./plugin.c:521
#9 0xb7fc6217 in start_animation (plugin=0x423430) at ./plugin.c:680
#10 show_splash_screen (plugin=0x423430, loop=0x418250, boot_buffer=0x41aad0, mode=PLY_BOOT_SPLASH_MODE_BOOT_UP) at ./plugin.c:698
#11 0xb7f9b270 in ply_boot_splash_show (splash=0x4223e0, mode=PLY_BOOT_SPLASH_MODE_BOOT_UP) at ply-boot-splash.c:482
#12 0x0040b83a in show_theme (state=0xbffff2dc, theme_path=<optimized out>) at main.c:1763
#13 0x0040c3f7 in show_default_splash (state=0xbffff2dc) at main.c:481
#14 0x0040cbdf in show_default_splash (state=0xbffff2dc) at main.c:985
#15 show_splash (state=0xbffff2dc) at main.c:981
#16 0xb7fab5f9 in ply_event_loop_handle_timeouts (loop=0x418250) at ply-event-loop.c:1194
#17 ply_event_loop_process_pending_events (loop=0x418250) at ply-event-loop.c:1253
#18 ply_event_loop_process_pending_events (loop=0x418250) at ply-event-loop.c:1212
#19 0xb7fabd78 in ply_event_loop_run (loop=0x418250) at ply-event-loop.c:1312
#20 0x0040464b in main (argc=4, argv=0xbffff404) at main.c:2317
All backtraces are taken on plymouth 0.9.4 release, but current master is still affected.