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

javascript Handler panic with rs.SetUservar #33

Open
julianfrank opened this issue Sep 11, 2017 · 1 comment
Open

javascript Handler panic with rs.SetUservar #33

julianfrank opened this issue Sep 11, 2017 · 1 comment

Comments

@julianfrank
Copy link

I tried the example provided

// JavaScript Object Macro Examples
! version = 2.0
> object setvar javascript
	// Example of how to get the current user's ID and set
	// variables for them.
	var uid = rs.CurrentUser();
	var name  = args[0];
	var value = args[1];
	rs.SetUservar(uid, name, value);
< object
+ javascript set * to *
- Set user variable <star1> to <star2>.<call>setvar <star1> <star2></call>

but it only ends in panic

http: panic serving [::1]:54453: reflect: Call using []interface {} as type string
goroutine 40 [running]:
net/http.(*conn).serve.func1(0xc042270000)
        E:/dev/bin/go/src/net/http/server.go:1721 +0xd7
panic(0x8a0400, 0xc042284090)
        E:/dev/bin/go/src/runtime/panic.go:489 +0x2dd
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.catchPanic.func1(0xc0422ee750)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/error.go:240 +0x3de
panic(0x8a0400, 0xc042284090)
        E:/dev/bin/go/src/runtime/panic.go:489 +0x2dd
reflect.Value.call(0x8b7f20, 0xc0421b50e0, 0x13, 0x93fd98, 0x4, 0xc042119a90, 0x3, 0x3, 0x942b91, 0x8a0400, ...)
        E:/dev/bin/go/src/reflect/value.go:371 +0x109b
reflect.Value.Call(0x8b7f20, 0xc0421b50e0, 0x13, 0xc042119a90, 0x3, 0x3, 0xc042284080, 0x98, 0x40ed49)
        E:/dev/bin/go/src/reflect/value.go:302 +0xab
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).toValue.func1(0xc042198000, 0x0, 0x0, 0x5, 0x92ff00, 0
xc0422ad6e0, 0xc0422ada40, 0x3, 0x4, 0xc0421132f0, ...)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/runtime.go:403 +0x6e7
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_object).call(0xc0422adb00, 0x5, 0x92ff00, 0xc0422ad6e0, 0xc0422
ada40, 0x3, 0x4, 0x0, 0xc04229d5f0, 0x0, ...)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/type_function.go:140 +0x1bf
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).cmpl_evaluate_nodeCallExpression(0xc042198000, 0xc0422
9d8f0, 0x0, 0x0, 0x0, 0xc04200bf50, 0xc0422eda00, 0x40d036)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/cmpl_evaluate_expression.go:244 +0x55e
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).cmpl_evaluate_nodeExpression(0xc042198000, 0xbb2180, 0
xc04229d8f0, 0x8a0400, 0xc04200bf50, 0x6ed7a2)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/cmpl_evaluate_expression.go:44 +0x79b
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).cmpl_evaluate_nodeStatement(0xc042198000, 0xbb2300, 0x
c0422aaa80, 0x0, 0x0, 0x0)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go:62 +0x11a4
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).cmpl_evaluate_nodeStatementList(0xc042198000, 0xc0422a
8980, 0x2, 0x2, 0xc0425a9ed0, 0x470604, 0x8f5a60)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go:121 +0x7c
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).cmpl_evaluate_nodeStatement(0xc042198000, 0xbb20c0, 0x
c0422a89a0, 0x0, 0x0, 0x0)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go:30 +0x6ef
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).cmpl_call_nodeFunction(0xc042198000, 0xc0422ad1a0, 0xc
042135f20, 0xc0421cb400, 0x5, 0x92ff00, 0xc042188120, 0xc042135ef0, 0x2, 0x2, ...)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/cmpl_evaluate.go:61 +0x4fb
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_object).call(0xc0422ad1a0, 0x5, 0x92ff00, 0xc042188120, 0xc0421
35ef0, 0x2, 0x2, 0xc04200be00, 0x0, 0x0, ...)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/type_function.go:157 +0x74d
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.(*_runtime).cmpl_evaluate_nodeCallExpression(0xc042198000, 0xc0421
35e90, 0xc0425aa9f0, 0x2, 0x2, 0x755e55, 0xc0425aa728, 0xc0425aa720)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/cmpl_evaluate_expression.go:244 +0x55e
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.Otto.Call.func2()
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/otto.go:482 +0x62
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.catchPanic(0xc0425aa830, 0x0, 0x0)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/error.go:243 +0x73
github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto.Otto.Call(0x0, 0xc042198000, 0xc04200bbe0, 0xd, 0x0, 0x0, 0xc0425a
a9f0, 0x2, 0x2, 0x0, ...)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/vendor/github.com/robertkrimen/otto/otto.go:483 +0x7df
github.com/aichaos/rivescript-go/lang/javascript.JavaScriptHandler.Call(0xc0421132f0, 0xc042196000, 0xc0421b4ba0, 0xc042122361, 0x6, 0x
c042135db0, 0x2, 0x2, 0x1, 0xc0421c4000)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/lang/javascript/javascript.go:102 +0x466
github.com/aichaos/rivescript-go/lang/javascript.(*JavaScriptHandler).Call(0xc04217c140, 0xc042122361, 0x6, 0xc042135db0, 0x2, 0x2, 0x3
, 0xc042122340)
        <autogenerated>:2 +0x9e
