View Issue Details

IDProjectCategoryView StatusLast Update
0001393JEDI VCL00 JVCL Componentspublic2005-08-10 01:16
ReporteranonymousAssigned Toremkobonte 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version3.10 
Summary0001393: TJvCreateProcess cannot capture all output
DescriptionTo reproduce this error
1) compile a simple delphi console app. only with
  "for i:= 0 to 100 do writeln('not captured');" statement

2) Create a new application and drop a jvCreateProcess on form, drop a memo and Set the OnRead event to update this memo and drop a button to start process.

3) set commandline of jvCreateProcess to that simple console app also include coRedirect flag to ConsoleOptions
  
4) now run it and get no output.
  
5) I was able get some part of the output by
   1) setting cfSuspended in CreationFlags to true
   2) Change Button's click handler to
        jvprocess.run;
        Sleep(100);
        ResumeThread(JvProcess.ProcessInfo.hThread);
   3) Now I get partial (amount changes randomly each ime)
   
  
TagsNo tags attached.

Relationships

has duplicate 0002256 resolvedremkobonte TJvCreateProcess.ConsoleOutput is empty 

Activities

AHUser

2004-02-29 12:52

developer   ~0003122

Till this is fixed you meight have a look at Install\JVCL3Install\CapExec.pas

Because I'm writing a new installer at the moment, someone else may fix this bug.

anonymous

2004-02-29 22:54

viewer   ~0003126

Ok, I got a quick and dirty fix but I dont think trusting Sleep func. is good

  1) setting cfSuspended in CreationFlags to true
  2) Change Button's click handler to
        jvprocess.run;
        ResumeThread(JvProcess.ProcessInfo.hThread);
        Sleep(100);
  3) now I get all output

user72

2004-03-01 01:45

  ~0003128

Is the ResumeThread/Sleep fix a generic solution or is it specific to your use of it or can it b eused only with cfSuspended? If it is a generic solution, it should be added to TJvCreateProcess directly, IMO.

remkobonte

2004-03-01 03:17

developer   ~0003129

Last edited: 2004-03-01 03:19

I cannot reproduce it with JVCL3;Delphi7;Windows XP.

Maybe you did use Write instead of WriteLn?

edited on: 03-01-04 03:19

user72

2004-03-01 05:48

  ~0003131

According to the example in "Description", he used writeln

anonymous

2004-03-01 08:45

viewer   ~0003132

Yes I used WriteLn, also even if Write used, the unsent buffer will trigger OnRead before process termination.

And Peter, in my case "sleep(100)" was OK but that amount may change from user to user so I dont think it is agood idea, maybe I can study CapExec.pas and apply necessary changes to TJvCreateProcess at this weekend.

remkobonte

2004-03-01 09:56

developer   ~0003134

Do you have windows 95,98,Me?

anonymous

2004-03-01 10:42

viewer   ~0003137

No, I use win2000 SP4

remkobonte

2004-03-01 11:09

developer   ~0003139

Delphi7? JVCL3? Extreme fast/slow computer?

Just guessing, because I can't reproduce it <g>

Can someone else reproduce it?

utku karatas

2004-03-01 11:15

reporter   ~0003140

Yes Delphi7, JVCL3 and a Athlon 2000 + Win2k SP4
I can reproduce it in any fast finishing executable

remkobonte

2004-03-01 13:20

developer   ~0003144

Okay switch the creation code of the read thread and the wait thread in procedure TJvCreateProcess.Run. Thus it will be something like:

procedure TJvCreateProcess.Run;
[..]
   if DoRedirect then
    begin
      FReadThread := TJvReadThread.Create(LLocalHandles.Read, Handle);
      FReadThread.OnTerminate := ReadThreadOnTerminate;
      FReadThread.Resume;

      FWaitThread := TJvConsoleThread.Create(FProcessInfo.hProcess,
        LLocalHandles.Write);
      FWaitThread.OnTerminate := WaitThreadOnTerminate;
      FWaitThread.Resume;

      FState := psWaiting;
    end
