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

getOwnerFrame nil pointer #1416

Open
2 tasks
inancgumus opened this issue Sep 6, 2024 · 2 comments
Open
2 tasks

getOwnerFrame nil pointer #1416

inancgumus opened this issue Sep 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@inancgumus
Copy link
Member

inancgumus commented Sep 6, 2024

What?

Panic occurs while running page.getOwnerFrame, here:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x138 pc=0x154713f]

goroutine 3623769 [running]:
github.com/grafana/xk6-browser/common.(*Page).getOwnerFrame(0xc04ef1fba0, {0x1eee958, 0xc133120cb0}, 0xc015ca2370)
github.com/grafana/[email protected]/common/page.go:489 +0x6bf
github.com/grafana/xk6-browser/common.(*ElementHandle).ownerFrame(0xc015ca2370, {0x1eee958?, 0xc133120cb0?})
github.com/grafana/[email protected]/common/element_handle.go:431 +0x45
github.com/grafana/xk6-browser/common.(*ElementHandle).checkHitTargetAt(0xc015ca2370, {0x1eee958?, 0xc133120cb0?}, {0x4084000000000000, 0x407cdf8000000000})
github.com/grafana/[email protected]/common/element_handle.go:67 +0x49
github.com/grafana/xk6-browser/common.(*ElementHandle).newPointerAction.func1({0x1eee958, 0xc133120cb0}, 0x0?)
github.com/grafana/[email protected]/common/element_handle.go:1621 +0x532
github.com/grafana/xk6-browser/common.retryPointerAction({0x1eee958, 0xc133120cb0}, 0xc1854851a0, 0xc06e7e01e0)
github.com/grafana/[email protected]/common/element_handle.go:1660 +0x3c
github.com/grafana/xk6-browser/common.(*ElementHandle).newPointerAction.func2({0x1eee958?, 0xc133120cb0?}, 0xc01f554ba0, 0xc01f554c60)
github.com/grafana/[email protected]/common/element_handle.go:1648 +0x45
github.com/grafana/xk6-browser/common.(*Frame).click.(*Frame).newPointerAction.func2({0x1eee958, 0xc133120cb0}, 0xc01f554ba0, 0xc01f554c60)
github.com/grafana/[email protected]/common/frame.go:2181 +0x116
created by github.com/grafana/xk6-browser/common.call in goroutine 3623768
github.com/grafana/[email protected]/common/helpers.go:103 +0x14c

  • Test Run ID: 3207658
  • k6 browser version: 1.7.1

Why?

Needs to be investigated.

How?

No response

Tasks

Tasks

Related PR(s)/Issue(s)

No response

@inancgumus inancgumus added the bug Something isn't working label Sep 6, 2024
@ankur22
Copy link
Collaborator

ankur22 commented Sep 20, 2024

I've investigated this issue and compared it with Playwright. Here are my findings:

The NPD currently can occur in getOwnerFrame. In Playwright, fortunately, they have an equivalent method and they actually check for null.

I think the safest option is to protect against a NPD here by also checking for null. Unfortunately, i've not been able to replicate the issue in the first place.

WDYT @inancgumus?

@inancgumus
Copy link
Member Author

@ankur22 Sounds good to me 👍

@ankur22 ankur22 self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants