browserstack / browserstack-local-nodejs

NodeJS bindings for BrowserStack Local
https://www.browserstack.com
MIT License
71 stars 56 forks source link

Segfaulting on Alpine #137

Closed icio closed 1 year ago

icio commented 1 year ago

Expected Behavior

browserstack local runs

Actual Behavior

We're seeing the following segfault errors in CI:

Error while trying to execute binary { Error: Command failed: /builder/home/.browserstack/BrowserStackLocal --daemon start --log-file /workspace/local.log --source nodejs-1.4.8 --key XMJKwYMxhryeHzygVvwG --force-local --only-automate --localProxyHost localhost --localProxyPort 42535 --disable-dashboard

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at ChildProcess.EventEmitter.emit (domain.js:448:20)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
  killed: false,
  code: null,
  signal: 'SIGSEGV',
  cmd:
   '/builder/home/.browserstack/BrowserStackLocal --daemon start --log-file /workspace/local.log --source nodejs-1.4.8 --key XMJKwYMxhryeHzygVvwG --force-local --only-automate --localProxyHost localhost --localProxyPort 42535 --disable-dashboard' }
Retrying Binary Download. Retries Left 5
(repeats 5 times...)

Steps to Reproduce the Problem

We're experiencing this issue in node:10.24.1-alpine but it reproduces in node:19-alpine3.16 too:

$ docker run -i -t --rm node:19-alpine3.16 sh -c 'apk add --update wget; wget -q https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-alpine; chmod +x BrowserStackLocal-alpine; ./BrowserStackLocal-alpine -h 2>&1 | head'

...
Segmentation fault (core dumped)

browserstack local arguments

n/a

Platform details

  1. browserstack-local-nodejs version: 1.5.1 (unrelated)
  2. node version: 10-19
  3. os type and version: alpine 3.16-3.17

Details

icio commented 1 year ago

Note that the debian-based node docker images are unaffected:

$ docker run -i -t --rm node:10-slim sh -c 'npm init -y && npm i browserstack-local@^1.4.5 && node -e "console.log(new (require(\"browserstack-local\").Local)().getBinaryPath())" && /root/.browserstack/BrowserStackLocal -h'
...
Tue Jan 03 2023 17:26:10:157 GMT+0000 (UTC) -- BrowserStackLocal v8.8
icio commented 1 year ago

This now appears to be resolved.