bugGNUstep - Bugs: bug #19793, GSFileHandleWin32...

Group
 
 

bug #19793: GSFileHandleWin32 readInBackgroundAndNotify problems on multiple pipes

Submitter:  Matthew Jimenez <mjimenez>
Submitted:  Thu 03 May 2007 09:15:26 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 10 Jul 2007 05:28:51 AM UTC, comment #6: 

Sorry ... I somehow failed to notice the testcase you added.
I've tried it out .. fixed the code in svn ... and tested the fix using your testcase.

Richard Frith-Macdonald <CaS>
Group Member
Mon 09 Jul 2007 03:09:19 PM UTC, comment #5: 

Ping. I haven't heard anything on this in a while. Do you need any more information?

Matthew Jimenez <mjimenez>
Tue 05 Jun 2007 10:59:53 PM UTC, comment #4: 

I've added a testcase for the issue.
It includes 2 targets: yammer & PipeTest

the yammer will simply "yammer" and "yack" until killed.
PipeTest will run yammer and pipe the output to stdout.

PipeTest on my GNUstep before the patch would not let the yammer "yammer" or "yack". I've not tested this against the current GNUstep release.

(file #12964)

Matthew Jimenez <mjimenez>
Mon 04 Jun 2007 01:53:28 PM UTC, comment #3: 

It did seem to fix the issue for me.
I'll see about getting you a test program soon.

Matthew Jimenez <mjimenez>
Sun 03 Jun 2007 07:32:53 AM UTC, comment #2: 

I can't see how the attached patch changes the operation of the code.
Are you sure it's correct?  Can you post a small test program demonstrating the problem?

Richard Frith-Macdonald <CaS>
Group Member
Mon 07 May 2007 02:14:50 PM UTC, comment #1: 

I've added a diff of the changes I needed to my copy of GNUstep to make this work.

Found that I could not change the instances of ET_TRIGGER to ET_HANDLE because additional code exists for cases where ET_HANDLE is used that we did not want here.

I've not attempted to check this against gnustep trunk.

Matthew Jimenez <mjimenez>
Thu 03 May 2007 09:15:26 PM UTC, original submission:  

GNUstep base: 1.12.0 SVN
OS: WinXP SP2
Compiler: Mingw gcc 3.4.2

This occurs on a subversion snapshot at some point after 1.12.0 release (sorry, I don't recall when). From a quick review of code in gnustep trunk, this bug appears to still exist.
 
I have some win32 code that calls CreatePipe twice and uses the results for standard out and standard error on CreateProcess.
The other end for each of the pipes are wrapped using NSFileHandle and call readInBackgroundAndNotify for first stdout then stderr.

During -[GSFileHandleWin32 watchReadDescriptionForModes:] the object adds itself as a watcher to the event loop, and the variable "event" is zero because we are using pipes instead of files or sockets, so it calls [l addEvent:0 type:ET_TRIGGER watcher:self forMode:....].

This appears to be a problem because for each event, type, & mode, there can only be one watcher. First stdout, then stderr.
The task will continuously read from stderr and never stdout.

I believe calling [l addEvent:descriptor type:ET_HANDLE watcher:self forMode:....] will fix the problem, but have not yet tested that. I will supply a patch file if it does work.

Matthew Jimenez <mjimenez>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #12964:  PipeTest.tar.gz added by mjimenez (3KiB - application/x-gzip - PipeTest & yammer to test the bug)
file #12709:  GSFileHandleWin32.diff added by mjimenez (3KiB - application/octet-stream - Tested fix for GSFileHandleWin32.m)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by mjimenez (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-07-10 CaS StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2007-06-05 mjimenez Attached File- Added PipeTest.tar.gz, #12964
    2007-06-03 CaS StatusNone Need Info
    2007-05-07 mjimenez Attached File- Added GSFileHandleWin32.diff, #12709
    2007-05-03 mjimenez Carbon-Copy- Added mjimenez

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code