scope-registry 100% cpu usage

Bug #1268524 reported by Paweł Stołowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-scopes-api
Fix Released
Undecided
Michi Henning
unity-scopes-api (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Current scoperegistry from trunk (as of 2014-01-13, rev. 125) consumes 100% cpu and produces the following errors, which may be related:

scoperunner: unity::ResourceException: /home/pawel/src/ubuntu/unity-scopes-api/unity-scopes-api/build/demo/scopes/scope-B/libscope-B.so: undefined symbol: unity_scope_destroy
....
scoperegistry: process 10518 exited with status 1, command line: /home/pawel/src/ubuntu/unity-scopes-api/unity-scopes-api/build/scoperunner/scoperunner Runtime.ini /home/pawel/src/ubuntu/unity-scopes-api/unity-scopes-api/build/demo/scopes/scope-D/scope-D.ini

Sending SIGQUIT to scoperegistry gives the following bt:

#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f0a00e4e18c in std::condition_variable::wait(std::unique_lock<std::mutex>&) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x00007f0a01702297 in void std::condition_variable::wait<unity::scopes::internal::zmq_middleware::ZmqMiddleware::wait_for_shutdown()::{lambda()#1}>(std::unique_lock<std::mutex>&, unity::scopes::internal::zmq_middleware::ZmqMiddleware::wait_for_shutdown()::{lambda()#1}) ()
   from /home/pawel/src/ubuntu/unity-scopes-api/unity-scopes-api/build/libunity-scopes.so.0
#3 0x00007f0a016fff61 in unity::scopes::internal::zmq_middleware::ZmqMiddleware::wait_for_shutdown() ()
   from /home/pawel/src/ubuntu/unity-scopes-api/unity-scopes-api/build/libunity-scopes.so.0
#4 0x0000000000429271 in main ()

Attaching bt for all threads.

Related branches

Revision history for this message
Paweł Stołowski (stolowski) wrote :
Changed in unity-scopes-api:
status: New → In Progress
summary: - scope-registry 100% usage
+ scope-registry 100% cpu usage
Changed in unity-scopes-api:
assignee: nobody → Michi Henning (michihenning)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:unity-scopes-api at revision 129, scheduled for release in unity-scopes-api, milestone Unknown

Changed in unity-scopes-api:
status: In Progress → Fix Committed
Revision history for this message
Michi Henning (michihenning) wrote :

I'm setting status back to "in progress". While the fix that was committed stops the 100% CPU usage, this doesn't fix the underlying problem: if the .so for the scope doesn't have a destroy function in the symbol table, we end up spinning somewhere. I'm looking into this at the moment.

Changed in unity-scopes-api:
status: Fix Committed → In Progress
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:unity-scopes-api at revision 134, scheduled for release in unity-scopes-api, milestone Unknown

Changed in unity-scopes-api:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.7 KiB)

This bug was fixed in the package unity-scopes-api - 0.2.0+14.04.20140120-0ubuntu1

---------------
unity-scopes-api (0.2.0+14.04.20140120-0ubuntu1) trusty; urgency=low

  [ Michi Henning ]
  * Added ability for scope to push an exception (as an exception_ptr). On the client side,
    the exception is delivered as the what() string (if the exception is a std::exception) and
    as "unknown exception", otherwise.
  * Disabled running the tests in parallel for CI. They are not written
    to run concurrently because the different tests try to bind to the
    same network endpoints. This should almost certainly fix the failure
    reported here:
    https://launchpadlibrarian.net/159997415/buildlog_ubuntu-saucy-
    i386.unity-scopes-api_0.1.5-0~94~ubuntu13.10.1_FAILEDTOBUILD.txt.gz.
  * Got rid of chatter from helgrind. (Needs helgrind 3.9.0 or later--
    3.8.1 generates bogus errors.) Added public destroy() method so it
    is possible to shut down the reaper explicitly. Fixed race condition
    on setting the self_ weak_ptr.
  * Changed code to match macro change here:
    https://code.launchpad.net/~michihenning/unity-api/noncopyable-
    fix/+merge/200084 Also removed remaining remnants of deprecated
    NonCopyable class.
  * Added CMake option to build with -fsanitize=thread. Fixed a bunch of
    warnings when building with clang.
  * Fixed valgrind error in HttpClient_test.cpp: execv was using
    deallocated memory. Updated CTestCustom.cmake.in to correctly
    suppress the tests that should not be run under valgrind.
  * Fixed shutdown in ObjectAdapter and added proper exception handling
    if the broker thread or a worker thread encounters an exception.
  * Disabled code generation for stand-alone header compilation tests.
    This makes the tests run marginally faster.
  * Added locate() remote method to the Registry, for the scope
    activation logic.
  * Changed ScopeLoader to not run the scope in a separate thread. (This
    is done by scoperunner anyway.) This fixes the problem of an
    exception being thrown by start(), but the scoperunner not realizing
    this. (LP: #1262536)
  * Added suppressions file for thread sanitizer issues in zmq.
  * Fixed race on registry start-up: registry was answering incoming
    requests too early. Other minor cosmetic changes: replaced
    factory()->create() call with factory()->find() because RuntimeImpl
    already instantiates the middleware. Removed redundant #includes.
    (LP: #1267026)
  * Minor fix: got rid of unnecessary unique_ptr. No functional changes.
  * Added formatcode target to CMakeLists.txt. This runs all source and
    header files through a pretty-printer.
  * Updated code for API changes in latest Cap'n Proto. (LP: #1268538)
  * Added check to prevent two servers from binding to the same ipc
    endpoint. Added coverage test for double-bind. Removed attempts to
    deal with servant destructors that throw. It turns out that this
    doesn't work because the destructor is called in the context of the
    map destructor, which calls the shared_ptr destructors, so we end up
    in terminate(). I might theoretically be possible to do this with a
    custom deleter for the...

Read more...

Changed in unity-scopes-api (Ubuntu):
status: New → Fix Released
Michal Hruby (mhr3)
Changed in unity-scopes-api:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.