Bug 35843 - crashes on boot
Summary: crashes on boot
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: udev (show other bugs)
Version: unstable
Hardware: all Linux
: P3 critical
Assignee: Alexey Shabalin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-03 12:51 MSK by Ivan A. Melnikov
Modified: 2019-01-04 03:08 MSK (History)
2 users (show)

See Also:


Attachments
вывод gdb, включая stacktrace (4.74 KB, text/plain)
2019-01-03 12:51 MSK, Ivan A. Melnikov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan A. Melnikov 2019-01-03 12:51:19 MSK
Created attachment 7931 [details]
вывод gdb, включая stacktrace

После обновления всего systemd до 240 система перестала нормально загружаться. Как оказалось, падает udev. Попробую отакатиться на 239, а пока прикладываю stacktrace, полученный из корки (systemd-coredump внезапно пригодился).
Comment 1 Ivan A. Melnikov 2019-01-03 13:17:38 MSK
> Попробую отакатиться на 239

Предсказуемо помогло.
Comment 2 Ivan A. Melnikov 2019-01-03 13:25:51 MSK
Ещё немного деталей, вытащенных из корки:

backtrace:

#0  __strrchr_avx2 () at ../sysdeps/x86_64/multiarch/strrchr-avx2.S:54
#1  0x0000559068f38f81 in device_set_sysname (device=0x55906ab4bd90) at ../src/libsystemd/sd-device/sd-device.c:1005
#2  0x0000559068f3af95 in sd_device_get_sysname (device=device@entry=0x55906ab4bd90, ret=ret@entry=0x7ffc16583390) at ../src/libsystemd/sd-device/sd-device.c:1049
#3  0x0000559068f37b66 in device_append (device=device@entry=0x55906ab4bd90, key=<optimized out>, key@entry=0x7ffc165835f5 "ACTION", _major=_major@entry=0x7ffc16583418, 
    _minor=_minor@entry=0x7ffc16583420, _seqnum=_seqnum@entry=0x7ffc16583428, _action=_action@entry=0x7ffc1658340c) at ../src/libsystemd/sd-device/device-private.c:333
#4  0x0000559068f37cc4 in device_new_from_nulstr (ret=ret@entry=0x7ffc16583490, nulstr=nulstr@entry=0x7ffc165835f5 "ACTION", len=len@entry=162)
    at ../src/libsystemd/sd-device/device-private.c:450
#5  0x0000559068f3536d in device_monitor_receive_device (m=m@entry=0x55906ab50be0, ret=ret@entry=0x7ffc16585610) at ../src/libsystemd/sd-device/device-monitor.c:453
#6  0x0000559068f35753 in device_monitor_event_handler (s=<optimized out>, fd=<optimized out>, revents=<optimized out>, userdata=0x55906ab50be0)
    at ../src/libsystemd/sd-device/device-monitor.c:200
#7  0x0000559068f45e90 in source_dispatch (s=s@entry=0x55906ab28e40) at ../src/libsystemd/sd-event/sd-event.c:2816
#8  0x0000559068f4753f in sd_event_dispatch (e=e@entry=0x55906ab35680) at ../src/libsystemd/sd-event/sd-event.c:3229
#9  0x0000559068f476f0 in sd_event_run (e=e@entry=0x55906ab35680, timeout=timeout@entry=18446744073709551615) at ../src/libsystemd/sd-event/sd-event.c:3286
#10 0x0000559068f4790b in sd_event_loop (e=0x55906ab35680) at ../src/libsystemd/sd-event/sd-event.c:3308
#11 0x0000559068f0ec6e in main_loop (cgroup=<optimized out>, fd_uevent=3, fd_ctrl=<optimized out>) at ../src/udev/udevd.c:1739
#12 run (argv=<optimized out>, argc=<optimized out>) at ../src/udev/udevd.c:1861
#13 main (argc=<optimized out>, argv=<optimized out>) at ../src/udev/udevd.c:1864
#4  0x0000559068f37cc4 in device_new_from_nulstr (ret=ret@entry=0x7ffc16583490, nulstr=nulstr@entry=0x7ffc165835f5 "ACTION", len=len@entry=162)
    at ../src/libsystemd/sd-device/device-private.c:450
