Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Upgrade GCC to a version compatible with latest Mac #876

@kuzminrobin

Description

@kuzminrobin

The latest Mac image (11.6 ?) conflicts with g++-7 that we use currently.
If we just update the g++ to g++-11 then the debug version of the full state simulator, compiled with g++-11, crashes on Mac (microsoft.qsharp-runtime.sanitized (Build mac) pipeline) when running these 2 QIR tests (they and only they use the full state simulator):

1: Test command: /Users/runner/work/1/s/src/Qir/Tests/bin/Debug/FullstateSimulator/fullstate-simulator-tests "~[skip]" "-o" "fullstate-simulator-tests_results.xml" "-r" "junit"
1: Environment variables: 
1:  LD_LIBRARY_PATH=/Users/runner/work/1/s/build/../src/Simulation/Native/build/drop:/Users/runner/work/1/s/src/Qir/Tests/bin/Debug/bin:/Users/runner/work/1/s/src/Qir/Tests/../Runtime/bin/Debug/bin:
1:  PATH=/Users/runner/work/1/s/build/../src/Simulation/Native/build/drop;/Users/runner/work/1/s/src/Qir/Tests/bin/Debug/bin;/Users/runner/work/1/s/src/Qir/Tests/../Runtime/bin/Debug/bin;
1:  DYLD_LIBRARY_PATH=/Users/runner/work/1/s/build/../src/Simulation/Native/build/drop:/Users/runner/work/1/s/src/Qir/Tests/bin/Debug/bin:/Users/runner/work/1/s/src/Qir/Tests/../Runtime/bin/Debug/bin:
1: Test timeout computed to be: 1500
1/4 Test #1: fullstate-simulator-tests ........***Exception: Illegal  0.62 sec
test 2
    Start 2: qir-dynamic-tests

2: Test command: /Users/runner/work/1/s/src/Qir/Tests/bin/Debug/QIR-dynamic/qir-dynamic-tests "~[skip]" "-o" "qir-dynamic-tests_results.xml" "-r" "junit"
2: Environment variables: 
2:  LD_LIBRARY_PATH=/Users/runner/work/1/s/build/../src/Simulation/Native/build/drop:/Users/runner/work/1/s/src/Qir/Tests/bin/Debug/bin:/Users/runner/work/1/s/src/Qir/Tests/../Runtime/bin/Debug/bin:
2:  PATH=/Users/runner/work/1/s/build/../src/Simulation/Native/build/drop;/Users/runner/work/1/s/src/Qir/Tests/bin/Debug/bin;/Users/runner/work/1/s/src/Qir/Tests/../Runtime/bin/Debug/bin;
2:  DYLD_LIBRARY_PATH=/Users/runner/work/1/s/build/../src/Simulation/Native/build/drop:/Users/runner/work/1/s/src/Qir/Tests/bin/Debug/bin:/Users/runner/work/1/s/src/Qir/Tests/../Runtime/bin/Debug/bin:
2: Test timeout computed to be: 1500
2/4 Test #2: qir-dynamic-tests ................***Exception: Illegal  0.16 sec
test 3
    Start 3: qir-static-tests

(If the simulator is compiled in Release config, but the rest stays unchanged, then the crash is not observed)

The issue does not show itself on Linux, cannot be repro'ed in WSL. Running the full state simulator through the sanitizers (ubsan and asan) on WSL (Ubuntu 20.04) did not report any issues, as well as the enabled ubsan (Undefined Behavior Sanitizer) running during CI on Mac (the asan (Address Sanitizer) requires a special command to run, LD_PRELOAD=<path/to/asan.so> <test executable>, that is why has not been run on Mac).
Commenting out all the difference between the Debug and Release code (#if[n]def NDEBUG fragments, asserts) did not help.
Actual debugging on Mac is required.

Metadata

Metadata

Assignees

Labels

maintenanceImprove codebase quality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions