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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #19793: GSFileHandleWin32 readInBackgroundAndNotify problems on multiple pipes

Submitted by:  Matthew Jimenez <mjimenez>
Submitted on:  Thu 03 May 2007 09:15:26 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission 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>
Project 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>
Project 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>

 

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
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by mjimenez (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 logged-in users can vote.

     

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

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 10 Jul 2007 05:28:51 AM UTCCaSStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Tue 05 Jun 2007 10:59:53 PM UTCmjimenezAttached File-=>Added PipeTest.tar.gz, #12964
    Sun 03 Jun 2007 07:32:53 AM UTCCaSStatusNone=>Need Info
    Mon 07 May 2007 02:11:18 PM UTCmjimenezAttached File-=>Added GSFileHandleWin32.diff, #12709
    Thu 03 May 2007 09:15:26 PM UTCmjimenezCarbon-Copy-=>Added mjimenez

    Back to the top


    Powered by Savane 3.1-cleanup1