LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 307 - segfault on C++ boost code
Summary: segfault on C++ boost code
Status: RESOLVED WONTFIX
Alias: None
Product: tools
Classification: Unclassified
Component: llvm-g++ (show other bugs)
Version: 1.2
Hardware: Other Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords: crash-on-invalid
Depends on:
Blocks:
 
Reported: 2004-03-31 07:37 PST by Vladimir Prus
Modified: 2010-02-22 12:54 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Prus 2004-03-31 07:37:28 PST
When I try llvmg++ on a code from C++ boost graph library, I get the following: 
 
home/ghost/Work/boost/boost/random/linear_congruential.hpp:213: internal 
compiler error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://llvm.cs.uiuc.edu> for instructions. 
 
The procesourced source code is available at 
http://zigzag.cs.msu.su/~ghost/dfs.ii
Comment 1 Brian R. Gaeke 2004-03-31 15:16:02 PST
Replicated the crash on powerpc-apple-darwin7.3.0. However, I don't seem to be getting a backtrace 
out of gdb today. Maybe my luck will be better next time. Marking this as crash-on-invalid because of 
the errors I get from cc1plus. Inquiring minds want to know -- what hardware platform are you using? 
(your bug report says "Other").

persephone:~/Desktop gaeke$ gdb --args !-2
gdb --args $cc1plus -quiet -o dfs.s dfs.ii
GNU gdb 5.3-20030128 (Apple version gdb-309) (Thu Dec  4 15:41:30 GMT 2003)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin".
Reading symbols for shared libraries ... done
(gdb) run
Starting program: /Users/gaeke/cfrontend/install/libexec/gcc/powerpc-apple-darwin7.3.0/3.4-llvm/
cc1plus -quiet -o dfs.s dfs.ii
Reading symbols for shared libraries . done
In file included from /home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/
3.4-llvm/../../../../include/c++/3.4-llvm/bits/stl_algobase.h:69,
                 from /home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-
llvm/../../../../include/c++/3.4-llvm/bits/char_traits.h:46,
                 from /home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-
llvm/../../../../include/c++/3.4-llvm/ios:46,
                 from /home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-
llvm/../../../../include/c++/3.4-llvm/ostream:45,
                 from /home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-
llvm/../../../../include/c++/3.4-llvm/iterator:70,
                 from /home/ghost/Work/boost/boost/test/detail/unit_test_config.hpp:22,
                 from /home/ghost/Work/boost/boost/test/test_tools.hpp:20,
                 from dfs.cpp:27:
/home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../
include/c++/3.4-llvm/new:82: error: `operator new' takes type `size_t' (`long unsigned int') as first 
parameter
/home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../
include/c++/3.4-llvm/new:83: error: `operator new' takes type `size_t' (`long unsigned int') as first 
parameter
/home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../
include/c++/3.4-llvm/new:86: error: `operator new' takes type `size_t' (`long unsigned int') as first 
parameter
/home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../
include/c++/3.4-llvm/new:87: error: `operator new' takes type `size_t' (`long unsigned int') as first 
parameter
/home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../
include/c++/3.4-llvm/new:92: error: `operator new' takes type `size_t' (`long unsigned int') as first 
parameter
/home/ghost/build/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../
include/c++/3.4-llvm/new:93: error: `operator new' takes type `size_t' (`long unsigned int') as first 
parameter
In file included from dfs.cpp:33:
/home/ghost/Work/boost/boost/graph/graph_utility.hpp: In function `void boost::
print_in_edges(const IncidenceGraph&, Name)':
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:171: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:175: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:176: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp: In function `void boost::
print_graph_dispatch(const IncidenceGraph&, Name, boost::directed_tag)':
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:185: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:189: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:190: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp: In function `void boost::
print_graph_dispatch(const IncidenceGraph&, Name, boost::undirected_tag)':
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:198: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:202: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:203: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp: In function `void boost::print_edges(const 
EdgeListGraph&, Name)':
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:223: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:225: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp: In function `void boost::print_edges2(const 
EdgeListGraph&, VertexName, EdgeName)':
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:233: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:235: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp: In function `void boost::print_vertices(const 
VertexListGraph&, Name)':
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:243: error: `cout' is not a member of `std'
/home/ghost/Work/boost/boost/graph/graph_utility.hpp:244: error: `cout' is not a member of `std'

