This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB â Segfault in bitmap_obstack_free
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 18 Aug 2012 10:08:20 +0000
- Subject: [Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB â Segfault in bitmap_obstack_free
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54313
Bug #: 54313
Summary: [4.8 Regression] GCC fails to bootstrap with
MALLOC_PERTURB â Segfault in bitmap_obstack_free
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: build, ice-on-valid-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: steven@gcc.gnu.org
If malloc doesn't return nullified memory, bootstrapping fails as soon as the
stage1 compiler is used to build libgcc.
To reproduce: With GLIBC, simply set
export MALLOC_PERTURB_=163
and on FreeBSD, use jemalloc with junk filling.
Then either bootstrap, which will fail at the first use of the stage1 compiler,
i.e. when building the first libgcc file.
Or if you already have a bootstrapped compiler:
$ cat test.c
int main () {
return 0;
}
$ gcc -c -O test.c
test.c: In function 'main':
test.c:3:1: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
That fails in:
$ gdb --args ~/projects/gcc-git/gcc-build/gcc/cc1 -O test.c
...
Program received signal SIGSEGV, Segmentation fault.
0x0000000000600f52 in bitmap_obstack_free (map=0x157e5d0) at
/projects/tob/gcc-git/gcc/gcc/bitmap.c:388
388 map->first = (bitmap_element *) map->obstack->heads;
(gdb) p map->obstack
$1 = (bitmap_obstack *) 0xa3a3a3a3a3a3a3a3
(gdb) bt
#0 0x0000000000600f52 in bitmap_obstack_free (map=0x157e5d0) at
/projects/tob/gcc-git/gcc/gcc/bitmap.c:388
#1 0x0000000000ce5f46 in dse_step7 () at
/projects/tob/gcc-git/gcc/gcc/dse.c:3826
#2 rest_of_handle_dse () at /projects/tob/gcc-git/gcc/gcc/dse.c:3891
#3 0x0000000000868fef in execute_one_pass (pass=pass@entry=0x14483a0
<pass_rtl_dse1>) at /projects/tob/gcc-git/gcc/gcc/passes.c:2157
#4 0x00000000008693a5 in execute_pass_list (pass=0x14483a0 <pass_rtl_dse1>) at
/projects/tob/gcc-git/gcc/gcc/passes.c:2212
#5 0x00000000008693b7 in execute_pass_list (pass=0x1443220
<pass_rest_of_compilation>) at /projects/tob/gcc-git/gcc/gcc/passes.c:2213
#6 0x0000000000669b38 in expand_function (node=0x2aaaac192750) at
/projects/tob/gcc-git/gcc/gcc/cgraphunit.c:1609
#7 0x000000000066b9da in expand_all_functions () at
/projects/tob/gcc-git/gcc/gcc/cgraphunit.c:1714
#8 compile () at /projects/tob/gcc-git/gcc/gcc/cgraphunit.c:2012
#9 0x000000000066bfd5 in finalize_compilation_unit () at
/projects/tob/gcc-git/gcc/gcc/cgraphunit.c:2089
#10 0x0000000000560390 in c_write_global_declarations () at
/projects/tob/gcc-git/gcc/gcc/c/c-decl.c:10116
#11 0x000000000090a165 in compile_file () at
/projects/tob/gcc-git/gcc/gcc/toplev.c:560
#12 0x000000000090bcda in do_compile () at
/projects/tob/gcc-git/gcc/gcc/toplev.c:1863