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
Simulation models compiled with -shared abort upon failure when loaded from Python on Linux #1623
Comments
This is the backtrace obtained in gdb when running the crashing VUnit example in a local container:
So, the abort comes from Line 23 in 4868294
put_err_backtrace .
|
I am sorry, but I cannot reproduce the crash. Do you have an MWE ? In particular, the python program.
|
For the tests that are failing in https://github.com/umarcor/setup-ghdl-ci/actions/runs/514033629, the "python program" is a single line in the
pyaux.py is in the same directory: https://github.com/umarcor/setup-ghdl-ci/blob/test/abort/test-abort/pyaux.py Unfortunately, that fails on CI, but not in a container :(. Hence, I had to use the other example for getting the backtrace, the one using VUnit. For the VUnit example, if you have Docker/Podman: git clone https://github.com/ghdl/ghdl-cosim
cd ghdl-cosim
docker run --rm -itv $(pwd):/src -w /src/vhpidirect/shared/py/vunit/ ghdl/cosim:matplotlib bash Then, inside the container, execute root@c41d79803f07:/src/vhpidirect/shared/py/vunit# ./run.sh
> [2008] VUnit compile
> [2008] VUnit run
Re-compile not needed
Running test: lib.tb_vunit.all
Running 1 tests
...
> [93] VUnit cosim
PY RUN ENTER
Hello entry!
0 fs - default - INFO - Hello shared/py/vunit!
/usr/local/lib/python3.7/dist-packages/vunit/vhdl/core/src/stop_body_93-2002.vhd:10:5:@0ms:(report failure): Stopping simulation with status 0
/src/vhpidirect/shared/py/vunit/vunit_out/test_output/lib.tb_vunit.all_dcaca1bf596fbf17c268003bd00053a997affd85/ghdl/tb_vunit-tb:error: report failed
in process .tb_vunit(tb).main
SIGABRT caught 6!
Aborted Now, let's rerun the last step only (
Inside gdb, we run
There you are. Optionally, you might want to set I think that something is crashing in If you don't have docker/podman, the only dependency of the |
I will commit what I have, but I cannot reproduce the crash.
I don't know the difference between an execution through python and what you do through a container. But that's something you could investigate!
|
Does executing That is successful on Windows and on local containers, but CI (Ubuntu) fails. Unfortunately, I don't have a Debian/Ubuntu host for trying. I will test on Fedora. There should be no difference between what I do locally, inside the container or in CI. In all cases, exactly the same script/command is executed and the same sources are used. The difference is the "environment" only. |
I run https://github.com/umarcor/setup-ghdl-ci/tree/test/abort/test-abort on 6 containers: https://github.com/umarcor/setup-ghdl-ci/actions/runs/516447375
It's exactly the same code/test, since it's defined in a matrix: https://github.com/umarcor/setup-ghdl-ci/blob/3d7bf50b54a182529f3598e22b2892da2238dc89/.github/workflows/test.yml#L11-L44 |
Description
This is a follow-up of #803 and ghdl/ghdl-cosim#15.
After the fixes in #803, all examples work on MSYS2 (MINGW64 with LLVM backend). Shared libraries produced by GHDL can be dynamically loaded from either C or Python, and
ghdl_main
returns cleanly regardless of simulation failures and standard version.However, on Linux, Python examples "crash" with an Abortion. More precisely, Python examples crash if some Python calls another script which loads shared libs generated by GHDL from Python. Surprisingly, if a bash script calls the Python script directly, the abortion is not produced.
Expected behaviour
Examples on Linux should work as on MSYS2.
How to reproduce?
See subdir
test-abort
from branchtest/abort
of my fork of setup-ghdl-ci: https://github.com/umarcor/setup-ghdl-ci/tree/test/abort/test-abortrun.sh
is executed directly (https://github.com/umarcor/setup-ghdl-ci/blob/test/abort/.github/workflows/test.yml#L40), it's successful on any Ubuntu (with LLVM backend) or on MINGW64 (with LLVM backend too).run.sh
is executed through pytest (see https://github.com/umarcor/setup-ghdl-ci/blob/test/abort/test.py#L30 and https://github.com/umarcor/setup-ghdl-ci/blob/test/abort/.github/workflows/test.yml#L51), execution is also successful on MINGW64, but it fails on Linux.See logs: https://github.com/umarcor/setup-ghdl-ci/actions/runs/514033629. Compare the outputs of steps "Test Abort" and "Pytest", on Linux and Windows.
With pytest (step "Pytest"):
Without pytest (step "Test Abort"):
Context
The MWE uses nightly packages.
I tested it with Python 3.8 and 3.9 on CI.
Additional context
This is a MWE of an issue found in ghdl-cosim. See the tests marked as XFAIL on jobs "🛳️ ghdl/cosim:matplotlib" and "🐧Ubuntu · nightly LLVM": https://github.com/ghdl/ghdl-cosim/actions/runs/513879907
When executed inside the container,
test.py::TestExamples::test_vhpidirect_shared_py
is successful. Surprisingly, intest.py::TestExamples::test_vhpidirect_shared_py_vunit
the example works with VHDL 2008, but it produces an abortion with VHDL 1993.When executed natively,
test.py::TestExamples::test_vhpidirect_shared_py
fails with an abortion.test.py::TestExamples::test_vhpidirect_shared_py_vunit
produces the same result as inside the container (08 works, 93 aborts).The text was updated successfully, but these errors were encountered: