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

segmentation violation after connection to browser is lost #1103

Open
williamoliveira opened this issue Aug 20, 2024 · 1 comment
Open

segmentation violation after connection to browser is lost #1103

williamoliveira opened this issue Aug 20, 2024 · 1 comment
Labels
bug When you are sure about it's a bug

Comments

@williamoliveira
Copy link

williamoliveira commented Aug 20, 2024

Rod Version: v0.116.2

I am connecting to an remote chrome via the ws endpoint. When it loses connection to the browser and I try to call a method without knowing it is disconnected, I get a panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x90 pc=0x105070180]

goroutine 1908 [running]:
github.com/go-rod/rod.(*Page).getJSCtxID(0x0?)
        /Users/williamoliveira/go/pkg/mod/github.com/go-rod/[email protected]/page_eval.go:325 +0x30
github.com/go-rod/rod.(*Page).evaluate(0x0, 0x140005af850)
        /Users/williamoliveira/go/pkg/mod/github.com/go-rod/[email protected]/page_eval.go:164 +0xc0
github.com/go-rod/rod.(*Page).Evaluate(0x0, 0x140005af850)
        /Users/williamoliveira/go/pkg/mod/github.com/go-rod/[email protected]/page_eval.go:129 +0x48
@ysmood ysmood added the bug When you are sure about it's a bug label Aug 22, 2024
@ysmood
Copy link
Member

ysmood commented Oct 17, 2024

If you don't use Must prefixed function, you won't get this panic:

https://go-rod.github.io/#/error-handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug When you are sure about it's a bug
Projects
None yet
Development

No branches or pull requests

2 participants