2

When logged in to my Ubuntu 12.04 workstation, doing relatively benign things like tab-autocompleting in a terminal, switching workspaces, moving windows, etc. can result in Metacity freezing for 30 seconds.

Following the steps here to diagnose the issue, I first compared pre- and during-freeze states with ps axo pid,wchan:32,cmd > [not-]frozen.txt, then diff revealed:

$ diff frozen.txt not_frozen.txt
142c142
<  7135 futex_wait_queue_me              metacity
---
>  7135 poll_schedule_timeout            metacity

Looking in more depth at Metacity with a trace shows it tied up in that 'futex' for exactly 30 seconds ((sudo strace -p 11773 3>&1 1>&2- 2>&3-) | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' > metacity-trace.txt):

2014-07-03 15:49:50 clone(child_stack=0xac1982a4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xac198ba8, {entry_number:6, base_addr:0xac198b40, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0,useable:1}, child_tidptr=0xac198ba8) = 8659
2014-07-03 15:49:50 futex(0x9a55228, FUTEX_UNLOCK_PI_PRIVATE, 161978120) = 0
2014-07-03 15:49:50 futex(0x9a7970c, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 1, NULL, 0x9a55228) = 0
2014-07-03 15:49:50 futex(0x9a55228, FUTEX_UNLOCK_PI_PRIVATE, 161978120) = 0
2014-07-03 15:50:20 futex(0x9a7970c, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 3, NULL, 0x9a55228) = 0
2014-07-03 15:50:20 futex(0x9a55228, FUTEX_UNLOCK_PI_PRIVATE, 122875892) = 0
2014-07-03 15:50:20 send(15, "W", 1, MSG_NOSIGNAL)          = -1 ENOTSOCK (Socket operation on non-socket)

That was under Unity 2D, if I use Gnome Classic, the same thing happens when trying to switch desktops (but it's not as sensitive to autocompleting in terminal).

2014-07-03 16:07:31 clone(child_stack=0xb21fe2a4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb21feba8, {entry_number:6, base_addr:0xb21feb40, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb21feba8) = 12693
2014-07-03 16:07:31 futex(0x98424e8, FUTEX_UNLOCK_PI_PRIVATE, 160065584) = 0
2014-07-03 16:07:31 futex(0x98a6834, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 1, NULL, 0x98424e8) = -1 EAGAIN (Resource temporarily unavailable)
2014-07-03 16:07:31 futex(0x98424e8, FUTEX_UNLOCK_PI_PRIVATE, 160065584) = 0
2014-07-03 16:08:01 futex(0x98a6834, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 3, NULL, 0x98424e8) = 0
2014-07-03 16:08:01 futex(0x98424e8, FUTEX_UNLOCK_PI_PRIVATE, 13762548) = 0
2014-07-03 16:08:01 send(14, "W", 1, MSG_NOSIGNAL)          = -1 ENOTSOCK (Socket operation on non-socket)

0

Browse other questions tagged .