Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script run-time error & Stack-Heap Collision..Why?

Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
08-26-2007 04:56
I'm trying to add a simple llSetText in the Rent-All! Rental cube script done by Rizado DaSilva. Original script can be found here:

/15/ca/88078/1.html

...but when I add

llSetText("L$" + (string)price + "\/" + (string)maxPrims + " prims.\nPay the sign to rent this space.", <1,1,1>, 1.0);

anywhere in the script I get a "Script run-time error" & "Stack-Heap Collision".
Does anybody knows why?

EDIT: Forgot to mention that script compiles successfully but when it starts I get this:

[4:43] Rent-All! rental cube: Activating...
[4:43] Rent-All! rental cube: Reading configuration...
[4:43] Rent-All! rental cube: Script run-time error
[4:43] Rent-All! rental cube: Stack-Heap Collision
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-26-2007 05:28
Judging by the original author's comment @, the version in that post may have been on the hairy edge of running out of memory anyway. You might see if the updated versions are still available in-world... otherwise it may be time for a new Library rental-box script.
Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
08-26-2007 05:34
The version I'm working on is the latest obtained in-world.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-26-2007 06:02
Okay, so I went in-world and picked up a copy; the only one I could find was still at version 1.08, the comments in the other thread about "changes in 1.9 and 1.10" notwithstanding. And it *is* on the hairy edge of running out of memory; added an " llOwnerSay((string)llGetFreeMemory());" to the end of state_entry and got a whopping 592 bytes remaining. On the plus side, it should be easy to reduce memory consumption dramatically by finding strings that are used multiple times and putting them into global variables. Or maybe even easier: the timer() event handler does essentially the same thing in each branch, just with different strings, so would seem readily replaceable by calls to a function that implements the redundant code. All this subject to the caveat that I've not actually tried to use the script, so....

Well, actually, worse than that: The author GPL'd it in an embedded notecard, but with the extra condition that you have to send him a copy if you make any changes. And *that* notwithstanding the fact that the code being distributed violates its own GPL conditions by not including the GPL and author data in the code itself. So... I dunno. Hire a lawyer or start from scratch?
Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
08-26-2007 06:32
Thanks a lot for all advices to reduce the memory usage...I'll see what can I do. Regarding the GPL I'll follow it to the point.

EDIT: Tried to put simple "llSay(internalChan, "On";);" and "llSay(internalChan, "Off";);" in order to transmit to another script that will change the hovering text and I also used that "llOwnerSay((string)llGetFreeMemory());" to see how much memory remains. I get same errors and the llGetFreeMemory() says that there is still 463 bytes free. I'm totaly confused :confused:
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
08-26-2007 07:42
From: Darko Lednev
I get same errors and the llGetFreeMemory() says that there is still 463 bytes free. I'm totaly confused :confused:

Oh, but 463 bytes is like nothing... I haven't looked in any detail at what the script does, but just consing together a few strings at runtime could easily eat that, generating the stack/heap collision. And at the end of state_entry (where I stuck that llGetFreeMemory when I tested) it was still reading the config notecard, so it would have had even less available by the time it got EOF from the dataserver.
Hitomi Kamachi
Registered User
Join date: 21 Mar 2007
Posts: 3
09-02-2007 17:51
"Reset scripts in Selection" usually fixes it.

It's in the tools menu.