Simulator occasionally halts scripts on region handoff when they have collision and/or llSleep()
tracked
Huns Valen
I first became aware of this when I noticed my aircraft weren't going into "taxi" mode on landing. It was hard to chase down the origin of this behavior, but I eventually discovered that a script containing collision_start()/land_collision_start() event handlers was being TURNED OFF on region crossing... but only on rare occasions.
I might cross 20 borders without this happening, or even 50 or more. It seems like it's more likely to happen in certain areas, such as the stretch of sims starting just south of Santa Catalina and continuing east across the Blake Sea to that giant four-sim airport in the Norwegian area. I suppose if they're homestead sims, that could explain why that particular area seems more susceptible to it. That has been by far the most reliable place for reproducing this bug.
I grepped all of the scripts in the whole object for llSetScriptState() calls. There are none. (No reason there would be in the first place.)
I found that removing an llSleep() call just after a collision_start() event caused the rate of the script halting to be greatly reduced. I theorize that the chain of events is something like this:
- Vehicle crosses sim border.
- Occasionally, this causes a spurious collision_start() or land_collision_start() event. (This happens well up in the air, obviously, so it isn't a "real" collision. Probably a race condition between the vehicle and avatar entering the sim in some stochastic order.)
- Something about the invocation of llSleep() when the vehicle is still actively being handed off fritzes something in the simulator; and it responds by halting the script, OR by failing to return control after llSleep()'s time has elapsed. Whatever the cause, the script's "Running" checkbox is disabled, and it is quite inert.
Log In
TrishAce Resident
Bumping this, as it still happens to this day.
Working on a vehicle and any script with collision handlers will randomly stop running after a bad crossing.
Edit: I do not use llsleep, and after testing, I can confirm it affects scripts with empty collision handlers too.
TrishAce Resident
To note, this is a related archived jira https://github.com/secondlife/jira-archive/issues/5631
Maestro Linden
marked this post as
tracked
Uggo Vieria
hello, the collison happening is something that lasts since regions crossings have been modified before the uplift. The vehicle is colliding with seated avatars in some cases (probably when they take longer than the plane to enter the region). Another maker's planes had the same issue and I advised him in 2020 or so to check and ignore collision with avatars, which fixed the problem.
if ( llDetectedKey(0) == llDetectedOwner(0) ) return;
Of course, this will not solve the scripts randomly halting issue but it might lower the chances to have it happening. The scripts halting issue I have seen in many cars and AOs, you need to set them to running again to get they to work again, which also resets them
Maestro Linden
marked this post as
under review
Maestro Linden
marked this post as
needs info
Hi Huns Valen, thanks for the report. Please send me a copy of your repro vehicle (with watchdog script) in-world.
Huns Valen
Maestro Linden I spent a couple of hours writing up some test cases, and dropped some inventory on you: "Sim bug handoff notes", "VHI Nimbus [sim bug watchdog test]", and "VHI Nav/Tac HUD 2.7".
The writeup has a lot of information on other sim border crossing issues that vehicles face, which I naturally encountered during the course of writing this up. If you need any help gathering more information on those other bugs, ping me. I know ALL about them.
Huns Valen
Maestro Linden Just happened again in the vicinity of Santa Catalina.
Huns Valen
Maestro Linden And again, just now, same vicinity. Was either crossing from Blake Sea - Irish to Blake Sea - China, or from Blake Sea - China to Santa Catalina.
X-Guard (I mentioned this in the notecard) was turned OFF, so physics were enabled during this crossing. I think I mentioned in the notecard it happened with X-Guard turned ON previously, so now I have samples of it happening either way... which suggests to me that X-Guard is likely not a factor, and it's just a race condition between llSleep() and the region hand-off.
Maestro Linden
Huns Valen: Thanks for these details. I haven't reproduced it myself, but I'm this particular case I do see something suspicious looking. I see the crossing from 'Blake Sea - China' to 'Santa Catalina' at 2025-09-12 18:24:30 SLT. Prior to that, you had crossed from 'Blake Sea - Irish' into 'Blake Sea - China' at 18:24:10. The crossing you report doesn't show any errors, but It looks like the 'Blake Sea - China' simulator failed to read one of the scripts in the vehicle upon your entry.
If you have other incidents (the main thing I need is region names and timestamps), I'd like to see if they're hitting the same failure mode as this case that I was able to find.
Maestro Linden
Huns Valen: I see a ton of crossings around that timeframe, and no errors in Santa Catalina. However, I was able to confirm that one of your vehicle crossings around that time (2025-09-13 01:01:40Z) on a different region reported the same script loading error message that triggered for your vehicle in 'Blake Sea - China' at 18:24:30Z. I think both incidents are indeed the same bug.
Huns Valen
Maestro Linden I would bet it's the Collide script that didn't get loaded, because that's always the one the watchdog script catches. It's never any other script.
Removing the llSleep() call from that script seems to make it less likely to happen. That's called from wheelContact(), which is called from the events land_collision(), land_collision_start(), and land_collision_end().
These events are firing spuriously on region handoff, but only on rare occasions.... in mid-air, far from the terrain mesh. I confirmed this by adding llOwnerSay() debug statements to them. I can go through 50 hand-offs and not see that spam once, but then it spams when I land, so I know the debug statements are doing something.
I thought perhaps adding an llSleep() call on CHANGED_REGION could reproduce the bug more reliably. The first time I did a region crossing after this, either the region (Murray) crashed, or I got disconnected. That was at about 5:15 PM PDT 2025-09-20. When I relogged, my agent was in an extremely weird state. It would cross from one region to another, and wind up in yet another region nearby, which made no sense at all. Some of its attachments had been removed as well. I don't know if there's anything interesting in the logs from that, but I wasn't able to reproduce it again, even with that code running during many other region handoffs.
I can keep sending locations and timestamps.
Maestro Linden
Huns Valen: Yes, for the 2 incidents I was able to find in the logs (from your blake sea sessions), the script that failed to load was "Nimbus::Collide". Since the 2 incidents are basically identical, I think we have enough data for that sort of failure.
I attempted to reproduce this bug on demand by adding a script that called llSetPos() every 5 seconds to make the jet repeatedly cross a region border, while monitoring the state of "Nimbus::Collide". After about 5000 crossings, "Nimbus::Collide" still appeared to be running properly. I suspect that since the vehicle didn't have an avatar seated on it during these crossings, there were no rogue collision events for "Nimbus::Collide" to process.
Huns Valen
Maestro Linden I've never seen a vehicle, in and of itself, adversely effected by a region crossing, aside from this odd bug. It always keeps going in whatever direction it wants, although it may be "nudged" to point in a slightly different direction during the crossing. It's the avatar, the avatar's connection to the vehicle, and sometimes the viewer, that gets fritzed.
I also suspect that doing this on a non-physical object will reduce the probability of reproducing the behavior.