You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was discoved in CMS370, but fails in the original bREXX the same way.
The instruction Interpret 'Return F()' crashes bREXX with a segmentation fault. This has been verified in bREXX 2.1.9.
Test case:
/* */Interpret'Return F()'ExitF:ProcedureReturn2
This happens because something I haven't yet located in bREXX is calling Lstrcpy() with a to parameter set to 0. The segfault occurs when Lstrcpy() attempts to store into the Lstr object at that location.
There is a work-around: store the function result into a variable, and return that instead. This example works fine:
Interpret'R = F()'ReturnRF:ProcedureReturn2
The text was updated successfully, but these errors were encountered:
Digging into the core dump with GDB, the backtrace is:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000564716ac781c in Lstrcpy (to=0x0, from=0x564716ad8e20 <_tmpstr+32>) at lstring.c:252252 if ( LISNULL(*to) ) {
(gdb) bt
#0 0x0000564716ac781c in Lstrcpy (to=0x0, from=0x564716ad8e20 <_tmpstr+32>) at lstring.c:252#1 0x0000564716ab0476 in RxInterpret () at interpre.c:1402#2 0x0000564716aa65b4 in RxRun (filename=0x0, programstr=0x7ffed01d75f0, arguments=0x7ffed01d7630, tracestr=0x7ffed01d7610, environment=0x0) at rexx.c:489#3 0x0000564716aa50fe in main (ac=2, av=0x7ffed01d7928) at main.c:228
calltype = 3 is CT_INTERPRET, which makes sense, we're in the OP_RETURNF implementation running under an INTERPRET instruction. And there's the zero, right in arg.r: arg = {n = 0, r = 0x0, ....
This was discoved in CMS370, but fails in the original bREXX the same way.
The instruction
Interpret 'Return F()'
crashes bREXX with a segmentation fault. This has been verified in bREXX 2.1.9.Test case:
This happens because something I haven't yet located in bREXX is calling
Lstrcpy()
with ato
parameter set to 0. The segfault occurs whenLstrcpy()
attempts to store into the Lstr object at that location.There is a work-around: store the function result into a variable, and return that instead. This example works fine:
The text was updated successfully, but these errors were encountered: