public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/42744]  New: SIGSEGV at libgfortran/io/format.c:111
@ 2010-01-14 12:32 manfred99 at gmx dot ch
  2010-01-14 12:42 ` [Bug libfortran/42744] " manfred99 at gmx dot ch
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: manfred99 at gmx dot ch @ 2010-01-14 12:32 UTC (permalink / raw)
  To: gcc-bugs

In a larger program of mine, I got a SIGSEGV when printing

      WRITE(*,fmtstr)
     &           dat(1),"-",dat(2),"-",dat(3),
     &           datedelim,dat(4),":",dat(5),
     &           (delim,bufarr(pindx),pindx=1,anzarg2)

with gfortran 4.5 (latest snapshot). Using gfortran 4.3.5 the code runs fine.
Unfortunately, I can not reproduce the crash in a standalone program.

In the above print statement, fmtstr is rather large (~550chars).

Here is the gdb output:

Program received signal SIGSEGV, Segmentation fault.
reset_node (fn=0xc) at
../../../gfortran-source/gcc-4.5-20100107/libgfortran/io/format.c:111
111       if (fn->format != FMT_LPAREN)
(gdb) where
#0  reset_node (fn=0xc) at
../../../gfortran-source/gcc-4.5-20100107/libgfortran/io/format.c:111
#1  0x0000000000423b30 in reset_fnode_counters ()
    at ../../../gfortran-source/gcc-4.5-20100107/libgfortran/io/format.c:134
#2  parse_format () at
../../../gfortran-source/gcc-4.5-20100107/libgfortran/io/format.c:1233
#3  0x0000000000418208 in data_transfer_init (dtp=0x7ffffffead80, read_flag=0)
    at ../../../gfortran-source/gcc-4.5-20100107/libgfortran/io/transfer.c:2182
#4  0x000000000040ba86 in writevals (startjul=<value optimized out>,
endjul=<value optimized out>,
    reqts=<value optimized out>, basets=<value optimized out>,
use_monthtu=<value optimized out>,
    station=<value optimized out>, param=<value optimized out>,
aggrtypes=<value optimized out>,
    parfmt2=<value optimized out>, valarr2=<value optimized out>,
datefmt=<value optimized out>,
    delim=<value optimized out>, missing=<value optimized out>, anzarg2=<value
optimized out>,
    anzval=<value optimized out>, toffset=<value optimized out>, qualarr=<value
optimized out>,
    wantqf=<value optimized out>, _station=<value optimized out>, _param=<value
optimized out>,
    _aggrtypes=<value optimized out>, _parfmt2=<value optimized out>,
    _delim=<value optimized out>, _missing=<value optimized out>) at
extractdata.f:1464
#5  0x0000000000407818 in extractdata () at extractdata.f:58
#6  0x0000000000407906 in main (argc=<value optimized out>, argv=<value
optimized out>)
    at extractdata.f:1179
#7  0x000000000042b406 in __libc_start_main (main=<value optimized out>,
    argc=<value optimized out>, ubp_av=<value optimized out>, init=0x42b8b0
<__libc_csu_init>,
    fini=0x42b870 <__libc_csu_fini>, rtld_fini=0, stack_end=0x7fffffffdf98) at
libc-start.c:220
#8  0x0000000000400209 in _start () at ../sysdeps/x86_64/elf/start.S:113
(gdb) list
106       fnode *f;
107
108       fn->count = 0;
109       fn->current = NULL;
110
111       if (fn->format != FMT_LPAREN)
112         return;
113
114       for (f = fn->u.child; f; f = f->next)
115         {


Hopefully this gives already some clues. Otherwise please tell me 
how to debug further.


-- 
           Summary: SIGSEGV at libgfortran/io/format.c:111
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: manfred99 at gmx dot ch


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


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

* [Bug libfortran/42744] SIGSEGV at libgfortran/io/format.c:111
  2010-01-14 12:32 [Bug libfortran/42744] New: SIGSEGV at libgfortran/io/format.c:111 manfred99 at gmx dot ch
@ 2010-01-14 12:42 ` manfred99 at gmx dot ch
  2010-01-14 12:44 ` manfred99 at gmx dot ch
  2010-01-14 13:00 ` manfred99 at gmx dot ch
  2 siblings, 0 replies; 4+ messages in thread
