Skip to content
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

RangeError when opening .glft files #2319

Closed
cartesian-theatrics opened this issue Sep 24, 2023 · 14 comments
Closed

RangeError when opening .glft files #2319

cartesian-theatrics opened this issue Sep 24, 2023 · 14 comments

Comments

@cartesian-theatrics
Copy link

cartesian-theatrics commented Sep 24, 2023

Hello,

I'm trying to use Calva in combination with gLTF Tools plugin. As soon as a preview (i.e. render in a webview) a .glft file within or outside the project, the calva repl hangs with:

; RangeError: Maximum call stack size exceeded

I've looked through the configuration options and tried add to all the the .*ignore files I could think of, but no luck. Is there any way to tell Calva to ignore these files?

@PEZ
Copy link
Collaborator

PEZ commented Sep 29, 2023

Hi! Thanks for reporting and sorry for the delayed response!

I'm surprised Calva would care at all about .gltf files, or that it would have any impact on the Calva repl.

Can you make a reproduction project for this, with the setup, assets, and instructions for how to reproduce? I'm sure the gLTF Tools developers would be interested as well. This seems to happen in the intersection between two extensions, which I think is quite uncommon.

@cartesian-theatrics
Copy link
Author

To reproduce:

  1. Launch this dev container: https://github.com/SovereignShop/plexus-demo
  2. Launch the repl
  3. Write a model.glb file (first form in core.clj)
  4. Right click on model.glb and select "glTF: import from GLB".

You'll find it bricks the Calva repl until you restart VSCode.

@PEZ
Copy link
Collaborator

PEZ commented Oct 17, 2023

Hello again. And new appologies for slow response times....

I now tried this and fail to launch the repl. I'm unfamiliar with dev container. VS Code asks me if I want to open the folder in a dev container and i say yes. Then after jacking in and evaluating the ns form in src/main/plexus_demo/core.clj I get:

; ERROR: Unhandled REPL handler exception processing message {:op stacktrace, :id 13, :session 6c87258a-2cbf-48d2-8126-a18f1f560bec}
; java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class manifold3d.Manifold

I've also tried to start the repl from the command line in the docker container. But I get the same error.

I'm guessing I am doing something wrong. Can you tell what it is from my description of what I do?

@cartesian-theatrics
Copy link
Author

cartesian-theatrics commented Dec 15, 2023

Sorry I missed your response. It doesn't look like you did anything wrong. I'm not sure what happened there. I've updated the dependencies and just rebuilt from scratch. It should work now (launch dev container with "reopen in container" command). Of course make sure to jack-in as a deps.edn project.

@PEZ
Copy link
Collaborator

PEZ commented Dec 17, 2023

I still get the same error. Maybe it is something with that the manifold dependency looks like so:

org.clojars.cartesiantheatrics/manifold3d$linux-cuda-x86_64 {:mvn/version "1.0.72"}
        org.clojars.cartesiantheatrics/plexus {:mvn/version "0.0.9"}

I am on a Mac. But I am running it in a container so maybe it should work with a linux dependency...

@cartesian-theatrics
Copy link
Author

cartesian-theatrics commented Dec 21, 2023

Hmm, that's odd I just tried on a new computer. Perhaps another way to reproduce this issue is to just download a random .glb or .gltf (like this) and try to open it with gLTF Tools plugin.

p.s. if you don't mind, could you possibly share the full stack trace for the error you're seeing? I'd like to identify the issue.

@PEZ
Copy link
Collaborator

PEZ commented Dec 21, 2023

This is *e:

#error {
 :cause "/tmp/libmeshIO16871626039296534131.so: /tmp/libmeshIO16871626039296534131.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)"
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message "Syntax error macroexpanding at (clj_manifold3d/impl.clj:18:1)."
   :data #:clojure.error{:phase :execution, :line 18, :column 1, :source "clj_manifold3d/impl.clj"}
   :at [clojure.lang.Compiler load "Compiler.java" 7665]}
  {:type java.lang.UnsatisfiedLinkError
   :message "/tmp/libmeshIO16871626039296534131.so: /tmp/libmeshIO16871626039296534131.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)"
   :at [jdk.internal.loader.NativeLibraries load "NativeLibraries.java" -2]}]
 :trace
 [[jdk.internal.loader.NativeLibraries load "NativeLibraries.java" -2]
  [jdk.internal.loader.NativeLibraries$NativeLibraryImpl open "NativeLibraries.java" 388]
  [jdk.internal.loader.NativeLibraries loadLibrary "NativeLibraries.java" 232]
  [jdk.internal.loader.NativeLibraries loadLibrary "NativeLibraries.java" 174]
  [java.lang.ClassLoader loadLibrary "ClassLoader.java" 2394]
  [java.lang.Runtime load0 "Runtime.java" 755]
  [java.lang.System load "System.java" 1953]
  [manifold3d.Manifold <clinit> "Manifold.java" 47]
  [java.lang.Class forName0 "Class.java" -2]
  [java.lang.Class forName "Class.java" 467]
  [clojure.lang.RT classForName "RT.java" 2209]
  [clojure.lang.RT classForName "RT.java" 2218]
  [clj_manifold3d.impl$eval5950 <clinit> "impl.clj" 18]
  [jdk.internal.reflect.NativeConstructorAccessorImpl newInstance0 "NativeConstructorAccessorImpl.java" -2]
  [jdk.internal.reflect.NativeConstructorAccessorImpl newInstance "NativeConstructorAccessorImpl.java" 77]
  [jdk.internal.reflect.DelegatingConstructorAccessorImpl newInstance "DelegatingConstructorAccessorImpl.java" 45]
  [java.lang.reflect.Constructor newInstanceWithCaller "Constructor.java" 499]
  [java.lang.reflect.Constructor newInstance "Constructor.java" 480]
  [clojure.lang.Compiler$ObjExpr eval "Compiler.java" 5008]
  [clojure.lang.Compiler eval "Compiler.java" 7193]
  [clojure.lang.Compiler eval "Compiler.java" 7183]
  [clojure.lang.Compiler load "Compiler.java" 7653]
  [clojure.lang.RT loadResourceScript "RT.java" 381]
  [clojure.lang.RT loadResourceScript "RT.java" 372]
  [clojure.lang.RT load "RT.java" 459]
  [clojure.lang.RT load "RT.java" 424]
  [clojure.core$load$fn__6908 invoke "core.clj" 6161]
  [clojure.core$load invokeStatic "core.clj" 6160]
  [clojure.core$load doInvoke "core.clj" 6144]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [clojure.core$load_one invokeStatic "core.clj" 5933]
  [clojure.core$load_one invoke "core.clj" 5928]
  [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
  [clojure.core$load_lib invokeStatic "core.clj" 5974]
  [clojure.core$load_lib doInvoke "core.clj" 5953]
  [clojure.lang.RestFn applyTo "RestFn.java" 142]
  [clojure.core$apply invokeStatic "core.clj" 669]
  [clojure.core$load_libs invokeStatic "core.clj" 6016]
  [clojure.core$load_libs doInvoke "core.clj" 6000]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.core$apply invokeStatic "core.clj" 669]
  [clojure.core$require invokeStatic "core.clj" 6038]
  [clojure.core$require doInvoke "core.clj" 6038]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [clj_manifold3d.core$eval5803$loading__6789__auto____5804 invoke "core.cljc" 1]
  [clj_manifold3d.core$eval5803 invokeStatic "core.cljc" 1]
  [clj_manifold3d.core$eval5803 invoke "core.cljc" 1]
  [clojure.lang.Compiler eval "Compiler.java" 7194]
  [clojure.lang.Compiler eval "Compiler.java" 7183]
  [clojure.lang.Compiler load "Compiler.java" 7653]
  [clojure.lang.RT loadResourceScript "RT.java" 381]
  [clojure.lang.RT loadResourceScript "RT.java" 372]
  [clojure.lang.RT load "RT.java" 459]
  [clojure.lang.RT load "RT.java" 424]
  [clojure.core$load$fn__6908 invoke "core.clj" 6161]
  [clojure.core$load invokeStatic "core.clj" 6160]
  [clojure.core$load doInvoke "core.clj" 6144]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [clojure.core$load_one invokeStatic "core.clj" 5933]
  [clojure.core$load_one invoke "core.clj" 5928]
  [clojure.core$load_lib$fn__6850 invoke "core.clj" 5975]
  [clojure.core$load_lib invokeStatic "core.clj" 5974]
  [clojure.core$load_lib doInvoke "core.clj" 5953]
  [clojure.lang.RestFn applyTo "RestFn.java" 142]
  [clojure.core$apply invokeStatic "core.clj" 669]
  [clojure.core$load_libs invokeStatic "core.clj" 6016]
  [clojure.core$load_libs doInvoke "core.clj" 6000]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.core$apply invokeStatic "core.clj" 669]
  [clojure.core$require invokeStatic "core.clj" 6038]
  [clojure.core$require doInvoke "core.clj" 6038]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [plexus_demo.core$eval5795$loading__6789__auto____5796 invoke "core.clj" 1]
  [plexus_demo.core$eval5795 invokeStatic "core.clj" 1]
  [plexus_demo.core$eval5795 invoke "core.clj" 1]
  [clojure.lang.Compiler eval "Compiler.java" 7194]
  [clojure.lang.Compiler eval "Compiler.java" 7183]
  [clojure.lang.Compiler load "Compiler.java" 7653]
  [user$eval5791 invokeStatic "NO_SOURCE_FILE" 1]
  [user$eval5791 invoke "NO_SOURCE_FILE" 1]
  [clojure.lang.Compiler eval "Compiler.java" 7194]
  [clojure.lang.Compiler eval "Compiler.java" 7149]
  [clojure.core$eval invokeStatic "core.clj" 3215]
  [clojure.core$eval invoke "core.clj" 3211]
  [nrepl.middleware.interruptible_eval$evaluate$fn__1265$fn__1266 invoke "interruptible_eval.clj" 87]
  [clojure.lang.AFn applyToHelper "AFn.java" 152]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$with_bindings_STAR_ invokeStatic "core.clj" 1990]
  [clojure.core$with_bindings_STAR_ doInvoke "core.clj" 1990]
  [clojure.lang.RestFn invoke "RestFn.java" 425]
  [nrepl.middleware.interruptible_eval$evaluate$fn__1265 invoke "interruptible_eval.clj" 87]
  [clojure.main$repl$read_eval_print__9206$fn__9209 invoke "main.clj" 437]
  [clojure.main$repl$read_eval_print__9206 invoke "main.clj" 437]
  [clojure.main$repl$fn__9215 invoke "main.clj" 458]
  [clojure.main$repl invokeStatic "main.clj" 458]
  [clojure.main$repl doInvoke "main.clj" 368]
  [clojure.lang.RestFn invoke "RestFn.java" 1523]
  [nrepl.middleware.interruptible_eval$evaluate invokeStatic "interruptible_eval.clj" 84]
  [nrepl.middleware.interruptible_eval$evaluate invoke "interruptible_eval.clj" 56]
  [nrepl.middleware.interruptible_eval$interruptible_eval$fn__1298$fn__1302 invoke "interruptible_eval.clj" 152]
  [clojure.lang.AFn run "AFn.java" 22]
  [nrepl.middleware.session$session_exec$main_loop__1368$fn__1372 invoke "session.clj" 218]
  [nrepl.middleware.session$session_exec$main_loop__1368 invoke "session.clj" 217]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.lang.Thread run "Thread.java" 840]]}

