#314 ADDRESS ... WITH INPUT STEM fails with >4k data

closed-duplicate
5
2012-10-16
2010-07-30
Anonymous
No

i.0 = 1
i.1 = Copies('*',5000)
Address SYSTEM 'somecommand' with input stem i.

From time to time, only 4096 bytes are received (this is the size of IObuf in shell.c). It is easiest to reproduce the problem by enclosing the Address SYSTEM command in a DO 10 loop, eventually (4-5 iterations) it will fail whereas from the keyboard it tends to succeed most of the time - this is a timing-dependent problem.

This is because EAGAIN is not handled properly in write_buffered() when a flush is requested (the write is not retried and the last chunk of data is basically discarded). The problem may be broader than that, I am not familiar with the source code. I expect that this happens on every operating system, but I have only tried on Windows. If the operating system buffers pipe writes, it may take more than 4096 bytes to trigger the problem.

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-07-30

    Program to reproduce the bug (requires bug2)

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-07-30

    Second program required to reproduce the bug

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2010-07-30

    I have now tried reproducing the problem on Solaris - to no avail. This seems to happen only on Windows, even if I increase the size of the stem.

    On Windows, every execution is incorrect with a 50k stem. Either 4096 or 8192 bytes are passed but never 50k.

    This is with 3.5 (sorry that I forgot to mention that earlier). I have a copy of 3.2 for Windows and it does not have the bug.

     
  • Bruce U

    Bruce U - 2010-11-25

    This bug was originally reported as problem ID 1887965 in 2008-02-06 - 'BUG with "address system with stem"' - in Regina 3.4.

    The error did not occur in Regina 3.3.

     
  • Mark Hessling

    Mark Hessling - 2012-10-14
    • labels: --> Interpreter
    • assigned_to: nobody --> rexx
    • status: open --> pending-duplicate
     
  • Mark Hessling

    Mark Hessling - 2012-10-14

    Duplicate of 3400513 which will have a solution in v3.7

     
  • Mark Hessling

    Mark Hessling - 2012-10-16
    • status: pending-duplicate --> closed-duplicate
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks