View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001393 | JEDI VCL | 00 JVCL Components | public | 2004-02-29 12:29 | 2005-08-10 01:16 |
Reporter | anonymous | Assigned To | remkobonte | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | 3.10 | |||
Summary | 0001393: TJvCreateProcess cannot capture all output | ||||
Description | To 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) | ||||
Tags | No tags attached. | ||||
has duplicate | 0002256 | resolved | remkobonte | TJvCreateProcess.ConsoleOutput is empty |
|
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. |
|
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 |
|
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. |
|
I cannot reproduce it with JVCL3;Delphi7;Windows XP. Maybe you did use Write instead of WriteLn? edited on: 03-01-04 03:19 |
|
According to the example in "Description", he used writeln |
|
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. |
|
Do you have windows 95,98,Me? |
|
No, I use win2000 SP4 |
|
Delphi7? JVCL3? Extreme fast/slow computer? Just guessing, because I can't reproduce it <g> Can someone else reproduce it? |
|
Yes Delphi7, JVCL3 and a Athlon 2000 + Win2k SP4 I can reproduce it in any fast finishing executable |
|
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 [..] |
|
Remko, have you updated this in CVS? Can we close this report? |
|
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. |
|
Fixed in rev 1.16 |
|
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 ...." |
|
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) |
|
Remko, any news ? |
|
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. |
|
Ok then I'm marking it as resolved. |
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 |
|
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 |
|
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 |
|
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 |
|
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 |