Bug#790560: udev fails to start on sparc boot, breaking boot
Richard Mortimer
richm at oldelvet.org.uk
Thu Aug 6 13:49:07 BST 2015
On 06/08/2015 12:48, Artyom Tarasenko wrote:
> Here is the correspondinf part of the gdb session with symbols from
> systemd-dbg_224-1_sparc64.deb:
>
Many thanks.
The log below pretty much does confirm that it is taking the suspected
path through the code. Some steps are not visible to the debugger due to
optimisation but otherwise are running.
I wonder if the optimiser has somehow generated bad code and this is
causing things to fail.
Specifically it does look like it is only producing output of "ine,
ignoring: Invalid argument". The "ine" starts 32 characters into the string.
Looking at a dump of the binary you can see this
050ce0 N : h V \0 \0 \0 \0 f a i l e d t
4e 3a 68 56 00 00 00 00 66 61 69 6c 65 64 20 74
050cf0 o p a r s e k e r n e l c
6f 20 70 61 72 73 65 20 6b 65 72 6e 65 6c 20 63
050d00 o m m a n d l i n e , i g n
6f 6d 6d 61 6e 64 20 6c 69 6e 65 2c 20 69 67 6e
050d10 o r i n g : % m \0 \0 \0 \0 \0 \0 \0
Later in the binary we see a similar thing the "/" for the chdir appears
exactly 32 characters before the "/: %m" in the error message
050d50 t o % u \0 \0 / \0 \0 \0 \0 \0 \0 \0
20 74 6f 20 25 75 00 00 2f 00 00 00 00 00 00 00
050d60 c o u l d n o t c h a n g e
63 6f 75 6c 64 20 6e 6f 74 20 63 68 61 6e 67 65
050d70 d i r t o / : % m \0 \0 \0
20 64 69 72 20 74 6f 20 2f 3a 20 25 6d 00 00 00
So maybe the code is trying to use the wrong string as input to chdir
and hence failing.
I do not have easy access to a disassembler to attempt to confirm what
the bad code is doing. I guess it is likely to be a compiler toolchain
issue. Either bad code generation or maybe a linker script is getting
alignments wrong on when compiled as a 64 bit binary as opposed to a 32
bit binary.
> (gdb) run
> Starting program: /lib/systemd/systemd-udevd
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/sparc64-linux-gnu/libthread_db.so.1".
>
> Breakpoint 3, main (argc=<optimized out>, argv=0x7fefffffc98) at
> ../src/udev/udevd.c:1662
> 1662 r = parse_proc_cmdline(parse_proc_cmdline_item);
> (gdb) next
> 1663 if (r < 0)
> (gdb)
> 1664 log_warning_errno(r, "failed to parse kernel
> command line, ignoring: %m");
> (gdb)
> ine, ignoring: Invalid argumentu1666 if (arg_debug) {
> (gdb)
> 1671 if (getuid() != 0) {
> (gdb)
> 1676 if (arg_children_max == 0) {
> (gdb)
> 1679 arg_children_max = 8;
> (gdb)
> 1681 if (sched_getaffinity(0, sizeof (cpu_set),
> &cpu_set) == 0) {
> (gdb)
> 1682 arg_children_max += CPU_COUNT(&cpu_set) * 2;
> (gdb)
> 1685 log_debug("set children_max to %u", arg_children_max);
> (gdb)
> 1690 if (r < 0) {
> (gdb)
> 1691 r = log_error_errno(errno, "could not change
> dir to /: %m");
> (gdb)
> /devu1760 mac_selinux_finish();
> (gdb)
> 1761 log_close();
> (gdb)
> 1651 _cleanup_free_ char *cgroup = NULL;
> (gdb)
> 1763 }
> (gdb)
>
More information about the Pkg-systemd-maintainers
mailing list