-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
fix UInt underflow in line indices #4782
base: master
Are you sure you want to change the base?
Conversation
Benchmark ResultsSHA: ca93c83739a943e8533bed339f660bc1eaf4dff8 Warning These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking. |
Afraid it doesn't appear to solve #4373. I'm quite new so just to be clear what I did to test this:
|
I don't think you'll get the GLMakie changes from that. You probably need |
OK good to know! Just re-checked it but unfortunately still seeing the same problem.
… On 12 Feb 2025, at 14:49, Frederic Freyer ***@***.***> wrote:
ffreyer
left a comment
(MakieOrg/Makie.jl#4782)
I don't think you'll get the GLMakie changes from that. You probably need add GLMakie#ff/fix-uint-underflow
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
<#4782 (comment)> <https://github.com/notifications/unsubscribe-auth/ADHS3DHG3VVSULMILQ2WERD2PNNPRAVCNFSM6AAAAABW7S4MHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJTHEZTOMZQGU>
ffreyer
left a comment
(MakieOrg/Makie.jl#4782)
<#4782 (comment)>
I don't think you'll get the GLMakie changes from that. You probably need add GLMakie#ff/fix-uint-underflow
—
Reply to this email directly, view it on GitHub <#4782 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADHS3DHG3VVSULMILQ2WERD2PNNPRAVCNFSM6AAAAABW7S4MHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJTHEZTOMZQGU>.
You are receiving this because you commented.
|
@chriswaudby, maybe this fixes it? #4779 |
Just tested #4779 - unfortunately it doesn’t make a difference. In fact, it seems to introduce a new error when I close the plot window:
julia> ┌ Warning: error closing screen
│ exception =
│ deadlock detected: cannot wait on current task
│ Stacktrace:
│ [1] error(s::String)
│ @ Base ./error.jl:35
│ [2] wait(t::Task)
│ @ Base ./task.jl:367
│ [3] wait(t::StableTasks.StableTask{Any})
│ @ StableTasks.Internals ~/.julia/packages/StableTasks/3CrzR/src/internals.jl:15
│ [4] wait(x::GLMakie.Screen{GLFW.Window})
│ @ GLMakie ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:545
│ [5] #stop_renderloop!#83
│ @ ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:947 [inlined]
│ [6] stop_renderloop!
│ @ ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:939 [inlined]
│ [7] close(screen::GLMakie.Screen{GLFW.Window}; reuse::Bool)
│ @ GLMakie ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:753
│ [8] close
│ @ ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:739 [inlined]
│ [9] renderloop(screen::GLMakie.Screen{GLFW.Window})
│ @ GLMakie ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:1077
│ [10] (::GLMakie.var"#79#81"{GLMakie.Screen{GLFW.Window}})()
│ @ GLMakie ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:920
│ [11] (::GLMakie.var"#80#82"{StableTasks.AtomicRef{Any}, GLMakie.var"#79#81"{GLMakie.Screen{GLFW.Window}}})()
│ @ GLMakie ~/.julia/packages/StableTasks/3CrzR/src/internals.jl:107
└ @ GLMakie ~/.julia/packages/GLMakie/p8DSG/src/screen.jl:1079
As I’ve been testing this, I’ve noticed that I can trigger a segfault pretty reproducibly if I try to resize the figure window immediately upon opening. If I interact with the application first, I can then resize without any further issues.
… On 12 Feb 2025, at 16:13, Simon ***@***.***> wrote:
SimonDanisch
left a comment
(MakieOrg/Makie.jl#4782)
@chriswaudby, maybe this fixes it? #4779
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
<https://github.com/chriswaudby> <#4779> <#4782 (comment)> <https://github.com/notifications/unsubscribe-auth/ADHS3DC7UEDAEVTEGVKDJF32PNXJLAVCNFSM6AAAAABW7S4MHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJUGE4TINJYGE>
SimonDanisch
left a comment
(MakieOrg/Makie.jl#4782)
<#4782 (comment)>
@chriswaudby <https://github.com/chriswaudby>, maybe this fixes it? #4779 <#4779>
—
Reply to this email directly, view it on GitHub <#4782 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADHS3DC7UEDAEVTEGVKDJF32PNXJLAVCNFSM6AAAAABW7S4MHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJUGE4TINJYGE>.
You are receiving this because you were mentioned.
|
for elem in to_value(vao.indices) | ||
# TODO: Should this exclude last(elem), i.e. shift a:b to (a-1):(b-1) | ||
# instead of (a-1):b? | ||
vao_boundscheck(N_vert, last(elem), vao) | ||
glDrawArrays(mode, max(first(elem) - 1, 0), length(elem) + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically just want to highlight the TODO I added here. I think this should just shift indices from 1-based to 0-based but with length(elem) + 1 that's not what's happening. Is this a mistake?
function length(vao::GLVertexArray) | ||
isempty(vao.buffers) && return -1 | ||
return mapreduce(length, min, values(vao.buffers)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also want to highlight this change. Taking the min length may remove (unavailable) vertices when rendering triggers between buffer updates (if that's even possible). And it may trigger errors in checks. Should also be safer.
Not sure if the no-buffers case can ever trigger. I thought maybe it was triggering with voxels but they do have quad vertices.
@chriswaudby There are some more changes here that could fix the segfault if it's caused by bad vertex indexing. If you set |
My first impression is this may fix the problem - I'll check with my student as she was also seeing this bug and confirm. With GLMAKIE_DEBUG[] switched on, I do get a string of error messages once I quit Julia - don't know if this is connected but I'm copying them below in case.
|
Those errors should be fine if they don't pop up at runtime. (E.g. between closing and opening new windows, from calling |
Description
Fixes an integer underflow in GLMakie as is happening in #4771 (comment). May solve #4373 (but I have no way to confirm that)
Type of change
Checklist