[Boost-bugs] [Boost C++ Libraries] #6254: segmentation fault when different signals call each other

Subject: [Boost-bugs] [Boost C++ Libraries] #6254: segmentation fault when different signals call each other
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-11 22:18:35


#6254: segmentation fault when different signals call each other
-----------------------------------------+----------------------------------
 Reporter: Juan.Arrieta@… | Owner: dgregor
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: signals
  Version: Boost 1.48.0 | Severity: Problem
 Keywords: segmentation fault |
-----------------------------------------+----------------------------------
 I was playing around with boost/signal and I came up with the following
 code:


 {{{
 #include<stdlib.h>
 #include<iostream>
 #include<boost/signal.hpp>

 boost::signal<void ()> SIG1;
 boost::signal<void ()> SIG2;

 void f1(){
 std::cout<<"f1 called"<<std::endl;
 SIG2();
 }

 void f2(){
 std::cout<<"f2 called"<<std::endl;
 SIG1();
 }

 int main(){
 SIG1.connect(&f1);
 SIG2.connect(&f2);
 SIG1();
 return EXIT_SUCCESS;
 }

 }}}

 When I compile and run (g++ 4.0.1 Apple Inc. build 5490 / boost v. 1.48),
 the I get 12,478 lines of the form:

 {{{
 f1 called
 f2 called
 }}}

 after the 12,478th line, I get a segmentation fault.

 I would have expected the call to continue endlessly (until hitting
 Ctrl-C), but this is not the case.

 Is this the intended behavior?

 I understand it is silly to call "recursively" as in the example, but this
 was intended as a test.

 Thank you.

 PS. Please review the "severity" accordingly - this may not even be a bug.

 Thank you!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6254>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC