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

[csolution/packchk] 'name' attribute specifying folder in pack with file element causes segmentation fault. #657

Closed
smartinou opened this issue Jan 11, 2023 · 1 comment
Assignees
Labels
bug Something isn't working cmsis-toolbox 2 Features in scope for "stable" baseline CMSIS-Toolbox fixed Issue is fixed, please verify.

Comments

@smartinou
Copy link

smartinou commented Jan 11, 2023

Packs that have a file element + name attribute of the form:
<file category="source" name="source_path/" ...

... cause a segmentation fault when attempting to convert the solution:
$ csolution convert -s .csolution.yml
Segmentation fault (core dumped)

This was discovered while editing a custom CMSIS pack.

Looking at the doc for the 'name' attribute, it is clearly mentioned "in the format path/name.extension", so I was likely wrong to specify it as "path/". Yet, a segmentation fault seems a bit harsh.

packchk did not reject this construct, so maybe a bug should be raised against it too.

Found in v1.3.0

@jkrech jkrech added the bug Something isn't working label Jan 12, 2023
@jkrech jkrech changed the title [csolution] 'name' attribute specifying folder in pack with file element causes segmentation fault. [csolution/packchk] 'name' attribute specifying folder in pack with file element causes segmentation fault. Jan 12, 2023
@jkrech jkrech added the cmsis-toolbox 2 Features in scope for "stable" baseline CMSIS-Toolbox label Jan 17, 2023
@jkrech jkrech moved this to Todo in CMSIS-Toolbox 2.0 Jan 17, 2023
@thorstendb-ARM thorstendb-ARM added the fixed Issue is fixed, please verify. label Feb 21, 2023
JonatanAntoni pushed a commit that referenced this issue Feb 21, 2023
…ile element causes segmentation fault.

- added: check all <file> but category="include" against IsDirectory()
- removed file check filter for some of the known types, as <file> can be one of file table:
  https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_components_pg.html#FileCategoryEnum
- added test case for new message M356 ("Path '%PATH%' does not specify
a file!")

Relates to #657

Co-authored-by: Thorsten de Buhr <thorstendb-ARM@users.noreply.github.com>
@jkrech jkrech moved this from Todo to Done in CMSIS-Toolbox 2.0 Feb 27, 2023
@jkrech
Copy link
Member

jkrech commented Feb 27, 2023

@jkrech jkrech closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmsis-toolbox 2 Features in scope for "stable" baseline CMSIS-Toolbox fixed Issue is fixed, please verify.
Projects
No open projects
Status: Done
Development

No branches or pull requests

5 participants