scoperunner segfaults if ScopeBase.start() raises an exception

Bug #1262536 reported by James Henstridge
8
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

As a test, I applied the attached patch to the scope-A demo, to make it raise an exception in its start() method.

When I started the scope registry for the demo with:

    cd demo
    ../scoperegistry/scoperegistry Runtime.ini

I got the following output:

    Raising exception from start
    scoperegistry: process 14585 terminated by signal 11, command line: /home/james/src/unity/unity-scopes-api/build/scoperunner/scoperunner Runtime.ini /home/james/src/unity/unity-scopes-api/build/demo/scopes/scope-A/scope-A.ini

If I manually re-ran the scope with the command line given in the error, it printed the "Raising exception from start" message but didn't segfault until I tried running a query via the demo client.

I am testing against revision 102.

Tags: patch

Related branches

Revision history for this message
James Henstridge (jamesh) wrote :
Revision history for this message
James Henstridge (jamesh) wrote :

backtrace of scoperunner after the crash.

Revision history for this message
Michi Henning (michihenning) wrote :

Thanks for that, I'll take a look.

Changed in unity-scopes-api:
assignee: nobody → Michi Henning (michihenning)
Revision history for this message
James Henstridge (jamesh) wrote :

And worth noting: the actual exception message is never printed out anywhere.

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

James, could you have a look at this one please? I think it should be good to go now.

Michal Hruby (mhr3)
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 119, scheduled for release in unity-scopes-api, milestone Unknown

Changed in unity-scopes-api:
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "crash-scope.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
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

Bug attachments

Remote bug watches

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