450	                r = device_append(device, key, &major, &minor, &seqnum, &action);
#1  0x0000559068f38f81 in device_set_sysname (device=0x55906ab4bd90) at ../src/libsystemd/sd-device/sd-device.c:1005

frame 1:

1005	        pos = strrchr(device->devpath, '/');
1: *device = {n_ref = 1, watch_handle = -1, parent = 0x0, properties = 0x0, properties_iterator = {idx = 0, next_key = 0x0}, properties_generation = 0, properties_iterator_generation = 0, 
  properties_db = 0x0, sysattr_values = 0x0, sysattrs = 0x0, sysattrs_iterator = {idx = 0, next_key = 0x0}, tags = 0x0, tags_iterator = {idx = 0, next_key = 0x0}, tags_generation = 0, 
  tags_iterator_generation = 0, devlinks = 0x0, devlinks_iterator = {idx = 0, next_key = 0x0}, devlinks_generation = 0, devlinks_iterator_generation = 0, devlink_priority = 0, ifindex = 0, 
  devtype = 0x0, devname = 0x0, devnum = 0, properties_strv = 0x0, properties_nulstr = 0x0, properties_nulstr_len = 0, syspath = 0x0, devpath = 0x0, sysnum = 0x0, sysname = 0x0, 
  subsystem = 0x0, driver_subsystem = 0x0, driver = 0x0, id_filename = 0x0, usec_initialized = 0, devmode = 4294967295, devuid = 4294967295, devgid = 4294967295, parent_set = false, 
  sysattrs_read = false, property_tags_outdated = false, property_devlinks_outdated = false, properties_buf_outdated = false, sysname_set = false, subsystem_set = false, 
  driver_subsystem_set = false, driver_set = false, uevent_loaded = false, db_loaded = false, is_initialized = false, sealed = false, db_persist = false}
2: device->devpath = 0x0

strrchr на NULL. Отлично.

frame 4:

#4  0x0000559068f37cc4 in device_new_from_nulstr (ret=ret@entry=0x7ffc16583490, nulstr=nulstr@entry=0x7ffc165835f5 "ACTION", len=len@entry=162)
    at ../src/libsystemd/sd-device/device-private.c:450
450	                r = device_append(device, key, &major, &minor, &seqnum, &action);
4: key = 0x7ffc165835f5 "ACTION"

Куски nullstr (чтобы понять, что добавлялось):

5: nulstr = (uint8_t *) 0x7ffc165835f5 "ACTION"
6: nulstr + 7 = (uint8_t *) 0x7ffc165835fc "bind"
8: nulstr + 12 = (uint8_t *) 0x7ffc16583601 "DEVPATH=/devices/pci0000:00/0000:00:1c.4/0000:3b:00.0/mdio_bus/r8169-3b00/r8169-3b00:00"
12: nulstr + 100 = (uint8_t *) 0x7ffc16583659 "SUBSYSTEM=mdio_bus"
18: nulstr + 119 = (uint8_t *) 0x7ffc1658366c "DEVTYPE=PHY"
23: nulstr + 131 = (uint8_t *) 0x7ffc16583678 "DRIVER=Generic PHY"
27: nulstr + 150 = (uint8_t *) 0x7ffc1658368b "SEQNUM=3181"

Похоже, добавлялся

$ lspci  | grep ^3b
3b:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
Comment 3 Ivan A. Melnikov 2019-01-03 14:57:31 MSK
Сходил к апстриму: https://github.com/systemd/systemd/issues/11319

Там расписал, что происходит. Попробую починить.
Comment 4 Ivan A. Melnikov 2019-01-03 15:52:29 MSK
Нашёлся патчик, который должен помочь: https://github.com/systemd/systemd/commit/18fee12a2d489378a2a9b647db0d0eb8c43f5362

Прошу приложить. Очень похожее изменение работает у меня прямо сейчас.
Comment 5 Alexey Shabalin 2019-01-04 03:08:03 MSK
fixed in systemd-240-alt2.