Open blegat opened 8 years ago
Are you on a very new version of Julia 0.5?
Not that new: Version 0.5.0-dev+1491 (2015-11-27 16:54 UTC) Commit 41fb1ba (109 days old master)
so I guess this happens in mesh = GLNormalMesh(poly)
?
Yes, exactly
can you break this down, so that I can try to reproduce it? Like this I have no chance! Alternatively, you can try to just replace normalize with your own implementation (should be very quick) and see if the problem remains.
Yes I'll try to break this down but as I said, as soon as I change something the problem disappear :( I'll tell you when I have something more precise ;)
I have been able to simplify a bit. It fails 100% of the time with the following code
using Polyhedra
using CDDLib
V = [ 1 0 -1/sqrt(2);
-1 0 -1/sqrt(2);
0 1 1/sqrt(2);
0 -1 1/sqrt(2)]
ext = GeneratorDescription(V)
poly = polyhedron(ext)
using GeometryTypes
mesh = GLNormalMesh(poly)
even if I remplace fulldecompose
of Polyhedra/src/decompose.jl
by the following:
function fulldecompose{T}(poly::Polyhedron{3,T})
ntri = 4
points = Vector{FixedSizeArrays.Point{3,Float64}}(3*ntri)
faces = Vector{GeometryTypes.Face{3,Int,0}}(ntri)
ns = Vector{GeometryTypes.Normal{3,Float64}}(3*ntri)
map!(v -> v, ns)
(points, faces, ns)
end
Surprisingly enough, if I do not allocate points
and faces
in fulldecompose, it does not fail. I have also tried to execute the code of fulldecompose
out of the package Polyhedra
but then it does not fail anymore :(
Of course, I realize that it does not make the problem a lot easier to solve... Maybe it will be fixed when Julia 0.5 is released so we might just wait and see :-P
I am having a very hard time creating a minimal crashing example for this bug because it is nonderterministic. If I execute 2 times the same code it can crash and then work perfectly. If I had or remove one line that has nothing to do with the crash, it can stop crashing at all (that is what makes it difficult to make a minimal example).
The error I get is
With the code
where
common.jl
isThe moment it fails is when I do
map!(normalize, ns)
wherens
contains normals. If I replace it withmap(normalize, ns)
, it also fails. What could it be ? Maybe is it because the normals inns
sharesRational{BigInt}
using the same reference ? I don't know... Do you have any idea ?