-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsafe pointer arithmetic #30
Comments
It's a wrapper for a C pointer. I need to dig a little bit more about what -race does. BTW, it works fine in normal mode. |
Yep, I agree, but this will prevent running application with |
@pztrn Yes, you got the point. I will dig it out. |
This issue caused by converting uintptr to a C void* pointer. Anyone knows how to avoid this crash? |
I am getting this same error. This prevents me from using the |
@ryn1x I'll take a look on this deeply this time. This is truly a big issue. |
The trick here is that there should be no Check this example commit, which allows to bypass first of the failures demonstrated by using It's quite tedious and non-rewarding work. But I'll do my best to help with it. UPD: Forgot to mention, that I was trying to run |
Unfortunately they also have this in go-gl which makes it harder to fix as the rabbit hole is much deeper than I hoped. |
@yarcat Yeah, I met the same upstream problem last time when I try to fix this. |
To note, the fork @ https://github.com/neclepsio/gl has some variant function calls that, afaik, should resolve problems stemming from unsafe.Pointer use. I've experimentally tried using it (along with changing some of the imgui C interface) and it seemed to fix the pointer arithmetic problems. |
@kettek Wow! Can you make a PR? |
Sure. It ended up being part of my attempts to do per-texture filtering, so I'll separate it from that first. |
Unfortunately this issue is a bit of show stopper for a concurrent GIU application, where using -race to catch data race issue is very important. Will this be resolved soon? |
@ravicheema Cannot promise when, but I'm keep trying to fix it everyday. |
I'll attempt to make a PR this weekend integrating the changes I had experimented with last month. |
See #83 There are still issues with actual race conditions but this PR fixes the unsafe pointer arithmetic problem. |
WORK AROUND - Go +1.14 has added Use the following to perform data race condition checks and disable Not ideal but it is a work around. |
Hello there! For example, instead of calling There are a few more overloads with In general, any use of I have not reviewed the giu code, my proposal is to remove any use of Also, as the maintainer of imgui-go, I can report that the original issue about TextureID has also long been fixed. |
Great to hear! I will rework the changes in PR #83, as that used a fork of go-gl/gl that implemented WithOffset, to use the updated go-gl/gl version as well as to reintegrate imgui-go's TextureID fixes. Thanks for the update! |
@AllenDang it seems like upstream imgui-go doesn't have this issue anymore. I tried to run inkyblackness/imgui-go-examples example and it went clean. |
@gucio321 I'll check it out and fix it soon. |
@AllenDang and @gucio321 |
well so like I said any example from inkyblackness/imgui-g-examples works well with -race so i suppose that @AllenDang needs to change something inside of AllenDang/imgui-go however idk what is the point there. |
@gucio321 Yes, it's the root cause. I'm thinking about to use cimgui (as it is auto-generated and easy to sync the changes from imgui) to recreate the binding, might need more time to evaluate. |
I've compiled application with
-race
and it crashed right before showing up GUI.The text was updated successfully, but these errors were encountered: