kaitai-io / kaitai_struct_visualizer

Kaitai Struct: visualizer and hex viewer tool
https://rubygems.org/gems/kaitai-struct-visualizer
GNU General Public License v3.0
284 stars 25 forks source link

KSC crashes immediately due to unknown option -- #19

Open fridtjof opened 6 years ago

fridtjof commented 6 years ago

The java command line does not accept -- as an option, stopping before even executing KSC.

Java version: Oracle JDK 1.8.0_152 OS: macOS 10.13.2

Things work again after commenting line 34 in kaitai_struct_visualizer/lib/kaitai/struct/visualizer/ksy_compiler.rb

I have not opened a PR for this yet, as I am not sure if this was recently changed or has always been like this

GreyCat commented 6 years ago

Thanks! It seems that OS X get treated in the same way as Windows, then? Unfortunately, I can't check myself.

cugu commented 6 years ago

I had the same bug on macOS and @fridtjof's fix worked for me.

osterwood commented 6 years ago

Same issue for me on macOS 10.12. @fridtjof's fix worked for me

fridtjof commented 6 years ago

Turns out the homebrew formula installed its own launcher instead of ksc's launch wrapper. I submitted a PR to fix this, which should be merged soon: https://github.com/Homebrew/homebrew-core/pull/25967

tmillican commented 6 years ago

So here's a confusing thing:

The 0.8 homebrew formula always worked just fine with ksv for me, even though it wasn't using the official katai-struct-compiler launch script. But when I upgraded to the 0.8_1 formula today (containing the official launch script), ksv and ksdump both broke, with an obviously swallowed -d option. Apparently I'm backwards from the rest of the universe somehow. Go figure.

Rolling back to 0.8 was no problem, but no amount of brew switch-ing, brew upgrade-ing, or gem update-ing would get everything working correctly with 0.8_1. So in the spirit of DEAR PEOPLE FROM THE FUTURE, here's the "nuke it from orbit" approach that finally sorted it out for me:

brew update
brew uninstall --force kaitai-struct-compiler
rm /usr/local/bin/ksc
gem uninstall kaitai-struct-visualizer
gem uninstall kaitai-struct
brew install kaitai-struct-compiler
gem install kaitai-struct-visualizer

Say yes to removing ksv and ksdump when asked.

/usr/local/bin/ksc was a symlink to /usr/local/Cellar/kaitai-struct-compiler/0.8/bin/kaitai-struct-compiler that decided to hang around even after switching to 0.8_1 and uninstalling 0.8. Perhaps I made that symlink manually, but I don't know why I would. Deleting it didn't fix anything, but it certainly shouldn't exist, in any case.