github.com/aichaos/rivescript-go.(*RiveScript).processTags(0xc042196000, 0xc0422ba8e3, 0x2, 0xc0421e8f80, 0xf, 0xc042122340, 0x34, 0xc0
422a38a0, 0x2, 0x2, ...)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/tags.go:511 +0x3653
github.com/aichaos/rivescript-go.(*RiveScript).getReply(0xc042196000, 0xc0422ba8e3, 0x2, 0xc0421e8f80, 0xf, 0x0, 0x0, 0xc042118323, 0x4
, 0x0, ...)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/brain.go:411 +0xcc8
github.com/aichaos/rivescript-go.(*RiveScript).Reply(0xc042196000, 0xc0422ba8e3, 0x2, 0xc0421e8f80, 0xf, 0xc0422ba8ef, 0x3, 0xffffffff,
 0x15)
        E:/dev/code/go/src/github.com/aichaos/rivescript-go/brain.go:43 +0x515
main.RawIntentHandler(0xbb8480, 0xc042196460, 0xc04203ac00)
        net/http.HandlerFunc.ServeHTTP(0x95a458, 0xbb8480, 0xc042196460, 0xc04203ac00)
        E:/dev/bin/go/src/net/http/server.go:1942 +0x4b
main.Logger.func1(0xbb8480, 0xc042196460, 0xc04203ac00)
net/http.HandlerFunc.ServeHTTP(0xc0422b6040, 0xbb8480, 0xc042196460, 0xc04203ac00)
        E:/dev/bin/go/src/net/http/server.go:1942 +0x4b
github.com/gorilla/mux.(*Router).ServeHTTP(0xc04213efa0, 0xbb8480, 0xc042196460, 0xc04203ac00)
        E:/dev/code/go/src/github.com/gorilla/mux/mux.go:114 +0x113
net/http.serverHandler.ServeHTTP(0xc04215c0b0, 0xbb8480, 0xc042196460, 0xc042154100)
        E:/dev/bin/go/src/net/http/server.go:2568 +0x99
net/http.(*conn).serve(0xc042270000, 0xbb8c80, 0xc042012580)
        E:/dev/bin/go/src/net/http/server.go:1825 +0x619
created by net/http.(*Server).Serve
        E:/dev/bin/go/src/net/http/server.go:2668 +0x2d5
@kirsle
Copy link
Member

kirsle commented Sep 11, 2017

I'll have to debug it and see if I'm doing something wrong with Otto, cuz most of that stack trace is in their code.

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