Page MenuHomePhabricator

[Bug] Pixel doesn't run on MacBooks with M1 chipset
Closed, ResolvedPublicBUG REPORT

Description

Steps to reproduce

  1. Buy a MacBook Pro M1
  2. Git clone https://github.com/wikimedia/pixel and follow its setup directions
  3. Run ./pixel.js reference when inside the pixel directory

Expected results

  • Visual regression tests should run

Actual results

  • Visual regression tests throw an error:
COMMAND | Executing core for "reference"
  clean | report/reference-screenshots-desktop was cleaned.
createBitmaps | Selected 21 of 21 scenarios.
      COMMAND | Command "reference" ended with an error after [3.215s]
      COMMAND | Error: Failed to launch the browser process!
                [0628/230033.364427:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
                [0628/230033.674694:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
                [0628/230033.681741:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
                [0628/230033.717351:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). 
                #0 0x004006ba9029 <unknown>
                #1 0x004006b10623 <unknown>
                #2 0x004006b238f0 <unknown>
                #3 0x004006b2443e <unknown>
                #4 0x0040066aec17 <unknown>
                #5 0x0040066a976e <unknown>
                #6 0x0040066ab12b <unknown>
                #7 0x0040066a8985 <unknown>
                #8 0x0040066a945e <unknown>
                #9 0x00400670792b <unknown>
                #10 0x004006707693 <unknown>
                #11 0x004006706305 <unknown>
                #12 0x00400344e133 <unknown>
                #13 0x004012c792e1 <unknown>
                #14 0x00400344df6a <unknown>
                Crash keys:
                  "switch-8" = "--allow-pre-commit-input"
                  "switch-7" = "--use-angle=swiftshader-webgl"
                  "switch-6" = "--use-gl=angle"
                  "switch-5" = "--ozone-platform=headless"
                  "switch-4" = "--headless"
                  "switch-3" = "--headless"
                  "switch-2" = "--no-sandbox"
                  "switch-1" = "--type=zygote"
                  "num-switches" = "8"
                
                Received signal 6
                #0 0x004006ba9029 <unknown>
                #1 0x004006b10623 <unknown>
                #2 0x004006ba8b01 <unknown>
                #3 0x00400e6640e0 <unknown>
                #4 0x004012c8bfff <unknown>
                #5 0x004012c8d42a <unknown>
                #6 0x004006ba7d95 <unknown>
                #7 0x004006b23d1f <unknown>
                #8 0x004006b2443e <unknown>
                #9 0x0040066aec17 <unknown>
                #10 0x0040066a976e <unknown>
                #11 0x0040066ab12b [0628/230033.708545:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded(). 
                #0 0x004006ba9029 <unknown>
                #1 0x004006b10623 <unknown>
                #2 0x004006b238f0 <unknown>
                #3 0x004006b2443e <unknown>
                #4 0x0040066aec17 <unknown>
                #5 0x0040066a976e <unknown>
                #6 0x0040066ab12b <unknown>
                #7 0x0040066a8985 <unknown>
                #8 0x0040066a945e <unknown>
                #9 0x00400670792b <unknown>
                #10 0x004006707693 <unknown>
                #11 0x004006706305 <unknown>
                #12 0x00400344e133 <unknown>
                #13 0x004012c792e1 <unknown>
                #14 0x00400344df6a <unknown>
                Crash keys:
                  "switch-9" = "--allow-pre-commit-input"
                  "switch-8" = "--use-angle=swiftshader-webgl"
                  "switch-7" = "--use-gl=angle"
                  "switch-6" = "--ozone-platform=headless"
                  "switch-5" = "--headless"
                  "switch-4" = "--headless"
                  "switch-3" = "--no-sandbox"
                  "switch-2" = "--no-zygote-sandbox"
                  "switch-1" = "--type=zygote"
                  "num-switches" = "9"
                
                Received signal 6
                #0 0x004006ba9029 <unknown>
                #12 0x0040066a8985 <unknown>
                #13 0x0040066a945e <unknown>
                #1 0x004006b10623 <unknown>
                #14 0x00400670792b <unknown>
                #15 0x004006707693 <unknown>
                #16 0x004006706305 <unknown>
                #2 0x004006ba8b01 <unknown>
                #17 0x00400344e133 <unknown>
                #3 0x00400e6640e0 <unknown>
                #18 0x004012c792e1 <unknown>
                #19 0x00400344df6a <unknown>
                #4 0x004012c8bfff <unknown>
                #5 0x004012c8d42a <unknown>
                #6 0x004006ba7d95 <unknown>
                  r8: 0000000000000000  r9: 000000400e2177b0 r10: 0000000000000008 r11: 0000004012dc32e0
                 r12: 0000333a003bc000 r13: 000000400e217a00 r14: 0000333a003bc010 r15: aaaaaaaaaaaaaaaa
                  di: 0000000000000002  si: 000000400e2177b0  bp: 000000400e2179f0  bx: 0000000000000006
                  dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000000  sp: 000000400e217828
                  ip: 0000004012c8bfff efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
                 trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
                [end of stack trace]
                qemu: uncaught target signal 6 (Aborted) - core dumped
                Received signal 11 SEGV_MAPERR 2f736a706f7473
                #0 0x004006ba9029 <unknown>
                #7 0x004006b23d1f <unknown>
                #8 0x004006b2443e Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
                <unknown>
                #1 0x004006b10623 <unknown>
                #2 0x004006ba8b01 <unknown>
                #9 0x0040066aec17 <unknown>
                #3 0x00400e6640e0 <unknown>
                #4 0x004006d22900 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
                
                
                TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
                
                    at onClose (/usr/local/lib/node_modules/backstopjs/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:229:20)
                    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/backstopjs/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:220:79)
                    at ChildProcess.emit (events.js:387:35)
                    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

Developer notes

The issue is captured in https://github.com/garris/BackstopJS/issues/1300 and seems to relate to the way puppeteer is installed in the backstop image as well as the Docker image only being built for the x86 chipset (not arm64)

Event Timeline

I've added @Mabualruz as a subscriber to this as he has a MacBook Pro M1 and knowledge of Docker!

Mabualruz changed the task status from Open to Stalled.Jul 8 2022, 4:51 PM

https://github.com/wikimedia/pixel/pull/70

This PR resolve the issue if you need it apply it locally.
We need to wait for @nray to come back to make sure it covers even edge cases

Occasionally, the tests on my m1 mac sporadically hang without any timeout or exit. For example, I get the following output and then it still stands still:

CREATING NEW REFERENCE FILE
Browser Console Log 0: JSHandle:BackstopTools have been installed.
SCENARIO > Tree (#vector)
Browser Console Log 0: JSHandle:BackstopTools have been installed.
SCENARIO > Tree (#vector)
SCENARIO > Tree (#vector)
x Close Browser
SCENARIO > Tree (#vector)
x Close Browser
x Close Browser
x Close Browser

I've also noticed a similar problem on pixel.wmcloud.org although it seems to happen less frequently.

I'm wondering if this might be related to the docker image change as I remember encountering this issue in a prior revision of the PR:

https://github.com/wikimedia/pixel/pull/70#issuecomment-1170176244

@Mabualruz Do you experience this issue?

Happened again with the following output:

x Close Browser
SCENARIO > Talk:Test (#vector)
Browser Console Log 0: JSHandle:BackstopTools have been installed.
SCENARIO > Talk:Test (#vector)
Browser Console Log 0: JSHandle:BackstopTools have been installed.
x Close Browser
x Close Browser
SCENARIO > Tree (#vector)
SCENARIO > Tree (#vector)
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
x Close Browser
x Close Browser
SCENARIO > Tree (#vector)
Browser Console Log 0: JSHandle:BackstopTools have been installed.
SCENARIO > Tree (#vector)
x Close Browser
x Close Browser
SCENARIO > Tree (#vector)
x Close Browser

Seems to occur around the legacy vector Tree test

SCENARIO > Talk:Test (#vector)
SCENARIO > Talk:Test (#vector)
SCENARIO > Talk:Test (#vector)
x Close Browser
CREATING NEW REFERENCE FILE
SCENARIO > Tree (#vector)
x Close Browser
x Close Browser
CREATING NEW REFERENCE FILE
Browser Console Log 0: JSHandle:BackstopTools have been installed.
CREATING NEW REFERENCE FILE
x Close Browser
CREATING NEW REFERENCE FILE
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
Browser Console Log 0: JSHandle:BackstopTools have been installed.
SCENARIO > Tree (#vector)
SCENARIO > Tree (#vector)
SCENARIO > Tree (#vector)
x Close Browser
SCENARIO > Tree (#vector)
x Close Browser
x Close Browser
x Close Browser

I'm experimenting with increasing my docker RAM limits from 8gb to 20gb after reading https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#tips ( I tried increasing shm-size to 2gb but didn't notice improvement.)

nray moved this task from Backlog to Done on the Web Team Visual Regression Framework board.
nray added a subscriber: Jdlrobson.

Thanks for working on this @Mabualruz and reviewing @Jdlrobson ! I have created a new ticket for sporadic hanging issue I've noticed in T318445, but at least MacBook Pro M1's are now capable of running it!