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

Deletion of Streams with many Chunks can trigger stack overflow #1550

Closed
bbannier opened this issue Sep 28, 2023 · 1 comment · Fixed by #1552
Closed

Deletion of Streams with many Chunks can trigger stack overflow #1550

bbannier opened this issue Sep 28, 2023 · 1 comment · Fixed by #1552
Assignees
Labels
Cleanup Runtime Library Issues related to the HILTI or Spicy runtime libraries

Comments

@bbannier
Copy link
Member

bbannier commented Sep 28, 2023

The individual Chunks in a Stream are stored as a linked list. Currently deletion of a Streams with many Chunks can trigger stack overflows, see e.g., the runtime behavior caused due to #1549 (which should just have caused the parser to not trim, but never to segfault). This is due to how the default generated dtr or Chunk works: to clean up the next Chunk and to traverse the list the compiler generates a recursive call due to the definition of _next,

std::unique_ptr<Chunk> _next = nullptr; // next chunk in chain, or null if last

We should replace this e.g., with an explicit cleanup.

@bbannier bbannier added Cleanup Runtime Library Issues related to the HILTI or Spicy runtime libraries labels Sep 28, 2023
@bbannier bbannier changed the title Deletion Streams with many Chunks can trigger stack overflow Deletion of Streams with many Chunks can trigger stack overflow Sep 28, 2023
@bbannier bbannier self-assigned this Sep 28, 2023
bbannier added a commit that referenced this issue Sep 29, 2023
@bbannier
Copy link
Member Author

Also fixed in release/1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Runtime Library Issues related to the HILTI or Spicy runtime libraries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant