SovereignShop/clj-manifold3d

`.triVerts` can crash

phronmophobic opened this issue · 3 comments

The following will exhibit weirdness and in some cases, crash.

(while true
  (let [mesh (get-mesh (cube [10 10 10] true))
        verts (.triVerts mesh)]
    (System/gc)
    (doall(eduction
           (map (fn [idx]
                  [(.x idx)
                   (.y idx)
                   (.z idx)]))
           verts))))

Usually, the result will be empty, but it will crash in some cases. Removing the (System/gc) will usually prevent the crash, but I ran into this bug while generating multiple meshes in a loop and crashing.

Thanks for reporting, I'll have to dig into this.

Ran this for ~1 hour. Haven't been able to reproduce it. Are you still seeing it on more recent versions?

Yep, still seeing the same thing with 8225f60fe74c088ca570b2ba8f28a9a4c4ea681f for clj-manifold3d and a fork of f432040 for the manifold java bindings (the fork is to compile locally without homebrew deps).