@cartesian-theatrics
Copy link
Author

cartesian-theatrics commented Dec 21, 2023

I see, thanks for sharing. There may be a bug with the CUDA support version not correctly falling back to CPU with your card . Using the classifier linux-x86 might fix it, alternatively the classifier mac-x86 should work for macs without needing to launch a container. Not sure tho as I don't have a mac.

Feel free to close this one. It's a pretty minor issue. I found another plugin for rendering .glb files that has been working adequately for now.

@PEZ
Copy link
Collaborator

PEZ commented Dec 21, 2023

I'm not too familiar with 3D modeling. But I have some glb files lying around. So the problem should be reproducible with those?

@PEZ
Copy link
Collaborator

PEZ commented Dec 21, 2023

I could import the glb without issue. But since the repl isn't really functional to begin with maybe it doesn't expose the problem. I'll try in another project.

@PEZ
Copy link
Collaborator

PEZ commented Dec 21, 2023

I can reproduce it now. It's as easy as opening a .gltf file as json. I guess that involves the gLTF Tools extension enough.

I'll try to create a minimal reproduction project.

@PEZ
Copy link
Collaborator

PEZ commented Dec 21, 2023

Here's a repro: https://github.com/PEZ/gltf-tools-repl-killer

I think this should be brought to the gLTF Tools extension authors. Will do that later if you haven't beaten me to it. Now need to run.

@PEZ
Copy link
Collaborator

PEZ commented Dec 21, 2023

I managed to track down where things were failing in Calva and could remove the conflicting area from the picture. I really have no idea why the glTF Tools extension would have this effect on Calva, but now, with Calva v2.0.405, it's not a problem anymore.

Thanks for reporting this problem! I think I will investigate it a bit further to see if I can understand what was happening.

@PEZ
Copy link
Collaborator

PEZ commented Dec 21, 2023

I could easily create a tiny extension that exposes the problem: https://github.com/PEZ/bencoder

Reported the issue here:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants