public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list
@ 2010-07-05 22:26 chtz at informatik dot uni-bremen dot de
2010-07-05 22:28 ` [Bug c++/44827] " chtz at informatik dot uni-bremen dot de
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: chtz at informatik dot uni-bremen dot de @ 2010-07-05 22:26 UTC (permalink / raw)
To: gcc-bugs
Hi, I get "internal compiler error: Segmentation fault" when compiling the
attached program. It compiles fine with version 3.4.4
--
Summary: g++4.3.4 segfaults when using boost::intrusive::list
Product: gcc
Version: 4.3.4
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chtz at informatik dot uni-bremen dot de
GCC target triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/44827] g++4.3.4 segfaults when using boost::intrusive::list
2010-07-05 22:26 [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list chtz at informatik dot uni-bremen dot de
@ 2010-07-05 22:28 ` chtz at informatik dot uni-bremen dot de
2010-07-05 23:26 ` redi at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: chtz at informatik dot uni-bremen dot de @ 2010-07-05 22:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from chtz at informatik dot uni-bremen dot de 2010-07-05 22:28 -------
Created an attachment (id=21096)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21096&action=view)
generated by g++ -v -save-temps -c minimal.cc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/44827] g++4.3.4 segfaults when using boost::intrusive::list
2010-07-05 22:26 [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list chtz at informatik dot uni-bremen dot de
2010-07-05 22:28 ` [Bug c++/44827] " chtz at informatik dot uni-bremen dot de
@ 2010-07-05 23:26 ` redi at gcc dot gnu dot org
2010-07-05 23:28 ` redi at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-07-05 23:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from redi at gcc dot gnu dot org 2010-07-05 23:26 -------
unpreprocessed source (because preprocessed boost source is so dependent on
compiler version it often won't compile with other versions)
#include <boost/intrusive/list.hpp>
struct A : public boost::intrusive::list_base_hook<> {
virtual ~A() {}
};
template<class X>
struct D : A {
X x;
D(const X& x) : x(x) {}
};
typedef boost::intrusive::list<A> A_list;
struct data_holder {
A_list a;
template<class C>
static void delete_disposer(C* c){
delete c;
}
template<class X>
D<X>* insert(const X& x){
D<X> *t = new D<X>(x);
a.push_back(*t);
return t;
}
template<class X>
void remove(D<X>* t){
A_list::iterator it = A_list::s_iterator_to(*t);
a.erase_and_dispose(it, delete_disposer<A>);
}
};
int main() {
data_holder data;
D<int> *i = data.insert(10);
data.remove(i);
return 0;
}
This ICEs with Boost 1.39 or current Boost trunk, using any of 4.5.1, 4.6.0 or
Fedora 4.4.3
--
redi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Known to fail| |4.4.4 4.5.1 4.6.0
Last reconfirmed|0000-00-00 00:00:00 |2010-07-05 23:26:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/44827] g++4.3.4 segfaults when using boost::intrusive::list
2010-07-05 22:26 [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list chtz at informatik dot uni-bremen dot de
2010-07-05 22:28 ` [Bug c++/44827] " chtz at informatik dot uni-bremen dot de
2010-07-05 23:26 ` redi at gcc dot gnu dot org
@ 2010-07-05 23:28 ` redi at gcc dot gnu dot org
2010-07-06 22:07 ` chtz at informatik dot uni-bremen dot de
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-07-05 23:28 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 341 bytes --]
------- Comment #3 from redi at gcc dot gnu dot org 2010-07-05 23:28 -------
ICE is always at the same place
b.cc: In member function void data_holder::remove(D<X>*) [with X = int]:
b.cc:45:15: instantiated from here
b.cc:35:3: internal compiler error: Segmentation fault
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/44827] g++4.3.4 segfaults when using boost::intrusive::list
2010-07-05 22:26 [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list chtz at informatik dot uni-bremen dot de
` (2 preceding siblings ...)
2010-07-05 23:28 ` redi at gcc dot gnu dot org
@ 2010-07-06 22:07 ` chtz at informatik dot uni-bremen dot de
2010-07-06 23:09 ` redi at gcc dot gnu dot org
2010-07-11 12:56 ` davek at gcc dot gnu dot org
5 siblings, 0 replies; 8+ messages in thread
From: chtz at informatik dot uni-bremen dot de @ 2010-07-06 22:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from chtz at informatik dot uni-bremen dot de 2010-07-06 22:06 -------
I found two possible work-arounds:
either replace:
> template<class X>
> void remove(D<X>* t){
> A_list::iterator it = A_list::s_iterator_to(*t);
> a.erase_and_dispose(it, delete_disposer<A>);
> }
by:
template<class X>
void remove(D<X>* t){
A_list::iterator it = A_list::s_iterator_to(*t), it2 = it;
++it2;
a.erase_and_dispose(it, it2, delete_disposer<A>);
}
Or, what also works, is replacing delete_disposer<A> by a non-template version:
void delete_A(A* a){ delete a; }
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/44827] g++4.3.4 segfaults when using boost::intrusive::list
2010-07-05 22:26 [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list chtz at informatik dot uni-bremen dot de
` (3 preceding siblings ...)
2010-07-06 22:07 ` chtz at informatik dot uni-bremen dot de
@ 2010-07-06 23:09 ` redi at gcc dot gnu dot org
2010-07-11 12:56 ` davek at gcc dot gnu dot org
5 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-07-06 23:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from redi at gcc dot gnu dot org 2010-07-06 23:08 -------
Program received signal SIGSEGV, Segmentation fault.
0x00000000006f25bd in lvalue_p_1 (ref=0x7ffff0c4fb98) at
../../gcc-4.x/gcc/cp/tree.c:71
71 if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/44827] g++4.3.4 segfaults when using boost::intrusive::list
2010-07-05 22:26 [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list chtz at informatik dot uni-bremen dot de
` (4 preceding siblings ...)
2010-07-06 23:09 ` redi at gcc dot gnu dot org
@ 2010-07-11 12:56 ` davek at gcc dot gnu dot org
5 siblings, 0 replies; 8+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-07-11 12:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from davek at gcc dot gnu dot org 2010-07-11 12:56 -------
(In reply to comment #5)
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000006f25bd in lvalue_p_1 (ref=0x7ffff0c4fb98) at
> ../../gcc-4.x/gcc/cp/tree.c:71
> 71 if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
>
I don't even know what a one of these is:
(gdb) call debug_tree (ref)
<baselink 0x7fbc4880
type <lang_type 0x7ff7e580 unknown type type <lang_type 0x7ff7e580 unknown
type>
VOID
align 1 symtab 0 alias set -1 canonical type 0x7ff7e580
pointer_to_this <lang_type 0x7ff7e580 unknown type> reference_to_this
<lang_type 0x7ff7e580 unknown type>>
functions <template_id_expr 0x7fbc48a0
arg 0 <overload 0x7fb540c8 type <lang_type 0x7ff7e580 unknown type>
function <template_decl 0x7fb43e20 delete_disposer>>
arg 1 <tree_vec 0x7fb54968 elt 0 <record_type 0x7fd148c0 A>>>
binfo <tree_binfo 0x7fc973f0
type <record_type 0x7fd1b1c0 data_holder addressable needs-constructing
type_4 type_5 type_6 BLK
size <integer_cst 0x7fef09c0 constant 96>
unit size <integer_cst 0x7fef09d8 constant 12>
align 32 symtab 0 alias set -1 canonical type 0x7fd1b1c0 fields
<field_decl 0x7fb36ea0 a>
full-name "struct data_holder"
needs-constructor needs-destructor X() X(constX&) this=(X&)
n_parents=0 use_template=0 interface-unknown
pointer_to_this <pointer_type 0x7fb37380> chain <type_decl
0x7fcecef0 data_holder>>
private> access_binfo <tree_binfo 0x7fc973f0>>
(gdb)
This needs a C++ FE maintainer to take a look.
--
davek at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2010-07-05 23:26:24 |2010-07-11 12:56:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/44827] g++4.3.4 segfaults when using boost::intrusive::list
[not found] <bug-44827-4@http.gcc.gnu.org/bugzilla/>
@ 2011-10-02 10:15 ` paolo.carlini at oracle dot com
0 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-10-02 10:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44827
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC|gcc-bugs at gcc dot gnu.org |
Resolution| |FIXED
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-02 10:15:28 UTC ---
Fixed in 4.6.x.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-10-02 10:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-05 22:26 [Bug c++/44827] New: g++4.3.4 segfaults when using boost::intrusive::list chtz at informatik dot uni-bremen dot de
2010-07-05 22:28 ` [Bug c++/44827] " chtz at informatik dot uni-bremen dot de
2010-07-05 23:26 ` redi at gcc dot gnu dot org
2010-07-05 23:28 ` redi at gcc dot gnu dot org
2010-07-06 22:07 ` chtz at informatik dot uni-bremen dot de
2010-07-06 23:09 ` redi at gcc dot gnu dot org
2010-07-11 12:56 ` davek at gcc dot gnu dot org
[not found] <bug-44827-4@http.gcc.gnu.org/bugzilla/>
2011-10-02 10:15 ` paolo.carlini at oracle dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).