ten0s/syntaxerl

Crash when running

eproxus opened this issue · 9 comments

I get the following crash:

$ syntaxerl src/meck.erl
escript: exception error: no function clause matching 
                 syntaxerl:get_handler("src/meck.erl",undefined) (src/syntaxerl.erl, line 94)
  in function  syntaxerl:check_syntax/2 (src/syntaxerl.erl, line 40)
  in call from escript:run/2 (escript.erl, line 727)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1 
  in call from init:start_em/1 

Please perform the steps below. Do you still have the crash?

$ mkdir tmp
$ cd tmp
$ git clone git://github.com/eproxus/meck.git
$ git clone git://github.com/ten0s/syntaxerl.git
$ cd syntaxerl
$ make
$ ./syntaxerl ../meck/src/meck.erl

./meck/src/meck.erl:362: warning: missing specification for function called/3
../meck/src/meck.erl:386: warning: missing specification for function num_calls/3
../meck/src/meck.erl:462: warning: missing specification for function init/1
../meck/src/meck.erl:482: warning: missing specification for function handle_call/3
../meck/src/meck.erl:506: warning: missing specification for function handle_cast/2
../meck/src/meck.erl:512: warning: missing specification for function handle_info/2
../meck/src/meck.erl:515: warning: missing specification for function terminate/2
../meck/src/meck.erl:523: warning: missing specification for function code_change/3
../meck/src/meck.erl:526: warning: missing specification for function exec/5
../meck/src/meck.erl:893: warning: variable 'Binary2' exported from 'if' (line 887)

Yeah, running Erlang R15B01:

./syntaxerl ../meck/src/meck.erl 
escript: exception error: no function clause matching 
                 syntaxerl:get_handler("../meck/src/meck.erl",undefined) (src/syntaxerl.erl, line 94)
  in function  syntaxerl:check_syntax/2 (src/syntaxerl.erl, line 40)
  in call from escript:run/2 (escript.erl, line 727)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1 
  in call from init:start_em/

Could you run it once again with the debug option enabled and post your output?

$ ./syntaxerl -d ../meck/src/meck.erl

Not much new:

$ ./syntaxerl -d ../meck/src/meck.erl
DEBUG: Handlers: undefined
escript: exception error: no function clause matching 
                 syntaxerl:get_handler("../meck/src/meck.erl",undefined) (src/syntaxerl.erl, line 94)
  in function  syntaxerl:check_syntax/2 (src/syntaxerl.erl, line 40)
  in call from escript:run/2 (escript.erl, line 741)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1 
  in call from init:start_em/1 

Same issue on R15B02 as well.

zip:extract/2 in script_options/1 seems to return {ok,[]}...

Well, rebar is responsible for creating a zipped escript. I have two rebars:

  • globally installed: rebar 2.9.0 R15B01 20120808_104506 git RELEASE-1-973-g19d1ee2
  • included into the repository: rebar 2.0.0 R15B01 20120609_114219 git b1d06a4

And they both work for me.

I fixed Makefile to point directly to the local rebar
REBAR=./rebar
instead of first looking for a global one
REBAR=$(shell which rebar || echo ./rebar)

Please update the repository and try again.

BTW, what's your rebar version?

This fixes the problem.

I was running rebar 2.0.0 R15B01 20120918_125047 No VCS info available (installed via homebrew).

Great! Thanks for helping me with this.

My pleasure. :-)