8000 M4 Allocation of strings sometimes crashes when A7 reads them · Issue #493 · 4ms/metamodule · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

M4 Allocation of strings sometimes crashes when A7 reads them #493

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

Open
danngreen opened this issue Apr 16, 2025 · 0 comments
Open

M4 Allocation of strings sometimes crashes when A7 reads them #493

danngreen opened this issue Apr 16, 2025 · 0 comments
Labels
backend bug Something isn't working

Comments

@danngreen
Copy link
Member

Example, M4 populates a directory of long file names (some over 64 chars) into StaticBuffers::dir_tree.files.
Then A7 attempts to read those file names, appending them to a local std::string. A7 will crash while processing one of the longer file names. It crashes while appending the filename string to the local std::string, and seems to always be crashing while appending a character not aligned to a word boundary.

The local std::string data looks intact, and the dir_tree.files vector looks intact, as well as the dir_tree.files[N].filename string.

Perhaps there some sort of alignment restriction difference in A7 vs M4 when allocating strings, or specifically when appending a string to another string, perhaps there is an assumption about the alignment that A7 makes but M4 does not?

To check, if I populate dir_tree.files with long strings on the A7 core, then when the M4 populates the directory it will re-use some of the already allocated strings. This works and does not crash.

Also, copying the dir_tree.files[N].filename string to a local char array on the stack, and then append that local char array to the local string works without crashing.

See commit 9ec151fba42903a13545fb52e8f2dcb01b663209

@danngreen danngreen added bug Something isn't working backend labels Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0