Opened 16 years ago
Last modified 13 years ago
#852 closed Bugs (fixed)
Problem with Boost and GCC 4.1 — at Version 12
Reported by: | nobody | Owned by: | Douglas Gregor |
---|---|---|---|
Milestone: | Component: | signals | |
Version: | None | Severity: | Showstopper |
Keywords: | Cc: | ma@… |
Description (last modified by )
There is a problem when using slots & trackable with GCC 4.1 - I don't know whether this is a GCC problem or a Boost problem, but it affects us (OpenWengo) on both Fedora Core and Feisty, since both distribute gcc 4.1. I'm attaching a test case - the expected output is: create A fire SGN A create B fire SGN A B delete A fire SGN B delete B fire SGN exit This doesn't happen :)
Change History (13)
comment:2 by , 16 years ago
Logged In: YES user_id=36183 Originator: NO When you say "this doesn't happen", what *does* happen? Different output? A crash? Please be more specific. Also, what version of Boost are you using? I believe there has been at least one bug-fix to the signals library since 1.33.0, though I'm not sure if it is related: http://boost.cvs.sourceforge.net/boost/boost/boost/signals/signal_template.hpp?r1=1.17&r2=1.17.2.1 Your test works for me on Ubuntu 6.06-LTS with Boost CVS as/of 2006-08-11 and these versions of gcc: gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) gcc version 4.1.2 I don't think this is a gcc bug.
comment:3 by , 16 years ago
Logged In: NO What actually happens is undefined - you get jibberish after deleting A. It should select the slot B, but that doesn't happen. Second info: this has also been created against GCC: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31164
comment:4 by , 16 years ago
Logged In: NO As I said in a previous comment, what happens is indeterminate. On one run, you get this: http://phpfi.com/215193 The Boost version is a 1.33 - the one which comes with Edgy. From http://packages.ubuntu.com/edgy/libs/ it looks to be 1.33.1. Dave.
comment:5 by , 16 years ago
Logged In: YES user_id=344328 Originator: NO I have this bug with Ubuntu/Edgy: boost 1.33.1-7ubuntu1 and gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5) Ludovico
comment:6 by , 16 years ago
Logged In: YES user_id=880725 Originator: NO The problem exists here with boost-1.33.1 and gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux) Output: ----------------- Starting program: /home/gladiac/workspace/tmp/testcase/a.out create A fire SGN A create B fire SGN A B delete A fire SGN A1��`�`ȱ`A�`�`AP�`�`�u��*p�`p�`!PL���*P�`1B!PL���*�`1 �`p�`��`10�`0�`Ȳ`!д`0�`A�`X�`P�`��`�`1d@�I@�`�:@!� @�`AP�`��`�u��*0�`0�`1��`1 �`p�`�`1!0�`AX�`��`�`�`@�`1d@�I@p�`�:@!� @0�`� Program exited normally.
comment:7 by , 16 years ago
Logged In: YES user_id=729903 Originator: NO I have verified this with gcc 4.1.0 (SuSE Linux), compiled and linked against Boost 1.33.1, then Boost 1.34 from a couple of moths ago. It fails for both versions of Boost. If I add "A = new Test("C", mySgn); B = new Test("D", mySgn);" right before "std::cerr << "fire SGN" << std::endl;", it segfaults nearly every time for me on the last mySgn() call.
comment:8 by , 16 years ago
Logged In: YES user_id=116622 Originator: NO Here is an even simpler test case: when build with gcc 4.0 it outputs "Success", with gcc 4.1 it will output "Failure". ---- #include <iostream> #include <boost/signal.hpp> #include <boost/bind.hpp> #include <stdlib.h> class SomeObject : public boost::signals::trackable { public: void function() { std::cerr << "Failure\n"; exit(1); } }; int main() { SomeObject* obj = new SomeObject; boost::signal<void ()> signal; signal.connect(boost::bind(&SomeObject::function, obj)); delete obj; signal(); std::cerr << "Success\n"; return 0; } ----
comment:9 by , 15 years ago
Owner: | changed from | to
---|---|
Severity: | → Showstopper |
Status: | assigned → new |
Assigned to "doug_gregor" instead of nonexistent user "dgregor"
by , 15 years ago
Attachment: | test-gcc-boost.cc added |
---|
Sample file copied from the SourceForge version of this ticket
comment:11 by , 15 years ago
Component: | None → signals |
---|
comment:12 by , 14 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Note:
See TracTickets
for help on using tickets.