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

Closed
1 of 2 tasks
inancgumus opened this issue Sep 6, 2024 · 6 comments
Closed
1 of 2 tasks

getOwnerFrame nil pointer #1416

inancgumus opened this issue Sep 6, 2024 · 6 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
@ankur22 ankur22 mentioned this issue Sep 20, 2024
3 tasks
@joanlopez
Copy link

Found another NPD that @ankur22 suggests it's similar to this one. Here are the details:

  • Test Run ID: 3363010
  • k6 browser version: 1.8.5
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x15924a8]

goroutine 368053 [running]:
go.opentelemetry.io/otel/sdk/trace.(*recordingSpan).End.deferwrap1()
go.opentelemetry.io/otel/[email protected]/trace/span.go:398 +0x25
go.opentelemetry.io/otel/sdk/trace.(*recordingSpan).End(0xc043cfcb60, {0x0, 0x0, 0xc01a2ae8c0?})
go.opentelemetry.io/otel/[email protected]/trace/span.go:436 +0xa62
panic({0x1922540?, 0x2eb2e90?})
runtime/panic.go:785 +0x132
github.com/grafana/xk6-browser/common.(*screenshotter).screenshot(0xc049415eb0, {0x1f2ac00, 0xc014e5a0a0}, 0x0, 0xc049415ca8, {0x1bae2fb, 0x3}, 0x0, 0xc010762600?, {0xc013f74840, ...})
github.com/grafana/[email protected]/common/screenshotter.go:185 +0x328
github.com/grafana/xk6-browser/common.(*screenshotter).screenshotPage(0xc049415eb0, 0xc01ce864e0, 0xc010762580)
github.com/grafana/[email protected]/common/screenshotter.go:398 +0x334
github.com/grafana/xk6-browser/common.(*Page).Screenshot(0xc01ce864e0, 0xc010762580, {0x7f7cc4265108, 0xc001078540})
github.com/grafana/[email protected]/common/page.go:1146 +0x2c6
github.com/grafana/xk6-browser/browser.mapPage.func34.1()
github.com/grafana/[email protected]/browser/page_mapping.go:255 +0x4e
github.com/grafana/xk6-browser/k6ext.promise.func1()
github.com/grafana/[email protected]/k6ext/promise.go:41 +0x5a
created by github.com/grafana/xk6-browser/k6ext.promise in goroutine 108
github.com/grafana/[email protected]/k6ext/promise.go:40 +0xe6

Thanks! 🙇🏻

@ankur22
Copy link
Collaborator

ankur22 commented Nov 1, 2024

@joanlopez, sorry, at the time I gave you the wrong issue, i meant #1056 🤦 Now we have a dedicated issue #1502.

@ankur22
Copy link
Collaborator

ankur22 commented Nov 1, 2024

@inancgumus I believe we can close this. I've not seen this issue since the fix. WDYT?

@inancgumus
Copy link
Member Author

Sure, we can resurrect it if it happens again.

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

3 participants