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

pkg-config --list-all segfaults on macOS-{11,12} #6364

Closed
3 of 11 tasks
andreasabel opened this issue Oct 7, 2022 · 8 comments
Closed
3 of 11 tasks

pkg-config --list-all segfaults on macOS-{11,12} #6364

andreasabel opened this issue Oct 7, 2022 · 8 comments
Assignees
Labels
Area: Common Tools awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report external OS: macOS

Comments

@andreasabel
Copy link

andreasabel commented Oct 7, 2022

Description

cabal-install 3.8.1.0 runs pkg-config --list-all to build its own pkg-config database. Pointer:

Unfortunately pkg-config --list-all crashes on macOS-11 and macOS-12, see e.g. https://github.com/andreasabel/gha-test/actions/runs/3202198515.
Here is the reproducer:

on:
  - push
  - pull_request
  - workflow_dispatch

jobs:
  pkg-config:
    strategy:
      fail-fast: false
      matrix:
        os:
          - macOS-10.15
          - macOS-11
          - macOS-12
          - ubuntu-18.04
          - ubuntu-20.04
          - ubuntu-22.04
          - windows-2019
          - windows-2022
    runs-on: ${{ matrix.os }}

    steps:
      - run: pkg-config --list-all

On macOS-11, we see:

Run pkg-config --list-all
/Users/runner/work/_temp/e2399e25-8191-4922-af7b-0f952d0ea074.sh: 
line 1:  1693 Segmentation fault: 11  pkg-config --list-all
Error: Process completed with exit code 139.

On macOS-12, we see:

Run pkg-config --list-all
/Users/runner/work/_temp/f0113537-d05d-4532-a96d-bd2a0c83017a.sh: 
line 1:  1522 Segmentation fault: 11  pkg-config --list-all
Error: Process completed with exit code 139.

Possibly related:

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 10.15
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

https://github.com/andreasabel/gha-test/actions/runs/3202198515

Runner Image
Image: macos-11
Version: 20221002.2

Image: macos-12
Version: 20220929.2

Is it regression?

Yes, works with macOS-10.15.

Expected behavior

See other OSs: pkg-config --list-all should output a list of all packages known to pkg-config.

Actual behavior

Segfault.

Repro steps

See above. Run this workflow:

on:
  - push
  - pull_request
  - workflow_dispatch

jobs:
  pkg-config:
    strategy:
      fail-fast: false
      matrix:
        os:
          - macOS-10.15
          - macOS-11
          - macOS-12
          - ubuntu-18.04
          - ubuntu-20.04
          - ubuntu-22.04
          - windows-2019
          - windows-2022
    runs-on: ${{ matrix.os }}

    steps:
      - run: pkg-config --list-all
@mikhailkoliada
Copy link
Contributor

@andreasabel thanks, we will take a look

@mikhailkoliada
Copy link
Contributor

@andreasabel it looks like a pure software bug, as a workaround you can remove imagemagick and its dependencies in runtime, I am trying to figure out where it should be better reported.

@mikhailkoliada
Copy link
Contributor

Ok, it will be fixed by homebrew maintainers

@Bo98
Copy link

Bo98 commented Oct 10, 2022

It's fixed from our side now. You can do brew reinstall highway until there's a new runner image.

@andreasabel
Copy link
Author

Fantastic research and swift action, thanks a lot, everyone!!

Might be advisable to add pkg-config --list-all to your regression testsuite, to prevent it from breaking again in the future...

yutotakano added a commit to yutotakano/discord-haskell-voice that referenced this issue Oct 10, 2022
Due to a bug in the highway brew package, pkg-config --list-all segfaults
on mac runners (actions/runner-images#6364). In
addition, cabal probes pkg-config --list-all despite not needing it
(haskell/cabal#8496).

Combined, this created an issue where cabal would fail to create a build
plan on macOS GitHub Action runners citing a lack of libsodium/pkg-config.

The temporary solution is to reinstall the highway brew package since it
has now been patched. The long-term solution is to wait for cabal to change
its probing behaviour (tracked above), or wait for GitHub Actions runner
environments to update so it comes with the patch preinstalled.

(side note: I was pursuing this CI bug for over 4 days, unable to find
anything relevant on search engines.... until 30 minutes ago, when I hit
the jackpot with the right search terms and arrived at the issues above.
In fact, the issue was only solved 5 hours ago, and the last comment in
the thread was from 22 minutes before I arrived. I felt quite some strong
adrenaline flowing through me when I realised how lucky I was today...)
yutotakano added a commit to yutotakano/discord-haskell-voice that referenced this issue Oct 10, 2022
Due to a bug in the highway brew package, pkg-config --list-all segfaults
on mac runners (actions/runner-images#6364). In
addition, cabal probes pkg-config --list-all despite not needing it
(haskell/cabal#8496).

Combined, this created an issue where cabal would fail to create a build
plan on macOS GitHub Action runners citing a lack of libsodium/pkg-config.

The temporary solution is to reinstall the highway brew package since it
has now been patched. The long-term solution is to wait for cabal to change
its probing behaviour (tracked above), or wait for GitHub Actions runner
environments to update so it comes with the patch preinstalled.

(side note: I was pursuing this CI bug for over 4 days, unable to find
anything relevant on search engines.... until 30 minutes ago, when I hit
the jackpot with the right search terms and arrived at the issues above.
In fact, the issue was only solved 5 hours ago, and the last comment in
the thread was from 22 minutes before I arrived. I felt quite some strong
adrenaline flowing through me when I realised how lucky I was today...)
@mikhailkoliada mikhailkoliada added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Oct 11, 2022
@mikhailkoliada
Copy link
Contributor

The new macOS images must be released this week

@andreasabel
Copy link
Author

Great work, everyone!

pkg-config --list-all succeeds now on the macOS runners dated 2022-10-10: https://github.com/andreasabel/gha-test/actions/runs/3273901704/jobs/5386715502

@mikhailkoliada
Copy link
Contributor

yes, the changes have been fully deployed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Common Tools awaiting-deployment Code complete; awaiting deployment and/or deployment in progress bug report external OS: macOS
Projects
None yet
Development

No branches or pull requests

3 participants