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

Segfaults when compiling C++03 clients with a C++11 compiled proton-cpp library

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: proton-c-0.18.0
    • Component/s: cpp-binding
    • Labels:
      None

      Description

      Compile the proton library as usual.

      cmake .. -DBUILD_GO=OFF -DCMAKE_INSTALL_PREFIX=../install -GNinja
      ninja install
      

      Now compile an application that uses container.schedule() function. An example should work fine.

      g++ -std=c++03 scheduled_send_03.cpp -I ../../install/include -L ../../install/lib64 -l qpid-proton-cpp -l qpid-proton-core -l qpid-proton-proactor
      

      Run this and observe the segfault

      LD_LIBRARY_PATH=../../install/lib64 ./a.out  
      Segmentation fault
      
      $ LD_LIBRARY_PATH=../../install/lib64 gdb --args ./a.out
      GNU gdb (GDB) 8.0
      Copyright (C) 2017 Free Software Foundation, Inc.
      [...]
      Reading symbols from ./a.out...done.
      (gdb) run
      Starting program: /home/jdanek/Work/repos/qpid-proton/examples/cpp/a.out 
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/nix/store/l48biijfr1j6d5kdg911051x2phfjrz7-glibc-2.25/lib/libthread_db.so.1".
      
      Program received signal SIGSEGV, Segmentation fault.
      0x00007fffffffae20 in ?? ()
      (gdb) bt
      #0  0x00007fffffffae20 in ?? ()
      #1  0x00007ffff7bb09d4 in std::function<void ()>::function(std::function<void ()> const&) (this=0x7ffffffface0, __x=...)
          at /nix/store/pdidaf83cvkrgx8xjgjdnl5m1naqjbfk-gcc-7.1.0/include/c++/7.1.0/bits/std_function.h:677
      #2  0x00007ffff7bc714a in proton::work::work (this=0x7ffffffface0) at ../proton-c/bindings/cpp/include/proton/work_queue.hpp:47
      #3  proton::work_queue::schedule (this=<optimized out>, d=..., f=...) at ../proton-c/bindings/cpp/src/work_queue.cpp:49
      #4  0x0000000000405ade in void proton::schedule_work<proton::work_queue*, void (scheduled_sender::*)(proton::sender), scheduled_sender*, proton::sender>(proton::work_queue*, proton::duration, void (scheduled_sender::*)(proton::sender), scheduled_sender*, proton::sender) ()
      #5  0x0000000000405bfb in scheduled_sender::on_sender_open(proton::sender&) ()
      #6  0x00007ffff7bb8f3d in proton::(anonymous namespace)::on_link_remote_open (event=0x7fffffffb1a0, handler=warning: RTTI symbol not found for class 'scheduled_sender'
      ...)
          at ../proton-c/bindings/cpp/src/messaging_adapter.cpp:267
      #7  proton::messaging_adapter::dispatch (handler=warning: RTTI symbol not found for class 'scheduled_sender'
      ..., event=event@entry=0x61dcd0)
          at ../proton-c/bindings/cpp/src/messaging_adapter.cpp:309
      #8  0x00007ffff7bafa2e in proton::container::impl::handle (this=this@entry=0x61d030, event=0x61dcd0)
          at ../proton-c/bindings/cpp/src/proactor_container_impl.cpp:601
      #9  0x00007ffff7bb006b in proton::container::impl::thread (this=this@entry=0x61d030)
          at ../proton-c/bindings/cpp/src/proactor_container_impl.cpp:613
      #10 0x00007ffff7bb0413 in proton::container::impl::run (this=0x61d030, threads=1)
          at ../proton-c/bindings/cpp/src/proactor_container_impl.cpp:651
      #11 0x0000000000404166 in main ()
      

        Attachments

          Activity

            People

            • Assignee:
              astitcher Andrew Stitcher
              Reporter:
              jdanek Jiri Daněk
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: