Hang when duplicate keys defined in element
- Dominant language
- Python
- Stars
- 140
- Forks
- 45
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
Noticed with BuildStream 2.2.0
```
[12:40:35][--:--:--][ ][ main:core activity ] START Build
[12:40:35][--:--:--][ ][ main:core activity ] START Loading elements
[12:40:36][--:--:--][ ][ main:core activity ] BUG Duplicate key (@) at line 26 column 0
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/buildstream/_loader/loader.py", line 409, in _load_one_file
element = self._elements[filename]
~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'extensions/vulkaninfo/vulkan-tools.bst'
During handling of the above exception, another exception occurred:
buildstream._yaml.YAMLLoadError: Duplicate key (@) at line 26 column 0
```
BuildStream doesn't correctly handle the raised exception but instead hits BUG and promptly hangs after this.
Contributor guide
Research direction
Start in buildstream/_loader/loader.py at _load_one_file, where the traceback shows the duplicate-key YAMLLoadError arising during element loading. Reproduce the duplicate-key case from the issue and trace the error path; done means the error is reported cleanly and the build exits instead of reaching BUG and hanging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100