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

Browser hangs for an unknown reason #1451

Closed
Tracked by #1460
ankur22 opened this issue Oct 1, 2024 · 2 comments
Closed
Tracked by #1460

Browser hangs for an unknown reason #1451

ankur22 opened this issue Oct 1, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Oct 1, 2024

Brief summary

Logger format: RAW
SIGQUIT: quit
PC=0x47ee21 m=0 sigcode=0

goroutine 0 gp=0x2ef61e0 m=0 mp=0x2ef7420 [idle]:
runtime.futex(0x2ef7560, 0x80, 0x0, 0x0, 0x0, 0x0)
	runtime/sys_linux_amd64.s:557 +0x21 fp=0x7fffd0bb3cc0 sp=0x7fffd0bb3cb8 pc=0x47ee21
runtime.futexsleep(0x7fffd0bb3d38?, 0x40f630?, 0x40f630?)
	runtime/os_linux.go:69 +0x30 fp=0x7fffd0bb3d10 sp=0x7fffd0bb3cc0 pc=0x437dd0
runtime.notesleep(0x2ef7560)
	runtime/lock_futex.go:170 +0x87 fp=0x7fffd0bb3d48 sp=0x7fffd0bb3d10 pc=0x40f7c7
runtime.mPark(...)
	runtime/proc.go:1866
runtime.stopm()
	runtime/proc.go:2885 +0x8c fp=0x7fffd0bb3d78 sp=0x7fffd0bb3d48 pc=0x4432ac
runtime.findRunnable()
	runtime/proc.go:3622 +0xd5c fp=0x7fffd0bb3ef0 sp=0x7fffd0bb3d78 pc=0x444d1c
runtime.schedule()
	runtime/proc.go:3995 +0xb1 fp=0x7fffd0bb3f28 sp=0x7fffd0bb3ef0 pc=0x445df1
runtime.park_m(0xc000006e00)
	runtime/proc.go:4102 +0x1eb fp=0x7fffd0bb3f80 sp=0x7fffd0bb3f28 pc=0x44620b
runtime.mcall()
	runtime/asm_amd64.s:459 +0x4e fp=0x7fffd0bb3f98 sp=0x7fffd0bb3f80 pc=0x47b16e

goroutine 1 gp=0xc0000061c0 m=nil [chan receive, 9 minutes]:
runtime.gopark(0x482e08?, 0x7f8afe1f3ca0?, 0x40?, 0x0?, 0x0?)
	runtime/proc.go:424 +0xce fp=0xc0004f4988 sp=0xc0004f4968 pc=0x474bce
runtime.chanrecv(0xc00028ec40, 0xc0004f4b78, 0x1)
	runtime/chan.go:639 +0x41c fp=0xc0004f4a00 sp=0xc0004f4988 pc=0x40a05c
runtime.chanrecv1(0x1f20b50?, 0xc00040b140?)
	runtime/chan.go:489 +0x12 fp=0xc0004f4a28 sp=0xc0004f4a00 pc=0x409c12
go.k6.io/k6/execution.(*Scheduler).Run(0xc0001c5000, {0x1f20b88, 0xc0000bfe50}, {0x1f20b50, 0xc0003756b0}, 0xc000275570)
	go.k6.io/k6/execution/scheduler.go:508 +0xcb4 fp=0xc0004f4fc0 sp=0xc0004f4a28 pc=0xa9ccd4
go.k6.io/k6/cmd.(*cmdRun).run(0xc00010b110, 0xc0002d0588, {0xc000224308, 0x1, 0x2d})
	go.k6.io/k6/cmd/run.go:397 +0x1545 fp=0xc0004f5c50 sp=0xc0004f4fc0 pc=0x17850a5
go.k6.io/k6/cmd.(*cmdRun).run-fm(0xc000307d00?, {0xc000224308?, 0x4?, 0x1bae6e0?})
	<autogenerated>:1 +0x34 fp=0xc0004f5c88 sp=0xc0004f5c50 pc=0x1790014
