Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

playground: Panic test #117

Open
avelino opened this issue Feb 8, 2018 · 0 comments
Open

playground: Panic test #117

avelino opened this issue Feb 8, 2018 · 0 comments

Comments

@avelino
Copy link
Member

avelino commented Feb 8, 2018

I'm forcing a case that should generate panic, we must treat the not return Go traceback.

Input:

(*int64 1.0 2.0)

Output:

>> (*int64 1.0 2.0)

Err: runtime error: Panic[0] - reflect: cannot use float64 as type int64 in Call # triggered at: (*int64 1.0 2.0) ^ # Interpreter trace: goroutine 43 [running]: github.com/rumlang/rum/runtime.(*Context).eval.func1.1(0xc4202b5758, 0xc4202b5728) /home/avelino/src/github.com/rumlang/rum/runtime/runtime.go:204 +0x90 panic(0x709460, 0xc4202188f0) /usr/lib/go-1.9/src/runtime/panic.go:491 +0x283 reflect.Value.call(0x714580, 0x79fbf0, 0x13, 0x7859af, 0x4, 0xc42020ecc0, 0x2, 0x2, 0x71d440, 0x714580, ...) /usr/lib/go-1.9/src/reflect/value.go:382 +0x113c reflect.Value.Call(0x714580, 0x79fbf0, 0x13, 0xc42020ecc0, 0x2, 0x2, 0x1, 0x2, 0xc42024a9c0) /usr/lib/go-1.9/src/reflect/value.go:302 +0xa4 github.com/rumlang/rum/runtime.(*Context).dispatch(0xc42024a3a0, 0x9351e0, 0xc42024abe0, 0xc4202b5728, 0xc42024e720, 0x702f40, 0xc42024ac00) /home/avelino/src/github.com/rumlang/rum/runtime/runtime.go:176 +0x5ea github.com/rumlang/rum/runtime.(*Context).eval.func1(0xc4202b5758, 0xc4202b5728, 0xc4202b5718, 0xc4202b5738, 0xc42024a3a0, 0x9351e0, 0xc42024abe0) /home/avelino/src/github.com/rumlang/rum/runtime/runtime.go:207 +0x7d github.com/rumlang/rum/runtime.(*Context).eval(0xc42024a3a0, 0x9351e0, 0xc42024abe0, 0x10, 0x733ca0, 0x1, 0xc4202188c0) /home/avelino/src/github.com/rumlang/rum/runtime/runtime.go:208 +0xeb github.com/rumlang/rum/runtime.(*Context).TryEval(0xc42024a3a0, 0x9351e0, 0xc42024abe0, 0x0, 0x0, 0x7873b5, 0x6) /home/avelino/src/github.com/rumlang/rum/runtime/runtime.go:232 +0x3f github.com/rumlang/playground/forms.rumEval(0xc420210590, 0x10, 0xc42024a3a0, 0xc420214750, 0x21, 0x0) /home/avelino/src/github.com/rumlang/playground/forms/home.go:29 +0x94 github.com/rumlang/playground/forms.runRumRepl(0xc420260280, 0xc42012a580, 0xc420218750, 0x1, 0x1) /home/avelino/src/github.com/rumlang/playground/forms/home.go:99 +0x1f3 github.com/trumae/valente.FormImpl.Run(0xc42020e690, 0xc420260280, 0xc42012a580, 0x0, 0x0) /home/avelino/src/github.com/trumae/valente/valente.go:77 +0x391 github.com/trumae/valente.(*App).Run(0xc42012a580) /home/avelino/src/github.com/trumae/valente/valente.go:150 +0x6e main.main.func2(0x935120, 0xc42021c540, 0xc420250600) /home/avelino/src/github.com/rumlang/playground/main.go:141 +0x580 net/http.HandlerFunc.ServeHTTP(0x79fce8, 0x935120, 0xc42021c540, 0xc420250600) /usr/lib/go-1.9/src/net/http/server.go:1918 +0x44 net/http.(*ServeMux).ServeHTTP(0x96c9a0, 0x935120, 0xc42021c540, 0xc420250600) /usr/lib/go-1.9/src/net/http/server.go:2254 +0x130 net/http.serverHandler.ServeHTTP(0xc420085380, 0x935120, 0xc42021c540, 0xc420250600) /usr/lib/go-1.9/src/net/http/server.go:2619 +0xb4 net/http.(*conn).serve(0xc420256320, 0x9356e0, 0xc42012a840) /usr/lib/go-1.9/src/net/http/server.go:1801 +0x71d created by net/http.(*Server).Serve /usr/lib/go-1.9/src/net/http/server.go:2720 +0x288

Server output:


2018/02/08 19:47:57 currentForm = {map[run:0x6cbcf0 clean:0x6cc1a0]} msgs = [run]
2018/02/08 19:47:57 http: panic serving 201.6.226.29:4268: runtime error: invalid memory address or nil pointer dereference
goroutine 82 [running]:
net/http.(*conn).serve.func1(0xc420256000)
        /usr/lib/go-1.9/src/net/http/server.go:1697 +0xd0
panic(0x7280a0, 0x961fa0)
        /usr/lib/go-1.9/src/runtime/panic.go:491 +0x283
github.com/rumlang/playground/forms.runRumRepl(0xc4202603c0, 0xc42012a580, 0xc420010a20, 0x1, 0x1)
        /home/avelino/src/github.com/rumlang/playground/forms/home.go:104 +0x2cb
github.com/trumae/valente.FormImpl.Run(0xc42020e690, 0xc4202603c0, 0xc42012a580, 0xc420040a98, 0x405233)
        /home/avelino/src/github.com/trumae/valente/valente.go:77 +0x391
github.com/trumae/valente.(*App).Run(0xc42012a580)
        /home/avelino/src/github.com/trumae/valente/valente.go:150 +0x6e
main.main.func2(0x935120, 0xc42021c000, 0xc420250000)
        /home/avelino/src/github.com/rumlang/playground/main.go:141 +0x580
net/http.HandlerFunc.ServeHTTP(0x79fce8, 0x935120, 0xc42021c000, 0xc420250000)
        /usr/lib/go-1.9/src/net/http/server.go:1918 +0x44
net/http.(*ServeMux).ServeHTTP(0x96c9a0, 0x935120, 0xc42021c000, 0xc420250000)
        /usr/lib/go-1.9/src/net/http/server.go:2254 +0x130
net/http.serverHandler.ServeHTTP(0xc420085380, 0x935120, 0xc42021c000, 0xc420250000)
        /usr/lib/go-1.9/src/net/http/server.go:2619 +0xb4
net/http.(*conn).serve(0xc420256000, 0x9356e0, 0xc42012a080)
        /usr/lib/go-1.9/src/net/http/server.go:1801 +0x71d
created by net/http.(*Server).Serve
        /usr/lib/go-1.9/src/net/http/server.go:2720 +0x288
2018/02/08 19:47:59 Reusing session 87e65a39-8443-4271-8fe3-a5b251ca9407
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant