Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1999

[c] Crash in pn_connection_finalize



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cpp-binding, proton-c
    • Labels:
    • Environment:
      Linux 64-bits (Ubuntu 16.04 and Oracle Linux 7.4)


      Here is my situation : I have several proton::containers (~20).
      Each one has its own proton::messaging_handler, and handles one proton::connection to a local qpid-broker (everything runs on the same Linux machine).

      20 x ( one container with one handler with one connection with one link)
      Some containers/connections/handlers work in send mode ; they have one link that is a proton::sender.
      Some containers/connections/handlers work in receive mode ; they have one link that is a proton::receiver. Each time they receive an input message, they do some processing on it, and finally add a "sender->send()" task to the work queue of some sender handlers ( by calling work_queue()>add( [=] { sender>send(msg); } as shown in the multi-threading examples).
      This works fine for some time (tens of thousands of messages, several minutes or hours), but eventually crashes, either with a SEGFAULT (when the qpid-proton lib is compiled in release mode) or with an assert (in debug mode), in qpid-proton/c/src/core/engine.c line 483, assert(!conn->transport->referenced) in function pn_connection_finalize().

      The proton logs (activated with export PN_TRACE_FRM=1) do not show anything abnormal (no loss of connection, no rejection of messages, no timeouts, ...).

      As the connection is not closed, I wonder why pn_connection_finalize() would be called in the first place.

      I joined the logs and the call trace.

      Happens on 0.26.0 but also reproduced with the latest master (Jan 28, 2019).




        1. example2.cpp
          3 kB
          Olivier Delbeke
        2. main.cpp
          3 kB
          Olivier Delbeke
        3. run_qpid-broker.sh
          0.6 kB
          Olivier Delbeke
        4. log.txt
          112 kB
          Olivier Delbeke
        5. call_stack.txt
          4 kB
          Olivier Delbeke



            • Assignee:
              cliffjansen Clifford Jansen
              ODelbeke Olivier Delbeke
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: