wpilibsuite / PathWeaver

Desktop application for generating motion paths
Other
64 stars 68 forks source link

Cannot open PathWeaver projects due to JPEG library error #246

Closed Boomaa23 closed 3 years ago

Boomaa23 commented 3 years ago

Description I cannot open any PathWeaver projects. The welcome screen shows up but when I click on the recent project or try to import/create a new one, nothing happens. Digging into the logs, it appears that the issue lies with the 2019-field.jpg file not being read by the jpeg library because of this error: Wrong JPEG library version: library is 80, caller expects 70.

Solution I changed the .jpg images in src/main/resources/ to .png and updated the associated jsons, then ran the project through gradlew. Not an ideal solution and does not address the bug, but it works (see fork commit here).

Error log Pastebin: https://pastebin.com/z1KwrMuh

Troubleshooting steps tried

Desktop

prateekma commented 3 years ago

What happens if you launch PathWeaver from VS Code using the "Open Tool" menu (when you click the 3 dots in the upper right-hand corner)? This uses the JDK that we install and is technically the only supported way to launch it (besides running ~/wpilib/2021/tools/PathWeaver.py).

calcmogul commented 3 years ago

It works on my Arch machine. Have you tried libjpeg-turbo?

Boomaa23 commented 3 years ago

Tried libjpeg-turbo, opening via python, and via VS Code. Still same result and error.

calcmogul commented 3 years ago

Hm... there must have been a recent ABI update. I can't create new projects in PathWeaver anymore either.

calcmogul commented 3 years ago

@Boomaa23 I don't see a libjpeg7 package in the AUR. How did you install it?

Boomaa23 commented 3 years ago

@calcmogul I just ran git clone https://aur.archlinux.org/libjpeg7.git and installed as usual. I don't use a package manager for AUR and it seemed to build fine. I did try to look for it on the package list and it wasn't there though, not sure what that's about.

calcmogul commented 3 years ago

Weird that that package doesn't exist in the search results.

calcmogul commented 3 years ago

If I install that libjpeg7 package, running

LD_PRELOAD=/usr/lib/libjpeg.so.7 ./jdk/bin/jar -jar tools/PathWeaver.jar

from ~/wpilib/2021 works. I verified it was loaded by opening the associated maps file for the process's /proc entry and looking for libjpeg.so.7.

nvim /proc/`pgrep java`/maps

Force-loading ./jdk/lib/libjpeg.so with

LD_PRELOAD="./jdk/lib/libjpeg.so ./jdk/lib/server/libjvm.so" ./jdk/bin/java -jar tools/PathWeaver.jar

failed because it wants libjpeg version 70 specifically. JavaFX seems to load the default libjpeg version via libjpeg.so. On my machine, libjpeg.so is symlinked to libjpeg.so.8 instead of libjpeg.so.7.

calcmogul commented 3 years ago

Here's a patched ~/wpilib/2021/tools/PathWeaver.py that'll set LD_PRELOAD to the right thing on Linux.

PathWeaver.py.txt

Boomaa23 commented 3 years ago

Works perfectly! Thanks @calcmogul.