question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Abort (Core dumped) when running unittests with uvm-python

See original GitHub issue

Running make test (or any unittest file) for https://github.com/tpoikela/uvm-python results in the following error:

/usr/include/c++/9/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = GpiImplInterface*; _
Alloc = std::allocator<GpiImplInterface*>; std::vector<_Tp, _Alloc>::reference = GpiImplInterface*&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.

I bisected the issue to commit 3a0bf9460515ae0c2269890b75ddbeaa80085cff. It seems some imports have been changed to unconditional ones. More specifically, changing cocotb/utils.py back to conditional import seems to fix this issue. Any ideas on the source of error?

Background: uvm-python unit tests are run without simulator, but files under test are still importing stuff from cocotb.

To reproduce the issue:

mkdir temp
cd temp
python -m env .venv
source .venv/bin/activate
git clone https://github.com/cocotb/cocotb.git
cd cocotb
pip install -e .
cd ..
git clone https://github.com/tpoikela/uvm-python.git
cd uvm-python
ln -s src/uvm ./uvm
pip install cocotb_coverage pip install regex
python -m unittest unit/test_sv.py  # Or make test-unit

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
tpoikelacommented, May 16, 2020

@themperek Thanks for suggestion. hasattr(cocotb, 'SIM_NAME') seems to provide a workaround. Any potential pitfalls?

Nevertheless, it is better not to leak segfaults, as these cannot be caught inside Python code.

0reactions
ktbarrettcommented, May 18, 2020

@themperek That is a good idea that will also help us with #1724.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Unit test] Ut failed with Aborted (core dumped) #1460 - GitHub
I have searched related issues but cannot get the expected help. I have read the FAQ documentation but cannot get the expected help....
Read more >
"core dumped" when running Python tests - Travis CI Community
“core dumped” means a C-level error. Most probably, you have extension modules incompatible with your system, instance of Python and/or each ...
Read more >
Pytest running unittest exit with core dump - Stack Overflow
When we attempt to run our tests folder with pytest, in case the classes are directly derived from unittest.TestCase tests are running fine....
Read more >
Frameworks and Methodologies — Open Source Verification ...
Cocotb is a coroutine based co-simulation library for writing VHDL and Verilog testbenches in Python. It was initially written and open sourced by...
Read more >
LFY - River Thames Conditions - Environment Agency - GOV.UK
Sentinel self storage dubai, Photonic memory alpha, Widal test lab report! ... Run the one grey, Descargar asturias isaac albeniz mp3, Praga city...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found