From: manfred99 at gmx dot ch @ 2010-01-14 12:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from manfred99 at gmx dot ch  2010-01-14 12:42 -------
Created an attachment (id=19596)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19596&action=view)
test case


-- 


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


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

* [Bug libfortran/42744] SIGSEGV at libgfortran/io/format.c:111
  2010-01-14 12:32 [Bug libfortran/42744] New: SIGSEGV at libgfortran/io/format.c:111 manfred99 at gmx dot ch
  2010-01-14 12:42 ` [Bug libfortran/42744] " manfred99 at gmx dot ch
@ 2010-01-14 12:44 ` manfred99 at gmx dot ch
  2010-01-14 13:00 ` manfred99 at gmx dot ch
  2 siblings, 0 replies; 4+ messages in thread
From: manfred99 at gmx dot ch @ 2010-01-14 12:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from manfred99 at gmx dot ch  2010-01-14 12:43 -------
This write statement is called in a loop, and it crashes at the
second iteration.
I did first a test case with only this write statement, and it
works OK.
Then, I put a loop around it, and I catched it!

So the attached test case crashes for me with

# ./writebug
2009-10-31 03:00          2.8          7.8          7.3          7.6         
7.1         -0.2          2.6          7.3          7.6          7.9         
8.2          2.5          7.0          8.0          7.5          6.6         
7.8          5.7          9.4          7.3         -0.6          5.2         
7.7          8.5          8.8          4.7          7.7          7.7         
7.4          7.4          1.2          5.9          2.6          2.5         
8.0          7.1          7.2          8.8          3.9            ?         
3.0          2.2          7.3          3.1          1.7         -6.3         
5.4          6.3          6.2         -4.5          0.2          4.5         
0.3          6.0          9.8          2.9         12.0         11.0        
12.7         11.1          0.0          3.7          3.0         -0.9         
2.2         -0.4          0.0         -4.6         -6.7          1.8        
-0.8            ?            ?          4.3

Program received signal 11 (SIGSEGV): Segmentation fault.

Backtrace for this error:
  + /lib64/libc.so.6 [0x7f0d7ee7b560]
  + in the main program
    from file writebug.f
  + /lib64/libc.so.6(__libc_start_main+0xfd) [0x7f0d7ee67a7d]


-- 


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


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

* [Bug libfortran/42744] SIGSEGV at libgfortran/io/format.c:111
  2010-01-14 12:32 [Bug libfortran/42744] New: SIGSEGV at libgfortran/io/format.c:111 manfred99 at gmx dot ch
  2010-01-14 12:42 ` [Bug libfortran/42744] " manfred99 at gmx dot ch
  2010-01-14 12:44 ` manfred99 at gmx dot ch
@ 2010-01-14 13:00 ` manfred99 at gmx dot ch
  2 siblings, 0 replies; 4+ messages in thread
From: manfred99 at gmx dot ch @ 2010-01-14 13:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from manfred99 at gmx dot ch  2010-01-14 12:59 -------
Sorry, I made a mess.

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


-- 

manfred99 at gmx dot ch changed:

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


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


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

end of thread, other threads:[~2010-01-14 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-14 12:32 [Bug libfortran/42744] New: SIGSEGV at libgfortran/io/format.c:111 manfred99 at gmx dot ch
2010-01-14 12:42 ` [Bug libfortran/42744] " manfred99 at gmx dot ch
2010-01-14 12:44 ` manfred99 at gmx dot ch
2010-01-14 13:00 ` manfred99 at gmx dot ch

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