Chisels & Bits - For Fabric

Chisels & Bits - For Fabric

2M Downloads

Java Exception Access Violation

Lohoydo opened this issue ยท 4 comments

commented

I noticed this issue with version 14.17. I know this isn't the most up-to-date but I am not going to go to the issues involved with changing versions multiple times to recreate this. I've looked at the issue tracker and haven't found any mention of this being reported before.

  1. I changed the config to make the stack size in a bit bag 2048 (from 512)
  2. Updated DW20 pack to 2.1 (note that this reverted my change to the config
  3. I started getting Exception Access Violation crashes
  4. Reverted back to 2.0 (did not fix config), crashes continued
  5. Changed config back, crashes stopped
  6. Re-updated to v2.1, changed config, no crashes.

For any bug reports please provide the following details as well,

  • MC Version: 1.12.2 (Direwolf20 pack)
  • C&B Version: 14.17
  • Do You have Optifine: no
commented

The issue seemed to be having stacks of 2048, then setting the config back to 512. It was only while having stacks of 2048 in the bag while the config was set to 512 that the crashes occurred. Might it be possible that having more bits than expected caused something to overflow its appointed memory to cause the error? Its been a long time since I've dealt with Java, but that's what comes to mind.

commented

If we were talking about a language like C or C++ such a thing could be possible in the right condition.

In this case its not an option, In java going beyond the bounds of an array or container will yield a IndexOutOfRangeException. Note that this is a very different result from an access violation. Java won't even let the program access memory that it don't own, which is different from languages like C or C++ that fore go such checks for speed and efficiency.

In the case of stack sizes, its just an integer, there is no array or list of values, so even if it were C or C++, the result of having a "larger then expected integer" would not yield a crash, just a integer with a big number, possibly causing a glitch somewhere like a badly displayed number or it removing the item because of an invalid value. Such would be specific to the application in question, and how the code was written.

In the case of C&B, the stack size is almost irreverent to the functioning. Since the stack size is only tested when you interact with the slots themselves, any slot can still contain 2048 bits. You have to pull them out or delete them or something and the game will begin honoring the new limit. Even then the strangest odity is holding a stack that makes little sense.
image

But I don't consider that to be an issue worth fixing since its specifically caused by reconfiguration the game. No crashes occurred. And like I mentioned before, the error you specifically have mentioned isn't your average run of the mill java exception, its one that can only occur when not playing safely inside java's normal VM rules.

Access Violations when running a Java application are very "special case" because the only way you can encounter them is when the VM itself has a bug, or when your using non-java code with java. This happens when the game calls into libraries for graphics and other things of course.

Even then if done properly the crash would have to be a result of the library containing a bug. While minecraft uses several libraries for its own purposes, such as graphics.

C&B is completely written in java, and has no additional third party binaries, even if it did, none of them would be used for governing something as simple as limiting a stack size. You can check your crash log and see if maybe there is some indication on what might have thrown the access violation, sometimes they are caused by DLL files in use. sometimes it can be a bug in the graphics driver, or another library. They can be difficult to understand since access violations are tricky to deal with in general.

commented

EXCEPTION_ACCESS_VIOLATION usually indicate a bug in the VM, or another binary in use. C&B is pure java, and doesn't even use ASM. I believe that its very much a coincidence that its crashing in relation to the C&B Setting. Its possible that your experiencing a more random crash, you might want to make sure that your drivers are up to date or that any mods using binaries are updated, possibly make sure your using an up to date build of java where possible.

commented

I have also confirmed that I can play C&B with the bag stack size set to 2048,
image