public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64
@ 2012-03-22 22:18 adrian at llnl dot gov
  2012-04-03 14:26 ` [Bug fortran/52679] " burnus at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: adrian at llnl dot gov @ 2012-03-22 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52679
           Summary: ICE in gfortran 4.6.3, x86_64
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: adrian@llnl.gov


Created attachment 26962
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26962
reduced test case

Here's another one :-)

The raw testcase is the same as Bug 52622, but it was reduced to yield a
different segfault this time.

ICE in gfortran 4.6.3 .
The machine is running Ubuntu 10.04, 64 bit on an Intel Xeon.


  $ gfortran -c -o test.o test.f03 

  f951: internal compiler error: Segmentation fault
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <http://gcc.gnu.org/bugs.html> for instructions.

I've attached a delta-reduced test case.



This is the valgrind output:
==6154== Invalid read of size 1
==6154==    at 0x5F8B3E: mpz_get_double_int (double-int.c:1145)
==6154==    by 0x554001: gfc_conv_mpz_to_tree (trans-const.c:204)
==6154==    by 0x55480F: gfc_conv_constant (trans-const.c:396)
==6154==    by 0x568EBB: gfc_conv_initializer (trans-expr.c:4162)
==6154==    by 0x56139B: gfc_conv_structure (trans-expr.c:4671)
==6154==    by 0x568FAB: gfc_conv_initializer (trans-expr.c:4204)
==6154==    by 0x56139B: gfc_conv_structure (trans-expr.c:4671)
==6154==    by 0x568FAB: gfc_conv_initializer (trans-expr.c:4204)
==6154==    by 0x558180: gfc_get_symbol_decl (trans-decl.c:1381)
==6154==    by 0x55878F: generate_local_decl (trans-decl.c:4179)
==6154==    by 0x52F5E6: traverse_ns (symbol.c:3333)
==6154==    by 0x52F5D5: traverse_ns (symbol.c:3330)
==6154==  Address 0x2 is not stack'd, malloc'd or (recently) free'd
==6154== 
test.f03: In function ‘args_basic_wrap’:
test.f03:31:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
==6154== 
==6154== HEAP SUMMARY:
==6154==     in use at exit: 865,260 bytes in 3,348 blocks
==6154==   total heap usage: 7,483 allocs, 4,135 frees, 1,552,569 bytes
allocated
==6154== 
==6154== LEAK SUMMARY:
==6154==    definitely lost: 12,294 bytes in 73 blocks
==6154==    indirectly lost: 3,504 bytes in 6 blocks
==6154==      possibly lost: 352 bytes in 18 blocks
==6154==    still reachable: 849,110 bytes in 3,251 blocks
==6154==         suppressed: 0 bytes in 0 blocks
==6154== Rerun with --leak-check=full to see details of leaked memory
==6154== 
==6154== For counts of detected and suppressed errors, rerun with: -v
==6154== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
==6138== 
==6138== HEAP SUMMARY:
==6138==     in use at exit: 32,121 bytes in 82 blocks
==6138==   total heap usage: 498 allocs, 416 frees, 60,580 bytes allocated
==6138== 
==6138== LEAK SUMMARY:
==6138==    definitely lost: 5,444 bytes in 29 blocks
==6138==    indirectly lost: 45 bytes in 3 blocks
==6138==      possibly lost: 29 bytes in 2 blocks
==6138==    still reachable: 26,603 bytes in 48 blocks
==6138==         suppressed: 0 bytes in 0 blocks
==6138== Rerun with --leak-check=full to see details of leaked memory
==6138== 
==6138== For counts of detected and suppressed errors, rerun with: -v
==6138== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)


Backtrace in gdb:

Program received signal SIGSEGV, Segmentation fault.
mpz_get_double_int (type=0x0, val=0x136b528, wrap=1 '\001') at
../../gcc/double-int.c:1145
1145      res = double_int_ext (res, TYPE_PRECISION (type), TYPE_UNSIGNED
(type));
(gdb) l
1140      gcc_assert (wrap || count <= 2);
1141    
1142      res.low = vp[0];
1143      res.high = (HOST_WIDE_INT) vp[1];
1144    
1145      res = double_int_ext (res, TYPE_PRECISION (type), TYPE_UNSIGNED
(type));
1146      if (mpz_sgn (val) < 0)
1147        res = double_int_neg (res);
1148    
1149      return res;
(gdb) bt
#0  mpz_get_double_int (type=0x0, val=0x136b528, wrap=1 '\001') at
../../gcc/double-int.c:1145
#1  0x0000000000554002 in gfc_conv_mpz_to_tree (i=0x136b528, kind=0) at
../../gcc/fortran/trans-const.c:204
#2  0x0000000000554810 in gfc_conv_constant (se=0x7fffffffd870, expr=0x136b4b0)
at ../../gcc/fortran/trans-const.c:396
#3  0x0000000000568ebc in gfc_conv_initializer (expr=0x136b4b0, ts=0x137d008,
type=0x7ffff7e9cdc8, array=<value optimized out>, pointer=<value optimized
out>, 
    procptr=<value optimized out>) at ../../gcc/fortran/trans-expr.c:4162
#4  0x000000000056139c in gfc_conv_structure (se=0x7fffffffd940, expr=<value
optimized out>, init=<value optimized out>) at
../../gcc/fortran/trans-expr.c:4671
#5  0x0000000000568fac in gfc_conv_initializer (expr=0x135c830, ts=0x1375de8,
type=0x7ffff7f85bd0, array=<value optimized out>, pointer=<value optimized
out>, 
    procptr=<value optimized out>) at ../../gcc/fortran/trans-expr.c:4204
#6  0x000000000056139c in gfc_conv_structure (se=0x7fffffffda10, expr=<value
optimized out>, init=<value optimized out>) at
../../gcc/fortran/trans-expr.c:4671
#7  0x0000000000568fac in gfc_conv_initializer (expr=0x1351d40, ts=0x1351b70,
type=0x7ffff7f8b7e0, array=<value optimized out>, pointer=<value optimized
out>, 
    procptr=<value optimized out>) at ../../gcc/fortran/trans-expr.c:4204
#8  0x0000000000558181 in gfc_get_symbol_decl (sym=0x1351b50) at
../../gcc/fortran/trans-decl.c:1381
#9  0x0000000000558790 in generate_local_decl (sym=0x1351b50) at
../../gcc/fortran/trans-decl.c:4179
#10 0x000000000052f5e7 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3333
#11 0x000000000052f5d6 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3330
#12 0x000000000052f5d6 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3330
#13 0x000000000052f5d6 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3330
#14 0x000000000052f5d6 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3330
#15 0x000000000052f5d6 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3330
#16 0x000000000052f5d6 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3330
#17 0x000000000052f5d6 in traverse_ns (st=<value optimized out>, func=0x558590
<generate_local_decl>) at ../../gcc/fortran/symbol.c:3330
#18 0x000000000055c554 in generate_local_vars (ns=0x1350c10) at
../../gcc/fortran/trans-decl.c:4303
#19 gfc_generate_function_code (ns=0x1350c10) at
../../gcc/fortran/trans-decl.c:4782
#20 0x0000000000506d79 in translate_all_program_units () at
../../gcc/fortran/parse.c:4265
#21 gfc_parse_file () at ../../gcc/fortran/parse.c:4478
#22 0x000000000053f836 in gfc_be_parse_file () at
../../gcc/fortran/f95-lang.c:250
#23 0x000000000079f23c in compile_file (argc=13, argv=0x7fffffffdfb8) at
../../gcc/toplev.c:579
#24 do_compile (argc=13, argv=0x7fffffffdfb8) at ../../gcc/toplev.c:1900
#25 toplev_main (argc=13, argv=0x7fffffffdfb8) at ../../gcc/toplev.c:1963
#26 0x00007ffff7874c4d in __libc_start_main (main=<value optimized out>,
argc=<value optimized out>, ubp_av=<value optimized out>, init=<value optimized
out>, 
    fini=<value optimized out>, rtld_fini=<value optimized out>,
stack_end=0x7fffffffdfa8) at libc-start.c:226
#27 0x000000000049fc05 in _start ()
(gdb)


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

* [Bug fortran/52679] ICE in gfortran 4.6.3, x86_64
  2012-03-22 22:18 [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64 adrian at llnl dot gov
@ 2012-04-03 14:26 ` burnus at gcc dot gnu.org
  2012-04-03 14:28 ` [Bug fortran/52679] [4.6 Regression] " burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-04-03 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #26962|application/octet-stream    |text/plain
          mime type|                            |

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-03 14:26:03 UTC ---
Comment on attachment 26962
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26962
reduced test case

Hmm, again one of those test cases, which only fails with GCC 4.6. It works
with GCC 4.5 and with GCC 4.7 and 4.8.


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

* [Bug fortran/52679] [4.6 Regression] ICE in gfortran 4.6.3, x86_64
  2012-03-22 22:18 [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64 adrian at llnl dot gov
  2012-04-03 14:26 ` [Bug fortran/52679] " burnus at gcc dot gnu.org
