whizard is hosted by Hepforge, IPPP Durham

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#152 closed defect (fixed)

WHIZARD ignores last line of input files

Reported by: sschmidt Owned by: ALL
Priority: P1 Milestone:
Component: interfaces Version: 2.0.0beta
Severity: normal Keywords: input file
Cc:

Description

The last line in an input file is always ignored. (All example files end with at least one blank line, so it doesn't make a difference there.) See the attached file for an example.

Attachments (1)

bug2.sin (360 bytes) - added by sschmidt 14 years ago.

Download all attachments as: .zip

Change History (14)

Changed 14 years ago by sschmidt

Attachment: bug2.sin added

comment:1 Changed 14 years ago by sschmidt

Component: configureinterfaces

comment:2 Changed 14 years ago by Juergen Reuter

Priority: P3P1

Confirmed by JR: if the last line contains the only integrate statement, WHIZARD does not integrate at all. Although that is a trivial one, it's a really nasty one. It can completely screw up the user. Ranking it high.

comment:3 Changed 14 years ago by Christian Speckner

I can't reproduce this with the current trunk and the current SVN gfortran, neither on ia32 nor on ia64. Therefore, this either is some nasty issue with incompatible runtime libraries (my bet) or some compiler issue (unlikely as Sebastian encounters this also with NAG).

comment:4 Changed 14 years ago by Juergen Reuter

I had the problem yesterday evening but I can't remember which computer it was. Probably the SuSe? Linux Quadcore, but I will recheck. The 32bit Debian doesn't show the problem today.

comment:5 Changed 14 years ago by Juergen Reuter

Milestone: v2.0finalv2.0-rc2

comment:6 Changed 14 years ago by sschmidt

I retested this on my own computer (SUSE 11.1, 64bit, compiled with gcc/gfortran rev 156365, whizard r1645) and here the last line is also ignored.

comment:7 Changed 14 years ago by Juergen Reuter

I also reproduced this behaviour on MAC OS X Snow Leopard 64 bit with gfortran.

comment:8 Changed 14 years ago by Christian Speckner

OK, my bad can reproduce it now - this happens if the input file doesn't contain a final LF (hex 0A), which vim seems to always add. I'll try to track this critter down.

comment:9 Changed 14 years ago by Christian Speckner

Resolution: fixed
Status: newclosed

Fixed in r1656. This was a nasty one: WHIZARD requires an end-of-record condition to process a line, but this only generated when a LF is encountered. If the last line lacks the LF, an EOF is generated instead by the runtime, making WHIZARD ignore the line. I've added an eof flag to the stream_t structure which allows stream_get_record to remember the EOF, return the string which has been read and return EOF on the next call. Again, WK might want to make sure that he is fine with the patch.

comment:10 Changed 14 years ago by Christian Speckner

Resolution: fixed
Status: closedreopened

Still broken for NAG.

comment:11 Changed 14 years ago by Christian Speckner

Resolution: fixed
Status: reopenedclosed

Fixed for NAG in r1657; this was a side-effect of WK's workaround in iso_varying_string.f90. On the broken compiler, we have no way of finding out how many characters were read before encountering the LF, so I changed GET_BUFFER_LEN to 1 in order to force char-by-char input. This works, but as I dislike the necessity to hack iso_varying_string.f90 this way, I would be very much in favour of reverting this file to its original state as soon as we can afford dropping support for the broken NAG versions.

comment:12 Changed 14 years ago by kilian

There's a discussion on comp.lang.fortran on this issue:

http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/0bf36466c2278c39#

comment:13 Changed 14 years ago by Juergen Reuter

Milestone: v2.0-rc2

Milestone v2.0-rc2 deleted

Note: See TracTickets for help on using tickets.