Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

retrieving/handling object crashes

Zaplok Riggles
Registered User
Join date: 25 Feb 2008
Posts: 119
04-25-2008 08:08
When I am testing, if I get a script crash. I see a paper icon on the object that I can click on to show me the error info. If my object should crash when I am not there to see it happen, is there a way to see the crash info after the fact?

Also, is there anyway to detect a crashed script and restart it or inform the object owner?
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
04-25-2008 12:30
I don't know about reading the error messages after the fact, maybe somebody else will know how and we both will benefit but here is what I do for the crashed script.

I have a script that periodically sends data to a web page. For some reason that I have not been able to figure out yet it sometimes crashes. This script only sends data and doesn't need to get anything back. I made a second script with just an http response (no request). Every time the main script sends a request, my webserver sends back a "reset" response. The second script sees this "reset" and resets a timer. If it doesn't see a "reset" within a set amount of time it resets the first script. Not the most eloquent way of doing things but it works for me for now until I figure out what is making the first script crash.
_____________________
There are no stupid questions, just stupid people.
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
04-25-2008 13:18
Script errors are said on the Debug Channel, which is a defined constant under LSL:

DEBUG_CHANNEL 2147483647

If you create an script listening on this channel, it can 'hear' the errors and store/forward or otherwise act on them.
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-25-2008 13:21
No, I don't believe you can see error messages after the fact (that is, if you were not within chat range when the object produced the error). You can bring up a script error/warning window (I believe the menu option is under Tools) to see messages that you WERE there to witness, but that are no longer showing the little error icon. Note that script error/warning messages are just normal chat, but sent to a special channel (DEBUG_CHANNEL which is the maximum positive integer value in LSL: 0x7fffffff) that gets sent to the viewer/user in a special way. Note also that scripts can purposefully chat on DEBUG_CHANNEL, but cannot get listen messages on it (I've tried).
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
04-25-2008 16:45
Hewee, this line confuses me:

From: Hewee Zetkin
Note also that scripts can purposefully chat on DEBUG_CHANNEL, but cannot get listen messages on it (I've tried).


Are you saying that what Darien posted wouldn't work?
_____________________
There are no stupid questions, just stupid people.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
04-25-2008 20:07
CODE
default {
touch_start(integer n) {
llSay( DEBUG_CHANNEL,"Mary Had a little lamb");
}
}

CODE
default {
state_entry() {
llListen(DEBUG_CHANNEL, "", "", "");
}
listen(integer channel, string name, key id, string msg) {
llOwnerSay(msg);
}
}

Works just fine returning:

[20:04] Object: Mary Had a little lamb

It might have been borked at some point before?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
04-25-2008 20:28
Actually it appears that Hewee is correct. While you can listen for things said on the debug channel by a script, the listen will not pick up actual real errors. O.o
I guess they must be sent in some other fashion, and do not get picked up by listens. That's really too bad.
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-25-2008 20:43
From: Jesse Barnett
It might have been borked at some point before?

Huh. I guess so. That's just the sort of thing I tried. Well, I guess we're both right in a way. Interesting.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
04-25-2008 21:20
From: Darien Caldwell
Actually it appears that Hewee is correct. While you can listen for things said on the debug channel by a script, the listen will not pick up actual real errors. O.o
I guess they must be sent in some other fashion, and do not get picked up by listens. That's really too bad.

heehee. Well it just so happens I have been pushing the boundaries of a long script and been running into stack collisions and every now and then mess up with the list conversion to llDialog menu :rolleyes:
So I went ahead and forced it with that same listener out and it repeated the debug warning like so:

[21:01] Object: llDialog: button list must contain only strings

Soooooo I guess someone is cleaning up some of the garbage on the backend! Woot!

But what is really weird is that error messages are llRegionSay's but a listener can only hear an error message if it is less then 20 meters away????? Tired but I tried a few times. Would love it if someone proved me wrong. Would be handy if you could forward error messages from anywhere in a sim to IM or email.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum