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

Hang when duplicate keys defined in element #1917

Open
nanonyme opened this issue May 2, 2024 · 7 comments
Open

Hang when duplicate keys defined in element #1917

nanonyme opened this issue May 2, 2024 · 7 comments

Comments

@nanonyme
Copy link
Contributor

nanonyme commented May 2, 2024

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.

@abderrahim
Copy link
Contributor

Please post the freedesktop-sdk commit to reproduce this. It would help fix it.

@nanonyme
Copy link
Contributor Author

nanonyme commented May 3, 2024

@nanonyme
Copy link
Contributor Author

nanonyme commented May 3, 2024

You don't have to use the custom config template to reproduce. It's enough to use BuildStream 2.2.0 and that commit.

@abderrahim
Copy link
Contributor

This is indeed weird. I can't reproduce it using my host install of buildstream (installed using pipx). However, using the CI container used in that commit I can reproduce it.

The error itself looks like we're leaking a YAMLLoadError which should be caught within the _yaml module. Reading the code, I suspect it's a typo here

except LoadError as e:
, where should be YAMLLoadError instead of LoadError.

@nanonyme
Copy link
Contributor Author

nanonyme commented May 4, 2024

Is there a difference in ruamel.yaml or ruamel.yaml.clib versions?

@abderrahim
Copy link
Contributor

Yes, indeed. On my system I have

ruamel.yaml        0.17.21
ruamel.yaml.clib   0.2.7

In the container

ruamel.yaml                 0.18.6
ruamel.yaml.clib            0.2.8

However, upgrading to the same version on my system I keep getting the same behaviour (a proper FAILURE, not a BUG with a hang).

@nanonyme
Copy link
Contributor Author

nanonyme commented May 4, 2024

This is so odd. While there may be a difference in Cython used to buils this extension, I don't expect it to affect quite that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants