bugGNU Octave - Bugs: bug #49864, fscanf incomplete read with popen...

 
 

bug #49864: fscanf incomplete read with popen (Windows)

Submitted by:  Denis Sbragion <dsbragion>
Submitted on:  Fri 16 Dec 2016 02:37:27 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: ConfirmedAssigned to: None
Originator Name: fscanf, popenOpen/Closed: Open
Release: 4.2.0Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 16 Dec 2016 09:25:48 PM UTC, comment #1:

popen() just doesn't work very well on Windows. I tried the following:

I tried reading each line at a time and I get wild results. Instead of the numbers 1234 and 5678, I get truncations such as "34,8" and "5678,1".

I've marked this as a regression since according to your tests it worked in 4.0.3, but I don't know what is going on here.

Rik <rik5>
Project Administrator
Fri 16 Dec 2016 02:37:27 PM UTC, original submission:

Hello,

the attacched script and test file could be used to reproduce the bug. The script simply performs the same file read both through a standard file and a popen pipe:

The two sections of the script of course should provide the same output. "testfile.txt" is just a sequence of comma separated numbers, nothing special.

With Octave 4.0.3 the result is correct:

With Octave 4.2.0 I get the following output:

The error message at the top translated means "The process tried to write to a non existant pipe".

It looks like fscanf stops reading before the "type" command finishes to write its output, so the following pclose closes the pipe and then the error.

Thanks in advance for your attention.

Bye,

Denis Sbragion

Denis Sbragion <dsbragion>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #39251:  fscanfbug.m added by dsbragion (144B - text/x-objcsrc - Test script and sample input file)
file #39252:  testfile.txt added by dsbragion (17KiB - text/plain - Test script and sample input file)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by dsbragion (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 16 Dec 2016 09:25:48 PM UTCrik5Item GroupIncorrect Result=>Regression
      StatusNone=>Confirmed
      Summaryfscanf incomplete read with popen=>fscanf incomplete read with popen (Windows)
    Fri 16 Dec 2016 02:37:27 PM UTCdsbragionAttached File-=>Added fscanfbug.m, #39251
      Attached File-=>Added testfile.txt, #39252

    Back to the top


    Powered by Savane 3.1-cleanup1