<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'><br><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Hi, </div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">I'm trying to find where the problem is in the Plymouth crash I'm experiencing on CentOS-8 and openSuSE Leap 15.2 (it doesn't"t crash on CentOS-7 and CentOS-6) </div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">I've reported the bug here: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/112 with full informations and intro needed to reproduce the problem. </div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">In the meantime, I'm trying to find the bug by myself, but it's hard to debug in initrd environment, so I did analyste the source code and here is what I found:</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">The crash occurs when Plymouth tries to initialise DRM devices.</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">00:16:52.992 main.c:882:plymouth_should_show_default_splash : using default splash because kernel command line has option "splash"</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">00:16:52.994 ply-device-manager.c:886:create_devices_from_terminals : checking for consoles</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">00:16:52.994 ply-device-manager.c:664:add_consoles_from_file : opening /sys/class/tty/console/active</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">00:16:52.995 ply-device-manager.c:672:add_consoles_from_file : reading file</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">00:16:52.996 ply-device-manager.c:710:add_consoles_from_file : console /dev/tty7 found!</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">00:16:52.997 ply-device-manager.c:486:watch_for_udev_events : watching for udev graphics device add and remove events</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">00:16:52.998 ply-device-manager.c:346:create_devices_for_subsystem : creating objects for drm devices</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">@lymouthd: ply-event-loop.c:913: ply_event_loop_watch_for_timeout: Assertion `seconds > 0.0' failed.\n</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">in the strace output I can see:</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><div>access("/sys/devices/virtual/drm/ttm/uevent", F_OK) = 0</div><div>readlinkat(AT_FDCWD, "/sys/devices/virtual/drm/ttm/subsystem", "../../../../class/drm", 99) = 21</div><div>openat(AT_FDCWD, "/sys/devices/virtual/drm/ttm/uevent", O_RDONLY|O_CLOEXEC) = 10</div><div>fstat(10, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0</div><div>fstat(10, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0</div><div>read(10, "DEVTYPE=ttm\n", 4096) = 12</div><div>read(10, "", 4096) = 0</div><div>close(10) = 0</div><div>openat(AT_FDCWD, "/run/udev/data/+drm:ttm", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)</div><div>write(2, "@lymouthd: ply-event-loop.c:913: ply_event_loop_watch_for_timeout: Assertion `seconds > 0.0' failed.\n", 101) = 101</div></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Just after failing to look for <span style="font-size: 12pt;">/run/udev/data/+drm:ttm file,</span></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif">Plymouth</font><font face="times new roman, new york, times, serif" size="3"> does abort because the timeout value seems to be a bad value?</font></div><div><font face="times new roman, new york, times, serif" size="3" style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">HERE WE ARE.Thoses messages are </font><font face="times new roman, new york, times, serif">misleading. The problem is far sooner (in fact, when reading Plymouth.defaults)</font></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif" size="3"><br></font></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif" size="3">Looking at where the problem seems to </font><font face="times new roman, new york, times, serif">occur, I suspected that the problem was here:</font></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif">in src/</font>libply-splash-core/ply-device-manager.c at line 974 ply_event_loop_watch_for_timeout (in ply_device_manager_watch_devices() function))</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Indeed, the console is correctly setup and this occurs at line 954 of that file, and there after, there is a specific ifdef HAVE_UDEV</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">According to the ABRT error, the device_timout variable which is a double is incorrect (not > 0.0). So either it is equal 0.0 (not initialized) or NaN or corrupted and seen as negative.</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">ply_device_manager_watch_devices() is called from main.c:1093 in load_devices(). The timeout value comes from state->device_timeout.</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">BUT at line 2241 in main(), state.device_timeout is set to NAN and at line 2278, the load_devices() is called with &state parameter!!!!</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">So, between line 2241 where state.device_timeout is set to NAN and line 2278 where it is used, the state.device_timout MUST be set to something > 0.0...</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">At line 2257, find_distribution_default_splash(&state) is called</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">in find_distribution_default_splash() line 428, load_settings is called</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">In my settings file initrd:/usr/share/plymouth/plymouthd.defaults I have the following content:</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><div># SystemImager is the default theme</div><div>[Daemon]</div><div>Theme=systemimager</div><div>ShowDelay=0</div><div># DeviceTimeout=5</div></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">in main.c:310, we have: timeout_string = ply_key_file_get_value (key_file, "Daemon", "DeviceTimeout"); </div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Below, timeout_string is checked against NULL.</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">As the trace "Device timout is set to ...." is not in the log, This means that timeout _string is NULL.</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">And IT IS as ply_key_file_get_value() returns NULL if ply_key_file_get_raw_value() returns NULL, and ply_key_file_get_raw_value() returns NULL if group ("Daemon" here) is not found. (and it is not found as it is commented out)</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">THUS, state->device_timeout is still NAN value!!! BUG #1 (no default value AFAICT)</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">IMHO, there should be a else statement at line 317 that would set state->device_timeout to a default value (maybe 5.0) ?</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">BUG #2: at line 313 the result of atof() is not checked against value of 0.0 while the <span style="font-family: "times new roman", "new york", times, serif; font-size: 16px;"> </span><span style="font-family: "times new roman", "new york", times, serif; font-size: 16px;">ply_event_loop_watch_for_timeout() require NON-NULL double.</span></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><span style="font-family: "times new roman", "new york", times, serif; font-size: 16px;"><br></span></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><span style="font-family: "times new roman", "new york", times, serif; font-size: 16px;">WARNING #3: at line 313: </span><font face="times new roman, new york, times, serif">strtod() should be used instead of atof() according to atof manual. More over, you don't take care of locale LC_NU MERIC! (use </font>ply_key_file_get_double() which does instead)</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif"><br></font></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif">BUG #4: at line 310: you should use state->device_timeout = </font>ply_key_file_get_double (key_file, "Daemon", "DeviceTimeout", 5.0);</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"> By that way, a default value would exists. Be careful, if strtod() fails in ply_key_file_get_double(), a value of 0.0 is returned. A test against this invalid value for DeviceTimeout MUST exists!</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"> (also you can have NaN in config file that atof() know how to deal with. So MAKE TESTS!</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">BUG #5: Same problem for ShowDelay (though, I assume value of 0 is acceptable)</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">BUG #6: Same problem for DeviceScale (but there is no ply_key_file_get_unsigned_long() and surtout() provides 0 as default value)</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Updating settings with this content allows Plymouthd to start:</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><div># SystemImager is the default theme</div><div>[Daemon]</div><div>Theme=systemimager</div><div>ShowDelay=0.1</div><div>DeviceTimeout=2.0</div></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">IMHO, in order to fix things:</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">1 - replace lines 296 to 304 with:</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"> state->splash_delay = ply_key_file_get_double (key_file, "Daemon", "DeviceTimeout", 5.0); /* replace 5.0 with define PLYMOUTH_DEFAULT_SPLASH_DELAY (hardcoded value is BAD) */</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"> if (!(state->splash_delay > 0.0)) {</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"> ply_trace ("Splash delay is invalid. defaulting to %d", PLYMOUTH_DEFAULT_SPLASH_DELAY);</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><span class="Apple-tab-span" style="white-space:pre"> </span>state->splash_delay= PLYMOUTH_DEFAULT_SPLASH_DELAY;</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"> }</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">2 - same operation for lines 308 to 317 regarding DeviceTimeout test must use ">= instead of > if zero is acceptable)</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">3 - Maybe check that what surtout() line 323 returns something that Plymouth can handle.</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Please fix.</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif">Best regards,</font></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif"><br></font></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><span></span>-- <br> Olivier LAHAYE<span></span><br></div><br></div></body></html>