@ 2012-04-03 14:28 ` burnus at gcc dot gnu.org
  2012-04-03 14:34 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-04-03 14:28 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |burnus at gcc dot gnu.org
      Known to work|                            |4.5.3, 4.7.1, 4.8.0
   Target Milestone|---                         |4.6.4
            Summary|ICE in gfortran 4.6.3,      |[4.6 Regression] ICE in
                   |x86_64                      |gfortran 4.6.3, x86_64
      Known to fail|                            |4.6.3


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

* [Bug fortran/52679] [4.6 Regression] ICE in gfortran 4.6.3, x86_64
  2012-03-22 22:18 [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64 adrian at llnl dot gov
  2012-04-03 14:26 ` [Bug fortran/52679] " burnus at gcc dot gnu.org
  2012-04-03 14:28 ` [Bug fortran/52679] [4.6 Regression] " burnus at gcc dot gnu.org
@ 2012-04-03 14:34 ` burnus at gcc dot gnu.org
  2012-04-09 14:44 ` janus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-04-03 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-04-03
     Ever Confirmed|0                           |1

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-03 14:32:31 UTC ---
Note that contrary to PR 52622, I do not see failures with 4.5/4.7/4.8 in
valgrind, i.e. it seems to be a 4.6-only issue. One thus could consider
bisecting to find the commit which causes (4.5->4.6) or fixes (4.6->4.7) the
problem.


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

* [Bug fortran/52679] [4.6 Regression] ICE in gfortran 4.6.3, x86_64
  2012-03-22 22:18 [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64 adrian at llnl dot gov
                   ` (2 preceding siblings ...)
  2012-04-03 14:34 ` burnus at gcc dot gnu.org
@ 2012-04-09 14:44 ` janus at gcc dot gnu.org
  2012-11-24 14:09 ` janus at gcc dot gnu.org
  2012-11-24 14:13 ` janus at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu.org @ 2012-04-09 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal


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

