1 This file explains, usually via sample code, some bugs that exist in
2 this release of Regina. The smaller this file the better!
3 Outstanding bugs are first; fixed ones at the end of this file.
5 /*--------------------------------------------------------------------
6 * INTERPRET "return" does not work correctly. If a value is returned
7 * it does work correctly.
8 * Reported by: Paul G. Barnett
14 Say "should not get here!"
17 /*--------------------------------------------------------------------
18 * LINES() BIF on transient streams return 1 when really at EOF
19 * Run program below as:
20 * regina test.rex BUGS
22 * cat BUGS | regina test.rex
23 * Reported by: Mark Hessling
31 Do While(Lines(fn) > 0)
33 numlines = numlines + 1
35 Say numlines 'in file'
37 /*--------------------------------------------------------------------
38 * Regina appears to read complete data files into memory in some
39 * operations. More details to be specified.
46 /*--------------------------------------------------------------------
47 * Clauses in the Interpret command are not traced correctly.
48 * Reported by: Dennis Bareis
54 /*--------------------------------------------------------------------
55 * The Regina parser incorrectly parses the sample code below, and
56 * returns the following error:
57 * Error 14 running "/home/mark/Regina-0.08h/bug29512.rex", line 2: Incomplete DO/IF/SELECT"
58 * If the '?' is protected by parentheses, it works.
60 * Bug Number: 19991216-29512
64 If (?) > 0 Then say 'OK'
65 If ? > 0 Then say 'OK'
67 /*--------------------------------------------------------------------
68 * Following code still fails with syntax error.
69 * Reported by: Mark Hessling
70 * Bug Number: 20000319-63722
74 Call Fred'1234' /* syntax error */
76 /*--------------------------------------------------------------------
77 * TRACE R and TRACE I produce incorrect results in various
79 * Reported by: Various
85 /*--------------------------------------------------------------------
86 * Regina is inconsistent with the ANSI standard when it comes to
87 * treatment of whitespace in various circumstances.
88 * Reported by: Dennis Baeris
89 * Bug Number: 20000505-73993
97 if a = b then say 'incorrect'
98 else say 'ANSI correct'
100 if strip(a) == strip(b) then say 'ANSI correct'
103 /*--------------------------------------------------------------------
104 * Regina crashes with following code:
105 * Reported by: Mark Hessling
116 Return /* should return a value!! */
122 /*--------------------------------------------------------------------
123 * Regina does not trap conditions in externally called routines
124 * Reported by: Mark Hessling
138 /* a2.rex - must be in REGINA_MACROS */
149 ======================================================================
150 ============================= FIXED ==================================
151 ======================================================================
153 /*--------------------------------------------------------------------
154 * Subroutines cannot have leading numerics in their name.
155 * Reported by: Frank M. Ramaekers Jr.
157 * Fixed by: Mark Hessling
161 rc = 1000_my_proc( "value" )
164 1000_my_proc: Procedure
169 /*--------------------------------------------------------------------
170 * Calling CHAROUT with the newline character, '0a'x, would result in
171 * a CR and LF being output. This only happens under DOS, OS/2 and
173 * Reported by: Dennis Bareis
175 * Fixed by: Mark Hessling
179 Call charout "myfile", "Line 1" || newl
182 /*--------------------------------------------------------------------
183 * Line continuation character; ',' followed by CRLF in source file
184 * would give syntax error.
185 * Reported by: Florian Grosse-Coosmann
187 * Fixed by: Mark Hessling
190 Say 'Hello', /* line ends in CRLF pair */
194 /*--------------------------------------------------------------------
195 * The value of the last token parsed with PARSE contains incorrect
197 * Reported by: Dennis Bareis
199 * Fixed by: Florian Grosse-Coosmann
203 Parse Var a one two three
204 Say '<' || three || '>'
206 /*--------------------------------------------------------------------
207 * The value returned by CHARS BIF was incorrect especially after a
208 * LINEIN call. The result is the example following would never end.
209 * Reported by: Yuri Shemanin
211 * Fixed by: Yuri Shemanin
215 Do While Chars(f) <> 0
219 /*--------------------------------------------------------------------
220 * On some platforms, if operating system command redirection was
221 * done using >FIFO, and the current directory was not writeable by
222 * the user, the command would fail. The cause is that the tmpnam()
223 * C library function is broken on several compilers.
224 * Added workaround to use environment variables, TMP, TEMP or TMPDIR.
227 * Fixed by: Mark Hessling
231 /*--------------------------------------------------------------------
232 * On platforms that did not have a C library function, alloca()
233 * Regina would leak memory. This has now been fixed by inclusion
234 * of our own alloca() function if one doesn't exist.
235 * Reported by: Mark Hessling
237 * Fixed by: Mark Hessling
241 /*--------------------------------------------------------------------
242 * A bug in the Win95/98 command processor results in any call to
243 * an operating system command ALWAYS return 0, even though the
245 * This change attempts to circumvent this bug, but it can't in all
246 * circumstances. If the operating system command called is an
247 * executable file, and there is no output/input redirection, then
248 * the return code from the executable program will be returned. Any
249 * internal COMMAND.COM command, such as COPY, will ALWAYS return 0;
250 * there is no way around this until M$ fix there COMMAND.COM.
251 * If you use JP Software's 4DOS for NT, then you will have no problems
252 * as it correctly returns the error from the internal command.
253 * Reported by: Michael Sundermann
255 * Fixed by: Michael Sundermann
259 /*--------------------------------------------------------------------
260 * The result of the expression (0 = zero) should be 1, but Regina
262 * Reported by: Dan Hofferth
264 * Fixed by: Florian Grosse-Coosman
268 say ( 0 = zero ) /* should say 1, but 0 */
270 /*--------------------------------------------------------------------
271 * A numeric variable "exposed" by a procedure and subsequently used
272 * in a loop within the procedure that exposed it, gets an erroneous
274 * Reported by: rick@emma.panam.wimsey.com
276 * Fixed by: Florian Grosse-Coosmann
281 Say 'num = ' num ';should be 6'
284 my_proc: Procedure Expose num
285 Say 'num = ' num ';should be 0'
289 Say 'num = ' num ';should be 3'
291 Say 'num = ' num ';should be 6'
294 /*--------------------------------------------------------------------
295 * An error with dropping variables...
296 * Reported by: Dennis Bareis
298 * Fixed by: Mark Hessling
301 call SaveInfo "Fred", "FredsValue";
302 call SaveInfo "Fred", "FredsValue2";
303 call HandleUndefCommand "Fred";
304 call SaveInfo "Fred", "FredsValue3";
309 SavedAs = "Define." || arg(1);
311 say '0.DROPPING "' || SavedAs || '"';
312 if symbol(SavedAs) = 'VAR' then
316 /*--- Check if variable previously existed ------------------------*/
318 say '0.SETTING - ' || arg(1) || ' to "' || arg(2) || '"';
319 SavedAs = "Define." || arg(1);
320 if symbol(SavedAs) = 'VAR' then
321 say '1.Already Existed';
325 /*--- Save info ---------------------------------------------------*/
326 ExecutingCmd = SavedAs || ' = arg(2)'
327 say '2.Executing: "' || ExecutingCmd || '"'
328 interpret ExecutingCmd;
330 /*--- Check variable again! ---------------------------------------*/
331 if symbol(SavedAs) = 'VAR' then
333 interpret 'ItsValue = ' || SavedAs;
334 say '3.Variable exists, value = "' || ItsValue || '"'
338 say '3.JUST SET VAR YET - Variable does not exist - WRONG!';
344 OUTPUT (note Define.FRED seems to exist TWICE in multiple cases):
346 0.SETTING - Fred to "FredsValue"
348 2.Executing: "Define.Fred = arg(2)"
349 3.Variable exists, value = "FredsValue"
351 0.SETTING - Fred to "FredsValue2"
353 2.Executing: "Define.Fred = arg(2)"
354 3.Variable exists, value = "FredsValue2"
356 0.DROPPING "Define.Fred"
358 0.SETTING - Fred to "FredsValue3"
360 2.Executing: "Define.Fred = arg(2)"
361 3.JUST SET VAR YET - Variable does not exist - WRONG!
364 Dumping variables to <stdout>
365 Variables from bin no 0
366 >>> Variable: EXECUTINGCMD Value: [Define.Fred = arg(2)]
367 Variables from bin no 107
368 >>> Stem : Define. Default: [<none>] Values:
370 >>> Tail: FRED Value: []
371 >>> Stem : DEFINE. Default: [<none>] Values:
373 >>> Tail: FRED Value: [FredsValue3]
374 Variables from bin no 109
375 >>> Variable: ITSVALUE Value: [FredsValue2]
376 Variables from bin no 175
377 >>> Variable: SIGL Value: [8]
378 Variables from bin no 231
379 >>> Variable: SAVEDAS Value: [Define.Fred]
383 /*--------------------------------------------------------------------
384 * Allow "stderr" to be used to refer to stderr in STREAM BIF.
385 * Reported by: Dennis Bareis
387 * Fixed by: Mark Hessling
390 rc = Stream('stderr', 'C', 'QUERY EXISTS')
392 /*--------------------------------------------------------------------
393 * The internal variable SIGL gets updated prematurely.
394 * Reported by: Dennis Bareis
396 * Fixed by: Florian Grosse-Coosmann
404 Call AnotherLabel SIGL
412 /*--------------------------------------------------------------------
413 * A syntax error in a Rexx script passed to the RexxStart() API via
414 * the "instore" option, will exit the program, rather than return an
416 * Reported by: Mark Hessling
418 * Fixed by: Florian Grosse-Coosmann
422 /*--------------------------------------------------------------------
423 * The VALUE() BIF would not set values of compound variables correctly
424 * if the variable is specified in lower case.
425 * Reported by: Jeff Parlant and Dennis Bareis
427 * Fixed by: Mark Hessling
439 func: procedure expose stemname (stemname)
441 do i = 1 to value(stemname||0)
442 r = value(stemname||i,'something else')
446 /*--------------------------------------------------------------------
447 * The value of the last argument to a procedure when using the ARG() BIF
448 * has an incorrect trailing space.
449 * Reported by: Mark Hessling
451 * Fixed by: Mark Hessling
455 Call proc '123', '456'
459 Say '<' || arg(1) || '>' /* displays <123> */
460 Say '<' || arg(2) || '>' /* displays <456 > */
463 /*--------------------------------------------------------------------
464 * INTERPRET "return Func()" does not work correctly.
465 * Reported by: Paul G. Barnett
467 * Fixed by: Mark Hessling
468 * Fixed in: 0.08g - See Bug 020
470 Interpret "Return F1()"
471 Say "should not get here!"
477 /*--------------------------------------------------------------------
478 * File names in Regina are always case sensitive, even on non-Unix
479 * platforms. This can result in incorrect read/write pointers when
480 * referencing a file by name with different case.
481 * Reported by: Jackie Cooper
483 * Fixed by: Mark Hessling
488 Call Lineout, myfile, 'Line1'
489 Call Lineout, myupperfile, 'Line2'
492 Do While(Lines(myfile)>0)
493 numlines = numlines + 1
495 Say 'Should be 2 lines, but got only' numlines
498 /*--------------------------------------------------------------------
499 * Setting Rexx variables using VALUE BIF produce inconsistent results.
500 * Reported by: Dennis Baeris
502 * Fixed by: Mark Hessling
505 call value "Upd.3", "text";
506 say 'a) Upd.3="' || Upd.3 || '"';
507 say 'b) Upd.3="' || value("Upd.3") || '"';
508 say 'c) Upd.3="' || value("UPD.3") || '"';
510 Before fix, output was:
520 /*--------------------------------------------------------------------
521 * Need to fix API call RexxVariablePool() to handle RXSHV_FETCH, RXSHV_SET
522 * and RXSHV_DROPV correctly. They currently behave the same way as
523 * RXSHV_SYFET, RXSHV_SYSET and RXSHV_SYDRO respectively. ie the variables
524 * are treated symbolically rather than explicitly.
525 * Reported by: Mark Hessling
527 * Fixed By: Jim Hasslacher, Jr.
531 /*--------------------------------------------------------------------
532 * Assignment on compound variables does not work.
533 * Reported by: Mike Ruskai
535 * Fixed by: No fix required.
536 * Fixed in: Checked in 0.08h
537 * Comments: Regina follows the ANSI standard when assigning one
538 * stem variable to another.
539 * Confusion arises between the way that Object Rexx
540 * assigns one stem variable to another; Object Rexx does
541 * NOT follow the ANSI standard. In Object Rexx, a.=b.
542 * creates a reference from a. to b.; ie a. is the same
548 say 'FOOBAR.1 set to "One", FOOBAR.2 set to "Two", FOOBAR.5 dropped'
549 say 'assigning newstem1. to foobar. ...'
551 say 'dropping newstem1.4'
553 Say 'NEWSTEM1.1 Value:' '"'newstem1.1'" should be "FOOBAR."'
554 Say 'NEWSTEM1.2 Value:' '"'newstem1.2'" should be "FOOBAR."'
555 Say 'NEWSTEM1.3 Value:' '"'newstem1.3'" should be "FOOBAR."'
556 Say 'NEWSTEM1.4 Value:' '"'newstem1.4'" should be "NEWSTEM1.4"' '<-dropped'
557 Say 'NEWSTEM1.5 Value:' '"'newstem1.5'" should be "FOOBAR."'
558 say 'assigning newstem2. to newstem1. ...'
559 newstem2. = newstem1.
560 say 'dropping newstem2.4'
562 Say 'NEWSTEM2.1 Value:' '"'newstem2.1'" should be "FOOBAR."'
563 Say 'NEWSTEM2.2 Value:' '"'newstem2.2'" should be "FOOBAR."'
564 Say 'NEWSTEM2.3 Value:' '"'newstem2.3'" should be "FOOBAR."'
565 Say 'NEWSTEM2.4 Value:' '"'newstem2.4'" should be "NEWSTEM2.4"' '<-dropped'
566 Say 'NEWSTEM2.5 Value:' '"'newstem2.5'" should be "FOOBAR."'
567 /* with default value for source stem */
572 say 'FOOBAR1. set to "default", FOOBAR1.1 set to "One", FOOBAR1.2 set to "Two", FOOBAR1.5 dropped'
573 say 'assigning newstem. to foobar. ...'
575 say 'dropping newstem.4'
577 Say 'NEWSTEM.1 Value:' '"'newstem.1'" should be "default"'
578 Say 'NEWSTEM.2 Value:' '"'newstem.2'" should be "default"'
579 Say 'NEWSTEM.3 Value:' '"'newstem.3'" should be "default"'
580 Say 'NEWSTEM.4 Value:' '"'newstem.4'" should be "NEWSTEM.4"' '<-dropped'
581 Say 'NEWSTEM.5 Value:' '"'newstem.5'" should be "default"'
582 Say 'NEWSTEM.6 Value:' '"'newstem.6'" should be "default"'
584 /*--------------------------------------------------------------------
585 * Inconsistent, invalid return values from STREAM (QUERY EXISTS) when
586 * using the EMX port of Regina under OS/2. This bug possible on other
588 * Reported by: Dennis Baeris
590 * Fixed by: Mark Hessling
594 Call Stream fn, 'C', 'OPEN WRITE REPLACE'
595 Call Lineout fn,'One line'
596 Call Stream fn, 'C', 'CLOSE'
598 Say 'Linein(fn) returned:' '"'line'"' 'should be return "One Line"'
599 stat = Stream(fn,'S')
600 Say 'Stream(fn,"S") returned:' '"'stat'"' 'should be return "READY"'
602 Say 'Linein(fn) returned:' '"'line'"' 'should be return ""'
603 stat = Stream(fn,'S')
604 Say 'Stream(fn,"S") returned:' '"'stat'"' 'should be return "NOTREADY"'
606 /*--------------------------------------------------------------------
607 * If Regina was invoked through the SAA interface, and the script named in
608 * the invocation did not exist, the error message did not correctly name
610 * Reported By: Jim Hasslacher, Jr.
612 * Fixed By: Jim Hasslacher, Jr.
616 /*--------------------------------------------------------------------
617 * Odd behaviour with DELWORD BIF.
618 * Line 1 gives '0' and this is correct (no '10' in the string).
619 * Line 3 makes the same string as used in line 1 and puts it into a.
620 * Line 4 now gives 3 !!!! Yet there is no '10' in there at all
621 * The rest is just to prove my point the length of the string doensn't change
622 * but after the strip all works as it should...
623 * I think the problem occurs when the first character of the searchstring and
624 * that of the deleted word are the same.
625 * MH - the problem occurs if the word following the word to be deleted is
626 * 1 character shorter than the word being deleted and starts with the
627 * same characters as the word being deleted. Seems the check for a word
628 * at the end of the string checks 1 character past the end of the string.
629 * Reported By: Thomas Zobl
631 * Fixed By: Mark Hessling
634 Say Wordpos('10','2 11 1')
637 a = Delword('2 11 10 1',3,1)
645 /*--------------------------------------------------------------------
646 * Passing a lower or mixed case variable name to RexxVariablePool() when
647 * setting a Rexx variable fails.
649 * Reported By: Bill Potvin, II
651 * Fixed By: Mark Hessling
654 Returncode = SysFileTree("*","Files.")
655 say files.0 /* always returns FILES.0 */
657 /*--------------------------------------------------------------------
658 * When registering an external function from within the API, an attempt
659 * to register a function that is already loaded results in a return code
660 * of 1 NOT the correct value of 10 (RXFUNC_DEFINED).
662 * Reported By: Bill Potvin, II
664 * Fixed By: Mark Hessling
668 /*--------------------------------------------------------------------
669 * The STREAM BIF using QUERY EXISTS incorrectly returns a file name
670 * when the file does not exist under some circumstances.
671 * If in directory e:\regina and a file exists: e:\config.sys, then
672 * Stream('e:\config.sys', 'C', 'QUERY EXISTS') returns:
673 * e:\regina\config.sys
675 * Reported By: Dennis Baeris
677 * Fixed By: Mark Hessling
681 /*--------------------------------------------------------------------
682 * The following code causes Regina to crash.
683 * Reported by: Florian Grosse-Coosmann
685 * Fixed By: Florian Grosse-Coosmann
694 say "Name =" Name || ",arg =" arg(1)
696 say "Name =" Name || ",arg =" arg(1)
700 say "Name =" Name || ",arg =" arg(1)
701 Name = "Grosse-Coosmann"
702 say "Name =" Name || ",arg =" arg(1)
705 /*--------------------------------------------------------------------
706 * When calling an external subroutine and it is found by use of
707 * REGINA_MACROS environment variable, PARSE SOURCE does not return
708 * the filename of the file.
710 * Reported By: Steve Menschel
711 * Bug Number: 19991129-86098
712 * Fixed By: Mark Hessling
716 /*--------------------------------------------------------------------
717 * Access to the external environment when using regina.dll under OS/2
719 * This was due to the way that regina.exe was incorrectly built.
721 * Reported By: Paul G Barnett
723 * Fixed By: Mark Hessling
727 /*--------------------------------------------------------------------
728 * Regina incorrectly handles DATE('L') for fractional seconds.
729 * The behaviour would result in consecutively displayed times like:
735 * Reported By: Dennis Baeris
737 * Fixed By: Mark Hessling
741 /*--------------------------------------------------------------------
742 * CALL with parameters fails in various situations with syntax error.
743 * Reported by: Dennis Baeris
745 * Fixed by: Anders Christensen
749 Call "myprog" myargs /* syntax error */
750 Call "myprog"myargs /* works */
751 Call Fred'1234' /* syntax error */
753 /*--------------------------------------------------------------------
754 * Regina incorrectly results in parse error when EXIT called with
755 * non-numeric parameter.
758 * Reported By: Dennis Baeris
759 * Bug Number: 20000323-75678
760 * Fixed By: Mark Hessling
764 /*--------------------------------------------------------------------
765 * Regina get error when calling RETURN from top-level with a
766 * non-numeric parameter.
769 * Reported By: Gerard Schildberger
770 * Bug Number: 20000325-12811
771 * Fixed By: Mark Hessling
775 /*--------------------------------------------------------------------
776 * RANDOM would only return a maximum value of 32767 on many platforms.
778 * Reported By: Alan Bardgett
779 * Bug Number: 20000128-69102
780 * Fixed By: Mark Hessling
784 /*--------------------------------------------------------------------
785 * The Regina parser incorrectly parses the sample code below, and
786 * returns the following error:
787 * Error 15 running "/home/mark/Regina-0.08h/bug030.rex", line 1: Invalid hexadecimal or binary constant
788 * Error 15.3: Only 0-9, a-f, A-F, and blank are valid in hexadecimal string; found "'<'x"
789 * Reported By: Mark Hessling
790 * Bug Number: 19991216-29512
791 * Fixed By: ??? pointed out that it is not a bug.