Program received signal EXC_BAD_ACCESS, Could not access memory.
finish_call_expr (fn=0xf53310, args=0x0, disallow_virtual=false, koenig_p=false) at ../../src/gcc/cp/
semantics.c:1636
1636                                   TYPE_BINFO (type),
(gdb) where
#0  finish_call_expr (fn=0xf53310, args=0x0, disallow_virtual=false, koenig_p=false) at ../../src/gcc/
cp/semantics.c:1636


Comment 2 Chris Lattner 2004-03-31 22:13:10 PST
This is a segfault in the non-LLVM-specific parts of the G++ parser, with this
backtrace:

#0  finish_call_expr (fn=0x40efa230, args=0x0, disallow_virtual=false,
koenig_p=false) at ../../gcc-3.4-cvs/gcc/cp/semantics.c:1636
#1  0x080ec2b8 in cp_parser_postfix_expression (parser=0x40559240,
address_p=false) at ../../gcc-3.4-cvs/gcc/cp/parser.c:3582
#2  0x080ed090 in cp_parser_unary_expression (parser=0x40559240,
address_p=false) at ../../gcc-3.4-cvs/gcc/cp/parser.c:4116
#3  0x080f71e9 in cp_parser_simple_cast_expression (parser=0x0) at
../../gcc-3.4-cvs/gcc/cp/parser.c:13779
#4  0x080f68b2 in cp_parser_binary_expression (parser=0x40559240,
token_tree_map=0x84947a4, fn=0x80f71d0 <cp_parser_simple_cast_expression>)
    at ../../gcc-3.4-cvs/gcc/cp/parser.c:13283
#5  0x080ed7f1 in cp_parser_pm_expression (parser=0x0) at
../../gcc-3.4-cvs/gcc/cp/parser.c:4561
#6  0x080f68b2 in cp_parser_binary_expression (parser=0x40559240,
token_tree_map=0x84947b0, fn=0x80ed7d0 <cp_parser_pm_expression>) at
../../gcc-3.4-cvs/gcc/cp/parser.c:13283
#7  0x080ed821 in cp_parser_multiplicative_expression (parser=0x0) at
../../gcc-3.4-cvs/gcc/cp/parser.c:4585
#8  0x080f68b2 in cp_parser_binary_expression (parser=0x40559240,
token_tree_map=0x84947c0, fn=0x80ed800 <cp_parser_multiplicative_expression>)
    at ../../gcc-3.4-cvs/gcc/cp/parser.c:13283
#9  0x080ed851 in cp_parser_additive_expression (parser=0x0) at
../../gcc-3.4-cvs/gcc/cp/parser.c:4608
#10 0x080f68b2 in cp_parser_binary_expression (parser=0x40559240,
token_tree_map=0x84947cc, fn=0x80ed830 <cp_parser_additive_expression>) at
../../gcc-3.4-cvs/gcc/cp/parser.c:13283
#11 0x080ed881 in cp_parser_shift_expression (parser=0x0) at
../../gcc-3.4-cvs/gcc/cp/parser.c:4631
#12 0x080f68b2 in cp_parser_binary_expression (parser=0x40559240,
token_tree_map=0x84947d8, fn=0x80ed860 <cp_parser_shift_expression>) at
../../gcc-3.4-cvs/gcc/cp/parser.c:13283
...

This will probably be fixed in the future by merging newer bits into the LLVM
G++ front-end from GCC CVS, but until then there is nothing that we can really
do about it.

-Chris
Comment 3 Vladimir Prus 2004-04-01 00:00:09 PST
Just a bit of additional info: regular gcc 3.4 from 2004-02-22 (Debian package) 
does not crash on that code, so maybe the bug was already fixed by that date. 
 
Comment 4 Chris Lattner 2004-04-01 00:17:31 PST
I believe that.  Unfortunately our C++ front-end is pretty far out of date.  The
last time we sync'd up with CVS was Sep 24.  If you find a GCC PR for this, it
will probably indicate the patch that fixed it and we could arrange to pull it in...

Updating the C front-end to newer GCC CVS is definitely something we want to do,
we just don't have the man-power for it right now...

-Chris