CreateRexxPort issue

Report any Hollywood bugs here
Post Reply
User avatar
jPV
Posts: 600
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

CreateRexxPort issue

Post by jPV »

I got an issue where my program's ARexx port name was changing to garbled strings. It was initially what I set it, but then during the usage port seemed to vanish (didn't work anymore), but with a closer look it was still there, but its name was trashed. Sometimes the name seemed to be some totally unrelated strings or so.. like it'd point to some memory area that got different content.

With some hunting and cutting the code down to pieces I was able to create this example. The code and port name work fine if I give the name directly to CreateRexxPort(), but if I try to make some conversion from lower case name to upper case, then it starts to act up. Funnily if UpperStr() doesn't need to change anything, issue doesn't seem to happen and everything works as it should be.

And this issue becomes visible only after some other action... the port name seems to be fine at first (the first p_port() check in this example), but then something triggers it (found it with ReadBytes() in my case).

Haven't tried this on other systems than MorphOS yet...

Code: Select all

; This doesn't work:
Const #APPNAME = "test"

; This works always:
;Const #APPNAME = "TEST"

Function p_port()
    DebugPrint("Port check (" .. GetTime(True) .. "):", RunRexxScript("RETURN SHOW('P','TEST')", True))
EndFunction

CreateRexxPort(UpperStr(#APPNAME)) ; UpperStr causes problem here?

Local f=OpenFile(Nil,"System:Applications/OWB/OWB")
p_port() ; port name seems to be fine at this point still
Local data=ReadBytes(f,409600)
p_port() ; port name gets messed up after the previous line!

WaitLeftMouse()
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: CreateRexxPort issue

Post by airsoftsoftwair »

Fixed now, thanks for the report! Interesting that this remained undiscovered for so long.

Code: Select all

- Fix [Amiga]: Ports created by CreatePort() and CreateRexxPort() often changed their names to garbage because Hollywood didn't preserve the memory used for storing the port name
User avatar
jPV
Posts: 600
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: CreateRexxPort issue

Post by jPV »

I remember seeing it couple years ago with some other program, but forgot to investigate it better then and forgot which program it was then. And it didn't seem to happen since then until now again... luckily it became clearly reproduceable now and we got it fixed :)
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: CreateRexxPort issue

Post by airsoftsoftwair »

jPV wrote: Sat Oct 23, 2021 10:40 am I remember seeing it couple years ago with some other program, but forgot to investigate it better then and forgot which program it was then. And it didn't seem to happen since then until now again... luckily it became clearly reproduceable now and we got it fixed :)
Yeah, was about time. ARexx support was introduced in 2007 AFAICS :o
Post Reply