github.com/spf13/cobra.(*Command).execute(0xc0002d0588, {0xc000
... omitting 166650 bytes ...
0x474bce
runtime.selectgo(0xc000592f80, 0xc000592f78, 0x18d46c0?, 0x0, 0x18d4660?, 0x1)
	runtime/select.go:335 +0x7a5 fp=0xc000592f48 sp=0xc000592e20 pc=0x450865
github.com/grafana/xk6-browser/common.(*BaseEventEmitter).syncAll(0xc000515dc0, {0x1f20b88, 0xc000410e10})
	github.com/grafana/xk6-browser@v1.8.5/common/event_emitter.go:126 +0xa5 fp=0xc000592fb8 sp=0xc000592f48 pc=0x153db85
github.com/grafana/xk6-browser/common.NewBaseEventEmitter.gowrap1()
	github.com/grafana/xk6-browser@v1.8.5/common/event_emitter.go:116 +0x28 fp=0xc000592fe0 sp=0xc000592fb8 pc=0x153daa8
runtime.goexit({})
	runtime/asm_amd64.s:1700 +0x1 fp=0xc000592fe8 sp=0xc000592fe0 pc=0x47d021
created by github.com/grafana/xk6-browser/common.NewBaseEventEmitter in goroutine 157
	github.com/grafana/xk6-browser@v1.8.5/common/event_emitter.go:116 +0x195

goroutine 384 gp=0xc00076ce00 m=nil [select, 9 minutes]:
runtime.gopark(0xc0012cef90?, 0x2?, 0x30?, 0x70?, 0xc0012cef04?)
	runtime/proc.go:424 +0xce fp=0xc0012ced90 sp=0xc0012ced70 pc=0x474bce
runtime.selectgo(0xc0012cef90, 0xc0012cef00, 0x13?, 0x0, 0xc001443800?, 0x1)
	runtime/select.go:335 +0x7a5 fp=0xc0012ceeb8 sp=0xc0012ced90 pc=0x450865
github.com/grafana/xk6-browser/common.(*Session).readLoop(0xc00075e1e0)
	github.com/grafana/xk6-browser@v1.8.5/common/session.go:83 +0x99 fp=0xc0012cefc8 sp=0xc0012ceeb8 pc=0x1594df9
github.com/grafana/xk6-browser/common.NewSession.gowrap1()
	github.com/grafana/xk6-browser@v1.8.5/common/session.go:47 +0x25 fp=0xc0012cefe0 sp=0xc0012cefc8 pc=0x1594b05
runtime.goexit({})
	runtime/asm_amd64.s:1700 +0x1 fp=0xc0012cefe8 sp=0xc0012cefe0 pc=0x47d021
created by github.com/grafana/xk6-browser/common.NewSession in goroutine 145
	github.com/grafana/xk6-browser@v1.8.5/common/session.go:47 +0x367

rax    0xca
rbx    0x0
rcx    0x47ee23
rdx    0x0
rdi    0x2ef7560
rsi    0x80
rbp    0x7fffd0bb3d00
rsp    0x7fffd0bb3cb8
r8     0x0
r9     0x0
r10    0x0
r11    0x286
r12    0x59b
r13    0x1
r14    0x2ef61e0
r15    0x1
rip    0x47ee21
rflags 0x286
cs     0x33
fs     0x0
gs     0x0

xk6-browser version

v1.8.5

OS

NA

Chrome version

NA

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Run the following and SIGINT (ctrl+c). The k6 process will never shutdown.

import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'constant-vus',
      vus: 1,
      duration: '300s',
      gracefulStop: '30s',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  const context = await browser.newContext();
  const page = await context.newPage();

  // Listen for network requests
  page.on('request', async request => {
    console.log(request);
  });

  try {
    console.log('trying to navigate');
  } finally {
    await page.close();
  }
}

Expected behaviour

It shuts down.

Actual behaviour

It hangs indefinitely.

@ankur22 ankur22 added the bug Something isn't working label Oct 1, 2024
@ankur22 ankur22 self-assigned this Oct 1, 2024
@ankur22
Copy link
Collaborator Author

ankur22 commented Oct 1, 2024

This is linked to #1450. The test script uses page.on. This will register a taskqueue even though page.on('request') hasn't been implemented. A quick fix would be to check to see if the event is valid/implemented. The long term fix should be to ensure that the taskqueue is closed when the page is closed or when the iteration is aborted.

@ankur22
Copy link
Collaborator Author

ankur22 commented Oct 4, 2024

This is a duplicate of #1450.

@ankur22 ankur22 closed this as completed Oct 4, 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

1 participant