[..]

user72

2004-04-02 10:58

  ~0003591

Remko, have you updated this in CVS? Can we close this report?

remkobonte

2004-04-04 13:45

developer   ~0003634

I've changed it a bit, but wasn't completely happy with it. I didn't close the report, so I would not forget to think about it <g>.

I'll close it this week.

remkobonte

2004-04-21 12:54

developer   ~0003977

Fixed in rev 1.16

anonymous

2005-06-26 03:59

viewer   ~0007492

Last edited: 2005-06-26 04:02

I still only get partial message in ELEEYE09.exe (I am using Jvcl v3.0 (JvCreateProcess.pas v1.26) Delphi 7 winxp sp1
http://home.i-cable.com/wu/ELEEYE09.zip (I enclosed the error picture)
(Please delete [^] in the url)

The reproduce procedure:
ucci
position startpos
go depth 7.

The partial message output of "go depth 7" are
Only to "Info depth 4 ...."

sum

2005-06-26 04:06

reporter   ~0007493

Last edited: 2005-06-26 14:43

1 I may delete the file in some day so that I attach to here
2 I forget to say that the program exit command: quit

edit:Now see attached file

2005-06-26 04:57

 

ELEEYE09.zip (58,972 bytes)

obones

2005-08-09 06:54

administrator   ~0007716

Remko, any news ?

remkobonte

2005-08-09 16:13

developer   ~0007753

I can reproduce the problem, but my guess is that the problem is in the ELEEYE09.exe.

I tried ELEEYE09.exe with three other programs that redirect the input and they all showed the same behaviour.

It seems that ELEEYE09.exe does not flush the output, so it locks up.

obones

2005-08-10 01:16

administrator   ~0007754

Ok then I'm marking it as resolved.

Issue History

Date Modified Username Field Change
2004-02-29 12:29 anonymous New Issue
2004-02-29 12:52 AHUser Note Added: 0003122
2004-02-29 22:54 anonymous Note Added: 0003126
2004-03-01 01:45 user72 Note Added: 0003128
2004-03-01 03:17 remkobonte Note Added: 0003129
2004-03-01 03:19 remkobonte Note Edited: 0003129
2004-03-01 05:48 user72 Note Added: 0003131
2004-03-01 08:45 anonymous Note Added: 0003132
2004-03-01 09:56 remkobonte Note Added: 0003134
2004-03-01 10:15 user72 Status new => feedback
2004-03-01 10:42 anonymous Note Added: 0003137
2004-03-01 11:09 remkobonte Note Added: 0003139
2004-03-01 11:15 utku karatas Note Added: 0003140
2004-03-01 13:20 remkobonte Note Added: 0003144
2004-04-02 10:58 user72 Note Added: 0003591
2004-04-04 13:45 remkobonte Note Added: 0003634
2004-04-21 12:54 remkobonte Status feedback => resolved
2004-04-21 12:54 remkobonte Resolution open => fixed
2004-04-21 12:54 remkobonte Assigned To => remkobonte
2004-04-21 12:54 remkobonte Note Added: 0003977
2004-10-21 11:11 remkobonte Relationship added has duplicate 0002256
2005-06-26 03:59 anonymous Status resolved => feedback
2005-06-26 03:59 anonymous Resolution fixed => reopened
2005-06-26 03:59 anonymous Note Added: 0007492
2005-06-26 04:02 anonymous Note Edited: 0007492
2005-06-26 04:06 sum Note Added: 0007493
2005-06-26 04:10 sum Note Edited: 0007493
2005-06-26 04:57 remkobonte File Added: ELEEYE09.zip
2005-06-26 14:42 sum Note Edited: 0007493
2005-06-26 14:43 sum Note Edited: 0007493
2005-08-09 06:54 obones Note Added: 0007716
2005-08-09 16:13 remkobonte Note Added: 0007753
2005-08-10 01:16 obones Status feedback => resolved
2005-08-10 01:16 obones Resolution reopened => fixed
2005-08-10 01:16 obones Note Added: 0007754