Indeed, so as libumockdev isn't thread safe, it becomes utterly confused
by several threads interacting with it at once:

[pid 27529] open("/tmp/umockdev.ZMUMIX/sys/devices/card2/subsystem", O_RDONLY 
<unfinished ...>
[pid 27574] write(2, "reading /sys/devices/card2/uevent\n", 34reading 
/sys/devices/card2/uevent
 <unfinished ...>
[pid 27529] <... open resumed> )        = 11
[pid 27574] <... write resumed> )       = 34
[pid 27529] fstat(11,  <unfinished ...>
[pid 27574] write(2, "testbed wrapped fopen(/sys/devices/card2/uevent) -> 
/tmp/umockdev.ZMUMIX/sys/devices/card2/uevent\n", 98testbed wrapped 
fopen(/sys/devices/card2/uevent) -> 
/tmp/umockdev.ZMUMIX/sys/devices/card2/uevent
 <unfinished ...>
[pid 27529] <... fstat resumed> {st_dev=makedev(0, 21), st_ino=1776459, 
st_mode=S_IFDIR|0755, st_nlink=2, st_uid=1000, st_gid=1000, st_blksize=4096, 
st_blocks=0, st_size=120, st_atime=2014/07/04-16:25:05, 
st_mtime=2014/07/04-16:25:05, st_ctime=2014/07/04-16:25:05}) = 0
[pid 27574] <... write resumed> )       = 98
[pid 27529] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 
-1, 0 <unfinished ...>
[pid 27574] open("/tmp/umockdev.ZMUMIX/sys/devices/card2/uevent", O_RDONLY 
<unfinished ...>
[pid 27529] <... mmap resumed> )        = 0x7f8518d4f000
[pid 27574] <... open resumed> )        = 12
[pid 27529] read(11,  <unfinished ...>
[pid 27574] fstat(12,  <unfinished ...>
[pid 27529] <... read resumed> 0x7f8518d4f000, 4096) = -1 EISDIR (Is a 
directory)

I. e. while one thread is handling the /sys/devices/card2/subsystem
symlink, the other tries to read /sys/devices/card2/uevent, and they
collide as the umockdev-preload's path resolution (and probably other
things) are not thread safe.

** Summary changed:

- Intermittent 
mir_unit_tests.MesaDisplayTest.drm_device_change_event_triggers_handler test 
failure: device DEVTYPE is sometimes NULL
+ Intermittent 
mir_unit_tests.MesaDisplayTest.drm_device_change_event_triggers_handler test 
failure: libumockdev isn't thread safe

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to umockdev in Ubuntu.
https://bugs.launchpad.net/bugs/1336671

Title:
  Intermittent
  mir_unit_tests.MesaDisplayTest.drm_device_change_event_triggers_handler
  test failure: libumockdev isn't thread safe

Status in Mir:
  In Progress
Status in “umockdev” package in Ubuntu:
  New

Bug description:
  As seen in: http://s-jenkins.ubuntu-ci:8080/job/mir-clang-utopic-
  amd64-build/799/console

  To reproduce locally:

  bzr branch lp:mir/devel mir-devel && cd mir-devel
  mkdir build && cd build && cmake .. && make -j4
  umockdev-wrapper bin/mir_unit_tests 
--gtest_filter=MesaDisplayTest.drm_device_change_event_triggers_handler 
--gtest_repeat=-1 --gtest_break_on_failure

  (Ignore the segfault when the test fails, it's a side effect of
  --gtest_break_on_failure)

  Running with strace or on a system with high load increases the chances that 
we hit the problem. For example, running make -j4 in another mir branch while
  running the tests does the trick for mir.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mir/+bug/1336671/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to