[systemd-bugs] [Bug 76886] New: Journald can cause an endless loop

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Apr 1 00:43:09 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=76886

          Priority: medium
            Bug ID: 76886
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: Journald can cause an endless loop
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: bartlomiej.gluch.ext at nsn.com
          Hardware: ARM
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

Systemd version 211
Linux kernel 3.13.3
ARMv7 based embedded system

It is possible o create an endless loop, when I2C device or power supply
exists, but only with one of following kernel configs enabled:
CONFIG_POWER_SUPPLY_DEBUG
CONFIG_I2C_DEBUG_CORE

Both of this flags enables debug printout of function dev_dbg() in kernel in
following files:
drivers/power/power_supply_sysfs.c (line265, function power_supply_uevent())
drivers/i2c/i2c-core.c (line 102, function i2c_device_uevent())

dev_dbg creates an syslog entry - which triggers journald to read uevent file
for this device, which than again dev_dbg() is called causing journald to read
uevent file - so there is an endless loop (technically, kernel will kill
journald after some time)


Situation with CONFIG_POWER_SUPPLY_DEBUG is not observed in my system, but it
is described here:
http://forums.gentoo.org/viewtopic-t-977530-postdays-0-postorder-asc-start-0.html

The reasons are the same as for I2C, uevent function 

Result of the bug:

If the kernel is started with "debug" in the bootargs, as soon as the udev
starts there is an loop of debug outputs, making system unusable, after 10-12
minutes journald is killed.

If the kernel is started with loglevel=0 system is usable, but logs are filled
with debug output.

Dump stack in uevent function shows that each time uevent was triggered by
SySFS read/write:

[<c0422f94>] (unwind_backtrace+0x0/0xf8) from [<c041edac>]
(show_stack+0x10/0x14)
[<c041edac>] (show_stack+0x10/0x14) from [<c09151b4>] (dump_stack+0x74/0x90)
[<c09151b4>] (dump_stack+0x74/0x90) from [<c07e0760>]
(i2c_sysfs_new_device+0xf8/0x20c)
[<c07e0760>] (i2c_sysfs_new_device+0xf8/0x20c) from [<c06f2df4>]
(dev_attr_store+0x18/0x24)
[<c06f2df4>] (dev_attr_store+0x18/0x24) from [<c0536d54>]
(sysfs_write_file+0x14c/0x1dc)
[<c0536d54>] (sysfs_write_file+0x14c/0x1dc) from [<c04df208>]
(vfs_write+0xa8/0x1b0)
[<c04df208>] (vfs_write+0xa8/0x1b0) from [<c04df638>] (SyS_write+0x3c/0x70)
[<c04df638>] (SyS_write+0x3c/0x70) from [<c041b560>]
(ret_fast_syscall+0x0/0x30)


lsof -r1 | grep /sys/devices/2010085000.i2c/i2c-1/1-0054/uevent

systemd-j 146           root   12r      REG       0,13     4096       6833
/sys/devices/2010085000.i2c/i2c-1/1-0054/uevent


Bug can be workarounded in kernel by changing dev_dbg() to pr_debug() in uevent
functions.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20140401/0e4a0083/attachment-0001.html>


More information about the systemd-bugs mailing list