From: SourceForge.net <no...@so...> - 2009-04-24 05:09:52
|
Bugs item #2778601, was opened at 2009-04-22 15:23 Message generated for change (Comment added) made by walterpachl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=2778601&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Walter Pachl (walterpachl) Assigned to: Nobody/Anonymous (nobody) Summary: Problem with linein Initial Comment: bug4.rex shows wrong data in the second loop ---------------------------------------------------------------------- >Comment By: Walter Pachl (walterpachl) Date: 2009-04-24 07:09 Message: thanks for the support when it was Rick vs. Walter just like in them good old times :-) Good luck Walter ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-24 01:56 Message: I still can't get this to fail here, using either of these versions. Guess what, you guys win the lottery, you get to debug this :-). If I could recreate this, I'd try using the simpler program and single step through the second call to readVariableLine() in StreamNative.cpp. I really suspect you're going to find though that the bad data comes from a call to _read(), which is the C library routine. ---------------------------------------------------------------------- Comment By: Mark Miesfeld (miesfeld) Date: 2009-04-24 01:46 Message: Rick, I can reproduce this also. I'm attaching a zip file that has all you need to reproduce it. Unzip it somewhere, cd into test, and run the Rexx program. C:\temp>unzip bug4_test.zip C:\temp>cd test C:\temp\test>bug4.rex The corrupt output goes into bug4.txt ---------------------------------------------------------------------- Comment By: jfaucher (jfaucher) Date: 2009-04-24 01:29 Message: I can reproduce the problem of Walter using the build of revision 4484, compiled with VC2008 express. I changed slightly the script to use echo instead of dir. When the second echo is longer than the first one, no problem. When shorter, the line read is corrupted : loop1 hello hello loop2 ÍÍÍÍÍÍÍÍÍÍÍÍÍhello hell If I don't use the same filename for dir1 and dir2, no problem. ==================================== oid='bug4_out.txt'; 'erase' oid dir1='bug4_dir1.txt' dir2='bug4_dir1.txt' 'echo hello hello>' dir1 Do i=1 By 1 While lines(dir1)>0 l=linein(dir1) If i<=10 Then Call o 'loop1' l End Call lineout dir1 'echo hello hell>' dir2 Do i=1 By 1 While lines(dir2)>0 l=linein(dir2) If i<=10 Then Call o 'loop2' l End Call lineout dir2 Exit o: Return lineout(oid,arg(1)) ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-23 23:08 Message: 1) sorry for breaking the netiquette by sending a private mail :-) (to Rick) 2) It looks to me like Rony could reproduce the problem 3) If I can be of any further help, please let me know. 4) Will the bug be assigned to somebody? (I KNOW that Rick invested some time) Good Night Walter ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-23 17:23 Message: Sorry Rick. Redirecting the Type-Output shows what should be in dir.txt Volume in Laufwerk B: hat keine Bezeichnung. Volumeseriennummer: 0000-0000 Verzeichnis von b:\bb 23.04.2009 16:44 <DIR> . 23.04.2009 16:44 <DIR> .. 21.04.2009 12:24 7 file2.txt 1 Datei(en) 7 Bytes 2 Verzeichnis(se), 1.449.984 Bytes frei And this is identical on the new Rexx! ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-23 17:19 Message: Walter, I want to fix this problem, but you have to work with me here. I see no problem at all when I run your program on my system, the output is exactly what I would expect it to be. My last post, I asked you two very specific questions, but you only answered the first one. The second question is the information I need to try to narrow down where this might be failing. I want to see the full output from a failing test, including the output from typing out the file before starting loop 2. That is the information I want, no more, no less. Once I have that, then I can probably more to more specific theories on how to debug this, but first I need to have the clearest picture possible of where this might be failing. And so far, you've not been doing a very good job of providing me with the information I'm asking for. ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-23 17:13 Message: EVERY TIME with bug4, bug4a, bug4b The correct output as produced by the old Rexx you see in my previous update. (I had to change a: to b: here because that's the way this computer sees my diskette) Have you tried to run BUG4 and can you send me the output you get? All you need is a little directory and specify it for the second 'dir' No I did not run the program 10000 times but never saw a correct output from this! As I said: First observation was with a complex program and I tried to find MY bug first. I asked Mark Miesfeld to reproduce but never heard from him :-( ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-23 17:05 Message: And you're still not answer the questions I'm asking. Ok, let's try this again. 1) Does this fail EVERY time you run it, or is it intermitent? 2) Please show the result of running this using both 4.0 and the older version, including the type command that displays the file contents before loop2. Once you have provided me with that, I might have a better idea of what sort of problem I'm looking at. ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-23 16:59 Message: I have no better picture Here is the correct output (as seen by my good old OoRexx: (and now the paste DID work :-) Version REXX-ooRexx_3.1(MT) 6.01 20 Apr 2007 loop1 Volume in Laufwerk B: hat keine Bezeichnung. loop1 Volumeseriennummer: 0000-0000 loop1 loop1 Verzeichnis von B:\ loop1 loop1 21.04.2009 12:23 <DIR> aa loop1 21.04.2009 12:24 7 file1.txt loop1 22.04.2009 12:06 404 bug4.rex loop1 22.04.2009 12:03 824 bug4.txt loop1 23.04.2009 16:42 405 bug4a.rex loop2 Volume in Laufwerk B: hat keine Bezeichnung. loop2 Volumeseriennummer: 0000-0000 loop2 loop2 Verzeichnis von b:\bb loop2 loop2 23.04.2009 16:44 <DIR> . loop2 23.04.2009 16:44 <DIR> .. loop2 21.04.2009 12:24 7 file2.txt loop2 1 Datei(en) 7 Bytes loop2 2 Verzeichnis(se), 1.449.984 Bytes frei ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-23 16:51 Message: And the information about the correct result from that second dir command is not something you've provided to me. I cannot see what is happening on your system, so I dependent on you providing me with a good picture of what's going on to diagnose the problem. ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-23 16:48 Message: The second loop should show what the 'type' dir shows correctly: The correct output, i.e., the directory listing created by the 'dir' command for the subdirectory aa (or bb in BUG4B) ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-23 16:41 Message: Still trying to nail down the what the actual failure symptoms are here. The information from the second loop looks like it is the same as the first loop, with some characters munged. What SHOULD the result be? Is the problem the bad characters, or is all of the data bad? ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-23 16:37 Message: I changed everything and the problem persists. Yes, the dir command fills dir.txt correctly (as the type dir.txt shows. Sending bug4b.rex & .txt offline ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-23 16:22 Message: A couple of additional question. The output looks like the file from the first pass with some characters at the beginning messed up. What is the content of the file it is reading from in the second loop? Is the information in that file correct? ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-23 16:19 Message: I saw the output you attached to the report initially, and I believe you're seeing this, but so far, I've not been able to recreate this, which is making it difficult to debug. I'm just looking for more specific to help me narrow the search. Is this reproducible every time your run this program? Is the output always the same? Does it change if you use a different directories? Any additional information you can provide will help at this point. ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-23 15:56 Message: I installed the latest Beta on my alternate PC (Windows XP Professional running there) and the problem is reproducable. Actually it all started with a rather complicated program that ran havoc and as a good citizen I reproduced the problem with a small program written for that purpose. Did you create that second directory I want to show in the second loop? The Output I see is --- hmm cut and paste don't work here -- I send you the bug4.txt separately Walter ---------------------------------------------------------------------- Comment By: Rick McGuire (bigrixx) Date: 2009-04-22 17:14 Message: Is this consistenly reproducable for you? I'm not seeing the problem here. Are you running with the latest beta refresh? You're obviously using windows, but which version are you running on. ---------------------------------------------------------------------- Comment By: Walter Pachl (walterpachl) Date: 2009-04-22 15:24 Message: Here's bug4.rex: /* REXX */ oid='c:\bug4.txt'; 'erase' oid Parse Version v Call o 'Version' v dir='c:\dir.txt' 'dir *.* >' dir Do i=1 By 1 While lines(dir)>0 l=linein(dir) If i<=10 Then Call o 'loop1' l End Call lineout dir 'dir c:\aa\*.* >' dir 'type' dir Do i=1 By 1 While lines(dir)>0 l=linein(dir) If i<=10 Then Call o 'loop2' l End Call lineout dir Exit o: Return lineout(oid,arg(1)) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=2778601&group_id=119701 |