Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001950 [Quercus] minor always 08-20-07 02:01 08-20-07 12:20
Reporter ntherning View Status public  
Assigned To nam
Priority normal Resolution fixed  
Status closed   Product Version 3.1.2
Summary 0001950: Bug in FileInputOutput.isEOF()
Description I tried to install drupal 5.2. There's a while-loop in includes/install.inc around line 181 which never terminates. It looks something like this:

  if ($fp = @fopen($settings_file, 'r+')) {
    // Step line by line through settings.php.
    while (!feof($fp)) {
      $line = fgets($fp);
      ...
    }
  }

Apparently feof($fp) always returns false even if the file has been consumed. I found an issue with the isEOF() methid in FileInputOutput. The line

return _stream.getFilePointer() == _stream.getLength() - 1;

should be

return _stream.getFilePointer() == _stream.getLength();

since filePointer will point at the position right after the last byte in the stream when the file has been consumed. After applying this fix drupal installed nicely without any other problems.
Additional Information I'm using quercus from svn revision 2959. The com.caucho.(util|config|vfs) sources are from the resin 3.1.2 sources.

More system info:
apache-tomcat-5.5.23
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
Ubuntu 7.04
Linux 2.6.20-15-generic 0000002 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux
Attached Files

- Relationships

- Notes
(0002204)
nam
08-20-07 12:20

php/1618

fixed for streams opened with 'r+' and etc. option
 

- Issue History
Date Modified Username Field Change
08-20-07 02:01 ntherning New Issue
08-20-07 11:41 nam Status new => assigned
08-20-07 11:41 nam Assigned To  => nam
08-20-07 12:20 nam Status assigned => closed
08-20-07 12:20 nam Note Added: 0002204
08-20-07 12:20 nam Resolution open => fixed
08-20-07 12:20 nam Fixed in Version  => 3.1.3


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker