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

Switch to per-fiber location information #1868

Closed
bbannier opened this issue Sep 24, 2024 · 0 comments · Fixed by #1885
Closed

Switch to per-fiber location information #1868

bbannier opened this issue Sep 24, 2024 · 0 comments · Fixed by #1885
Assignees
Labels
Bug Something isn't working Runtime Library Issues related to the HILTI or Spicy runtime libraries

Comments

@bbannier
Copy link
Member

bbannier commented Sep 24, 2024

A user reported on Slack that in Zeek they see error messages from an unrelated parser, e.g., Zeek's PostgreSQL parser reporting a data missing error with a location in the QUIC analyzer. This seems to be due to different analyzers being active at the same time, and picking up incorrect location information which is stored globally via hilti::rt::debug::location.

We should check whether we could move location information into e.g., the fiber context, and change debug::location to access that information. This could have a performance impact even though location information should only rarely be surfaced to the user.

I was not able to create a standalone Spicy batch setup to reproduce this, but we might be able to see it in Zeek.

@bbannier bbannier added Bug Something isn't working Runtime Library Issues related to the HILTI or Spicy runtime libraries labels Sep 24, 2024
@rsmmr rsmmr self-assigned this Oct 14, 2024
rsmmr added a commit that referenced this issue Oct 14, 2024
… thread.

This fixes potential location mix-ups when switching between fibers.
Note that we still need a context-wide fallback location as well
because we're not always running inside a fiber.

I ran a performance comparison before/after and couldn't measure a
difference. Looks like using TLS storage was a case of premature
optimization.

Closes #1868.
@rsmmr rsmmr closed this as completed in 01dc123 Oct 14, 2024
rsmmr added a commit that referenced this issue Oct 14, 2024
* origin/topic/robin/gh-1868-locations:
  Associate source code locations with current fiber instead of current thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Runtime Library Issues related to the HILTI or Spicy runtime libraries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants