Open zeroeightysix opened 4 years ago
I'll look into that in this holidays, do you have a SSCCE I can use it to debug it?
Ps: opening issues is actually a great help
I created a repository here. I believe you need minecraft installed on your system for fabric to work.
Assuming you are using IDEA:
build.gradle
./gradlew idea
, to generate the run configurations
3.1. You may have to restart your IDE for the run configurations to show up!If everything went right, minecraft will start up and in the console will appear:
[main/INFO]: [STDOUT]: Hello imgui!
I found this issue a while back, but could only crash when trying to run it myself! Thank you for finding this! What OS are you using? I think Windows, which I was using, will not work to re-create, since mine would always crash.
On Thu, Dec 19, 2019, 09:57 Ridan Vandenbergh notifications@github.com wrote:
I created a repository here https://github.com/zeroeightysix/fabric-example-mod. I believe you need minecraft installed on your system for fabric to work.
Assuming you are using IDEA:
- Import the project from the build.gradle
- Wait for fabric to finish generating sources, etc.
- Run ./gradlew idea, to generate the run configurations 3.1. You may have to restart your IDE for the run configurations to show up!
- Run the newly generated 'Minecraft Client' run configuration.
If everything went right, minecraft will start up and in the console will appear:
[main/INFO]: [STDOUT]: Hello imgui!
- Create a new world (Singleplayer > Create new world > Create new world)
- Once ingame, press Y. This will open the imgui screen. 2.1 Press R to reload the imgui screen.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kotlin-graphics/imgui/issues/114?email_source=notifications&email_token=ADTJ6QEQNBQD2BJSN7QASRLQZOKYFA5CNFSM4J5I3GK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHKB2XQ#issuecomment-567549278, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTJ6QCGNTBGHOVNSS4KX2LQZOKYFANCNFSM4J5I3GKQ .
I found this issue a while back, but could only crash when trying to run it myself! Thank you for finding this! What OS are you using? I think Windows, which I was using, will not work to re-create, since mine would always crash.
I'm on linux.
Edit: I'll try to reproduce this issue on windows.
Turns out it's even worse on windows.
The problem stays the same, with nondeterministic rendering when the GUI screen is opened. However, sometimes the program is killed upon either opening the screen or always killed when pressing R to renew the ImplGl3
instance. No crash, no error, no nothing. Just a bogus exit code (-1073741819
).
I got one JVM crash though (also appearing in nondeterministic nature): jvm_crash.txt hs_err_pid5428.log
Oh, what fun this is to debug..
Edit: The hex number in EXCEPTION_ACCESS_VIOLATION (0xc0000005)
mentioned in jvm_crash.txt
is the aforementioned -1073741819
(0xc0000005 - (2^32 - 1)
)
Instinct says to me that we're using a different texture format than Minecraft and incorrectly setting it
On Thu, Dec 19, 2019, 11:27 Ridan Vandenbergh notifications@github.com wrote:
Turns out it's even worse on windows. The problem stays the same, with nondeterministic rendering when the GUI screen is opened. However, sometimes the program is killed upon either opening the screen or always killed when pressing R to renew the ImplGl3 instance. No crash, no error, no nothing. Just a bogus exit code ( -1073741819).
I got one JVM crash though (also appearing in nondeterministic nature): jvm_crash.txt https://github.com/kotlin-graphics/imgui/files/3984814/jvm_crash.txt hs_err_pid5428.log https://github.com/kotlin-graphics/imgui/files/3984813/hs_err_pid5428.log
Oh, what fun this is to debug..
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kotlin-graphics/imgui/issues/114?email_source=notifications&email_token=ADTJ6QG4HHDWC6EDR73DEKLQZOVIDA5CNFSM4J5I3GK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHKKRKQ#issuecomment-567584938, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTJ6QCXM3LRF6OBNTHTXETQZOVIDANCNFSM4J5I3GKQ .
Instinct says to me that we're using a different texture format than Minecraft and incorrectly setting it
How come the crashes and rendering is so unpredictable though? If you were using another format, I'd assume it'd crash all the time, or render wrongly all the time
The crashes may be because of the texture being placed in different places in memory. Before the end leads to weird results due to reading nulls, at the end causes an access violation after we read past the end that we think is there. The rendering incorrectly stumps me more here. This doesn't really explain the different rendering, but my idea is that Minecraft may use different pixel store alignments for different textures? Or potentially something with texture arrays causing something goofy with upload offsets, like empty 10x10 images being placed before it? I'm not GL expert, so I really don't know. But there are a lot of places this could come from.
4. Run the newly generated 'Minecraft Client' run configuration.
I get:
bad class file: C:\Users\elect.gradle\caches\modules-2\files-2.1\com.github.kotlin-graphics.glm\glm\1b4ac18dd1a3c23440d3f33596688aac60bc0141\e7be1f06acfd1647d34b2223e516971eb62479ab\glm-1b4ac18dd1a3c23440d3f33596688aac60bc0141.jar(glm_/vec2/Vec2.class) class file has wrong version 55.0, should be 52.0 Please remove or make sure it appears in the correct subdirectory of the classpath.
Which jdk do you use?
Which jdk do you use?
Well, it's complicated. I've ran into this issue as well (and figured I'd fix it later, by updating @AlexApps99's branches)
I temporarily fixed it by setting the project SDK to java 11.0.5
(OpenJDK), and the project language level to 8
:
Same.
Could you try to replicate? Delete the project and re-clone
Same.
Could you try to replicate? Delete the project and re-clone
Sorry for the late response.
I am able to replicate the issue you described and using the configuration I posted above, I am able to get it to run anyways. The original bug this report is about is still there as well.
I have 11.0.1, let me try 11.0.5
@zeroeightysix, give it a try, thanks to tests, I fixed tons of bugs and corner cases, a couple of crash allocation bugs included
@zeroeightysix, give it a try, thanks to tests, I fixed tons of bugs and corner cases, a couple of crash allocation bugs included
Unfortunately I am still able to reproduce this issue.
However, the amount of crashes I randomly encounter has decreased significantly (recently, none). Good work!
May I see one log of these still existing crashes?
May I see one log of these still existing crashes?
Looking at my remaining logs.. looks like it won't be anything new! My last crash was Feb 2, meaning I haven't had any crashes since fc381b72c0c75fb9f4199e7387cc629414ac9b38 - I'm going to assume the commits after have fixed them all.
If I do run into a crash again, I'll let you know.
Nice, let's keep this open still for a while and if there wont be still any crashe, we'll consider it resolved
I've managed to avoid both the crashes and rendering issues by initializing ImplGL3 right after the Minecraft window is created in WindowProvider::createWindow.
@Mixin(WindowProvider.class)
public class WindowProviderInit {
@Inject(at = @At("TAIL"), method = "createWindow")
public void onCreateWindow(WindowSettings settings, String videoMode, String title, CallbackInfoReturnable<Window> cir) {
Window window = cir.getReturnValue();
// Initialize ImplGL3 here!
}
}
This might be related to #112, #99 or #96. My setup is comparable to all three issues.
Setup
build.gradle
: To work around #112, the fix mentioned in that thread are being used: The rest of the file is omitted for brevity.MinecraftScreen.java
: The minecraft screen (GUI) (see #99 examples, and the example on the wiki) Source codeProblem
Imgui's rendering screws up randomly, depending on at what time
implGl3 = new ImplGL3();
(inMinecraftScreen
) is called.Sometimes it renders just fine:![image](https://user-images.githubusercontent.com/27009727/71184331-e6653100-2279-11ea-85af-cc1d08059a9f.png)
Sometimes it doesn't render at all.
Sometimes it only draws some glyphs, varying in readability:
More readable:
![image](https://user-images.githubusercontent.com/27009727/71184479-1b718380-227a-11ea-9b24-797a58d7bea0.png)
Sometimes all text gets cut off slightly.![image](https://user-images.githubusercontent.com/27009727/71184432-0e549480-227a-11ea-9ed4-b09ca600018c.png)
How the rendering screws up depends on the current instance of
ImplGL3
. Each time the player invokes a command causingMinecraftScreen#reload
(this method) to be invoked (thus, creating a new instance ofImplGl3
), the rendering changes, randomly, to any of the above.I'm assuming this has something to do with the openGL state imgui sets up for itself. Changing the GL state before any call to
implGl3.renderDrawData
does not affect how the windows are drawn.Sorry for opening all of these issues! Thanks for your continued help.