public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free
@ 2012-08-18 10:08 burnus at gcc dot gnu.org
  2012-08-18 10:32 ` [Bug middle-end/54313] " steven at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-18 10:08 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/54313] [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free
  2012-08-18 10:08 [Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free burnus at gcc dot gnu.org
@ 2012-08-18 10:32 ` steven at gcc dot gnu.org
  2012-08-18 10:35 ` steven at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu.org @ 2012-08-18 10:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54313

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
             Status|UNCONFIRMED                 |NEW
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2012-08/msg01240.htm
                   |                            |l
   Last reconfirmed|                            |2012-08-18
     Ever Confirmed|0                           |1

--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-18 10:31:44 UTC ---
One of the bitmap is BITMAP_FREE'd when its obstack is already released.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/54313] [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free
  2012-08-18 10:08 [Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free burnus at gcc dot gnu.org
  2012-08-18 10:32 ` [Bug middle-end/54313] " steven at gcc dot gnu.org
@ 2012-08-18 10:35 ` steven at gcc dot gnu.org
  2012-08-18 10:36 ` steven at gcc dot gnu.org
  2012-08-20  7:26 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu.org @ 2012-08-18 10:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54313

--- Comment #2 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-18 10:35:41 UTC ---
Author: steven
Date: Sat Aug 18 10:35:36 2012
New Revision: 190502

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190502
Log:
    PR middle-end/54313
    * dse.c (dse_step7): Don't free kill_on_calls bitmap, it is
    freed when its obstack is release.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dse.c


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/54313] [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free
  2012-08-18 10:08 [Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free burnus at gcc dot gnu.org
  2012-08-18 10:32 ` [Bug middle-end/54313] " steven at gcc dot gnu.org
  2012-08-18 10:35 ` steven at gcc dot gnu.org
@ 2012-08-18 10:36 ` steven at gcc dot gnu.org
  2012-08-20  7:26 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu.org @ 2012-08-18 10:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54313

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-18 10:36:20 UTC ---
.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug middle-end/54313] [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free
  2012-08-18 10:08 [Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-08-18 10:36 ` steven at gcc dot gnu.org
@ 2012-08-20  7:26 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-08-20  7:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54313

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-20  7:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-18 10:08 [Bug middle-end/54313] New: [4.8 Regression] GCC fails to bootstrap with MALLOC_PERTURB – Segfault in bitmap_obstack_free burnus at gcc dot gnu.org
2012-08-18 10:32 ` [Bug middle-end/54313] " steven at gcc dot gnu.org
2012-08-18 10:35 ` steven at gcc dot gnu.org
2012-08-18 10:36 ` steven at gcc dot gnu.org
2012-08-20  7:26 ` rguenth at gcc dot gnu.org

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).