Strange bug using anchors in view3dscene

I tried the Anchor node for the first time in view3dscene for the purpose of transferring between X3D worlds. But when view3dscene opened the next world it showed this alert:

view3dscene

Access violation.

Press OK to ignore and risk data corruption.
Pres Abort to kill the program.

I hit OK and could continue in the new world. But eventually figured out that this only happens in versions of the 2nd world which have a castlescript present. I replaced the “castlescript:” header in the script with “javascript:”, and although the script wouldn’t execute correctly, it did keep the access violation from happening. Is there additional code I could add to the Anchor node that would inform it to expect castle code scripts in the destination file and not show this error? Or is this truly a bug?

“Access violation” is always a bug, please send a bugreport (with files to reproduce it). It’s best to submit it to https://github.com/castle-engine/view3dscene/issues . Please also test does it still occur with latest version from snapshots on http://michalis.ii.uni.wroc.pl/view3dscene-snapshots/ . Thank you!

Background: Access Violation means that the program is accessing memory it should not access. This should never happen in a correct program, no matter what files you load. Even if you try to load a completely invalid X3D file, you should still get a “normal” error (clearly stating where’s the error in your input file), not Access Violation. “Access Violation” is often called SEGFAULT, since on Unix the OS sends SEGFAULT signal when “Access Violation” occurs.

In general, CastleScript in a file should work, you do not need to declare anything special. CastleScript should also work in a file to which you go through Anchor. So, we definitely have a bug that I want to fix :slight_smile:

I just received your bug fix for it. Thank you so much. It worked this time.

1 Like