public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29392]  New: Segfault on data character initialization
@ 2006-10-08 21:17 fxcoudert at gcc dot gnu dot org
  2006-10-08 21:17 ` [Bug fortran/29392] " fxcoudert at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-10-08 21:17 UTC (permalink / raw)
  To: gcc-bugs

$ cat a9.f90 
  character(LEN=2) :: a(2) 
  data ((a(I)(k:k),I=1,2),k=1,2) /4*'a'/ 
  IF (ANY(a.NE."aa")) CALL ABORT() 
  END 
$ gfortran a9.f90
 In file a9.f90:2

  data ((a(I)(k:k),I=1,2),k=1,2) /4*'a'/ 
                                   1
Warning: initialization string truncated to match variable at (1)
a9.f90:0: internal compiler error: Segmentation fault


The segfault happens at:

    at ../../trunk/gcc/fortran/data.c:194
194       memcpy (&dest[start], rvalue->value.character.string, len);

#0  create_character_intializer (init=0xce48e0, ts=Variable "ts" is not
available.
)
    at ../../trunk/gcc/fortran/data.c:194
#1  0x000000000040e511 in gfc_assign_data_value (lvalue=0xce3240, 
    rvalue=0xce3e80, index=0x7fbfffeaa0) at ../../trunk/gcc/fortran/data.c:323
#2  0x0000000000448482 in traverse_data_var (var=0xcb1470, where=0xcb0f50)
    at ../../trunk/gcc/fortran/resolve.c:6094
#3  0x0000000000448293 in traverse_data_var (var=0xcb11b0, where=0xcb0f50)
    at ../../trunk/gcc/fortran/resolve.c:6146
#4  0x0000000000448293 in traverse_data_var (var=0xcb09f0, where=0xcb0f50)
    at ../../trunk/gcc/fortran/resolve.c:6146
#5  0x0000000000448e1f in resolve_types (ns=0xce2330)
    at ../../trunk/gcc/fortran/resolve.c:6240
#6  0x000000000044b75d in gfc_resolve (ns=0xce2330)
    at ../../trunk/gcc/fortran/resolve.c:6918
#7  0x0000000000440a68 in gfc_parse_file ()
    at ../../trunk/gcc/fortran/parse.c:3212

There, we have:

(gdb) p rvalue->value.character.string
$4 = 0xcb0b30 "a"
(gdb) p len
$5 = -13513439
(gdb) p dest
$6 = 0xcb0450 "  "
(gdb) p start
$7 = 13513439


-- 
           Summary: Segfault on data character initialization
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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


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

end of thread, other threads:[~2006-11-10 21:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-08 21:17 [Bug fortran/29392] New: Segfault on data character initialization fxcoudert at gcc dot gnu dot org
2006-10-08 21:17 ` [Bug fortran/29392] " fxcoudert at gcc dot gnu dot org
2006-10-16 14:06 ` pault at gcc dot gnu dot org
2006-10-16 15:25 ` patchapp at dberlin dot org
2006-10-16 22:30 ` pault at gcc dot gnu dot org
2006-10-17 11:31 ` pault at gcc dot gnu dot org
2006-11-10 21:53 ` pault at gcc dot gnu dot 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).