* [Bug fortran/52679] [4.6 Regression] ICE in gfortran 4.6.3, x86_64
  2012-03-22 22:18 [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64 adrian at llnl dot gov
                   ` (3 preceding siblings ...)
  2012-04-09 14:44 ` janus at gcc dot gnu.org
@ 2012-11-24 14:09 ` janus at gcc dot gnu.org
  2012-11-24 14:13 ` janus at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu.org @ 2012-11-24 14:09 UTC (permalink / raw)
  To: gcc-bugs


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu.org

--- Comment #3 from janus at gcc dot gnu.org 2012-11-24 14:08:58 UTC ---
Further reduced test case, based on comment 1:

module Args_Basic_type_F03
  use, intrinsic :: iso_c_binding
  type Args_Basic_t
    type(c_ptr) :: d_ior = c_null_ptr
  end type
contains
  subroutine cache_epv_s(self)
    class(Args_Basic_t) :: self
  end subroutine
end module

  use Args_Basic_type_F03
  type, extends(Args_Basic_t) :: Args_Basic_impl_t
  end type
  type(Args_Basic_impl_t) :: obj
  call cache_epv_s(obj)
contains
  real function passeverywherechar_impl(self)
    type(Args_Basic_impl_t) :: self
  end function
end


This still ICEs with:

gcc version 4.6.4 20121124 (prerelease) [gcc-4_6-branch revision 193777] (GCC)


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

* [Bug fortran/52679] [4.6 Regression] ICE in gfortran 4.6.3, x86_64
  2012-03-22 22:18 [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64 adrian at llnl dot gov
                   ` (4 preceding siblings ...)
  2012-11-24 14:09 ` janus at gcc dot gnu.org
@ 2012-11-24 14:13 ` janus at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu.org @ 2012-11-24 14:13 UTC (permalink / raw)
  To: gcc-bugs


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

janus at gcc dot gnu.org changed:

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

--- Comment #4 from janus at gcc dot gnu.org 2012-11-24 14:12:47 UTC ---
I'm sure this is a duplicate of PR51520. Both have the same valgrind backtrace
and the test cases are very similar (both include a C_NULL_PTR initialization
and a CLASS variable).

*** This bug has been marked as a duplicate of bug 51520 ***


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

end of thread, other threads:[~2012-11-24 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 22:18 [Bug fortran/52679] New: ICE in gfortran 4.6.3, x86_64 adrian at llnl dot gov
2012-04-03 14:26 ` [Bug fortran/52679] " burnus at gcc dot gnu.org
2012-04-03 14:28 ` [Bug fortran/52679] [4.6 Regression] " burnus at gcc dot gnu.org
2012-04-03 14:34 ` burnus at gcc dot gnu.org
2012-04-09 14:44 ` janus at gcc dot gnu.org
2012-11-24 14:09 ` janus at gcc dot gnu.org
2012-11-24 14:13 ` janus 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).