Watching the eventfd2 & close calls to see which one leaks:

sudo strace -p `pidof unity8` 2>&1 | grep -P "(eventfd|close)"

I get on app open:

eventfd2(0, O_NONBLOCK|O_CLOEXEC)       = 118
eventfd2(0, O_NONBLOCK|O_CLOEXEC)       = 117
close(117)                              = 0
eventfd2(0, O_NONBLOCK|O_CLOEXEC)       = 116
close(116)                              = 0

on app close:

eventfd2(0, O_NONBLOCK|O_CLOEXEC)       = 109
close(109)                              = 0
eventfd2(0, O_NONBLOCK|O_CLOEXEC)       = 109
close(109)                              = 0
eventfd2(0, O_NONBLOCK|O_CLOEXEC)       = 109
close(109)                              = 0
eventfd2(0, O_NONBLOCK|O_CLOEXEC)       = 109
close(109)                              = 0

I saw no close call for FD 118 - the first one.

In gdb the first eventfd call on app launch has this backtrace:

Breakpoint 1, 0xb614ae36 in eventfd () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) bt
#0  0xffffffff in eventfd () at /lib/arm-linux-gnueabihf/libc.so.6
#1  0xffffffff in g_wakeup_new () at 
/build/buildd/glib2.0-2.44.1/./glib/gwakeup.c:146
#2  0xffffffff in g_main_context_new () at 
/build/buildd/glib2.0-2.44.1/./glib/gmain.c:624
#3  0xffffffff in cgroup_manager_connection () at 
/build/ubuntu-app-launch-qvXALV/ubuntu-app-launch-0.5+15.04.20150827/helpers-shared.c:153
#4  0xffffffff in pids_for_appid (appid=appid@entry=0xa1f1e8 "dialer-app") at 
/build/ubuntu-app-launch-qvXALV/ubuntu-app-launch-0.5+15.04.20150827/libubuntu-app-launch/ubuntu-app-launch.c:1515
#5  0xffffffff in ubuntu_app_launch_pid_in_app_id (pid=17487, appid=0xa1f1e8 
"dialer-app") at 
/build/ubuntu-app-launch-qvXALV/ubuntu-app-launch-0.5+15.04.20150827/libubuntu-app-launch/ubuntu-app-launch.c:1576
#6  0xffffffff in qtmir::upstart::ApplicationController::appIdHasProcessId(int, 
QString const&) (this=<optimized out>, pid=17487, appId=...) at 
/home/gerry/dev/projects/qtmir/multimonitor/src/modules/Unity/Application/upstart/applicationcontroller.cpp:180
#7  0xffffffff in qtmir::TaskController::appIdHasProcessId(QString const&, 
unsigned long long) const (this=this@entry=0x61b138, appId=..., pid=<optimized 
out>) at 
/home/gerry/dev/projects/qtmir/multimonitor/src/modules/Unity/Application/taskcontroller.cpp:94
#8  0xffffffff in qtmir::ApplicationManager::authorizeSession(unsigned long 
long, bool&) (this=0x618328, pid=<optimized out>, authorized=@0xadefeb2c: 
false) at 
/home/gerry/dev/projects/qtmir/multimonitor/src/modules/Unity/Application/application_manager.cpp:557
#9  0xffffffff in QMetaCallEvent::placeMetaCall(QObject*) (a=<optimized out>, 
r=0x618328, this=0x62c248) at 
../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124
#10 0xffffffff in QMetaCallEvent::placeMetaCall(QObject*) (this=<optimized 
out>, object=0x618328) at kernel/qobject.cpp:483
#11 0xffffffff in QObject::event(QEvent*) (this=<optimized out>, e=<optimized 
out>) at kernel/qobject.cpp:1245
#12 0xffffffff in QCoreApplication::notify(QObject*, QEvent*) (this=<optimized 
out>, receiver=<optimized out>, event=<optimized out>) at 
kernel/qcoreapplication.cpp:997
#13 0xffffffff in QCoreApplication::notifyInternal(QObject*, QEvent*) 
(this=0x518f00, receiver=receiver@entry=0x618328, event=event@entry=0x14edba0) 
at kernel/qcoreapplication.cpp:935
#14 0xffffffff in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, 
QThreadData*) (event=0x14edba0, receiver=0x618328) at 
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228
#15 0xffffffff in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, 
QThreadData*) (receiver=receiver@entry=0x0, event_type=event_type@entry=0, 
data=0x5194c8) at kernel/qcoreapplication.cpp:1552
#16 0xffffffff in QCoreApplication::sendPostedEvents(QObject*, int) 
(receiver=receiver@entry=0x0, event_type=event_type@entry=0) at 
kernel/qcoreapplication.cpp:1410
#17 0xffffffff in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) 
(s=0x536aa0) at kernel/qeventdispatcher_glib.cpp:271
#18 0xffffffff in g_main_context_dispatch (context=0x537390) at 
/build/buildd/glib2.0-2.44.1/./glib/gmain.c:3122
#19 0xffffffff in g_main_context_dispatch (context=context@entry=0x537390) at 
/build/buildd/glib2.0-2.44.1/./glib/gmain.c:3737
#20 0xffffffff in g_main_context_iterate (context=context@entry=0x537390, 
block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at 
/build/buildd/glib2.0-2.44.1/./glib/gmain.c:3808
#21 0xffffffff in g_main_context_iteration (context=0x537390, may_block=1) at 
/build/buildd/glib2.0-2.44.1/./glib/gmain.c:3869
#22 0xffffffff in 
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 
(this=0x537620, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#23 0xffffffff in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 
(this=this@entry=0xbedaa278, flags=..., flags@entry=...) at 
kernel/qeventloop.cpp:204
#24 0xffffffff in QCoreApplication::exec() () at 
kernel/qcoreapplication.cpp:1188
#25 0x0001407e in  ()
#26 0xffffffff in __libc_start_main () at /lib/arm-linux-gnueabihf/libc.so.6
#27 0x00014590 in _start ()
(gdb) cont

Suspect the leak is in ubuntu-app-launch

** Also affects: ubuntu-app-launch (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to mir in Ubuntu.
https://bugs.launchpad.net/bugs/1495871

Title:
  unity8 leaks file descriptors

Status in Canonical System Image:
  Confirmed
Status in mir package in Ubuntu:
  Invalid
Status in ubuntu-app-launch package in Ubuntu:
  New
Status in unity8 package in Ubuntu:
  Confirmed

Bug description:
  unity8 leaks file descriptors in various cases, causing the process to
  eventually fail (hang and/or restart). These leaks were first
  discovered during investigations of https://bugs.launchpad.net
  /canonical-devices-system-image/+bug/1491566 , but it's not clear yet
  if they are indeed responsible for that particular bug. In any case,
  this is a critical problem, and should be addressed independently.

  The fds are leaked in various scenarios, including:

  * opening/closing apps
  * switching between apps
  * locking the screen

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1495871/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to