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

ctable: fix power-of-2 issue #1362

Merged

Conversation

alexandergall
Copy link
Contributor

I have brought this up in issue #1207, which is still open. I propose this fix at least as an interim solution until RaptorJIT lands (provided it will contain the fix proposed by @lukego).

Removal of two tail-call optimizations is also part of this PR. I found that this reduces trace aborts in my ipfix app some time ago. I'm not sure if we have converged on a common strategy to deal with this sort of problem, so this could be debatable.

LuaJIT dislikes pointer subtractions when the size of the pointed-to
objects is not a power of two, which leads to trace aborts. ctable
suffers from this problem. The patch pads the cdata type used as entry
for the table to the next power of two.

We also disable tail-call optimization for functions that end with a
call to a built-in, which also causes trace aborts in certain cases.
lukego added a commit that referenced this pull request Jul 30, 2018
@lukego lukego added the merged label Jul 30, 2018
@lukego lukego mentioned this pull request Jul 30, 2018
@lukego lukego added this to Merged in Pull Request upstreaming Aug 1, 2018
@eugeneia eugeneia merged commit 8a1ebb0 into snabbco:master Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Pull Request upstreaming
  
Merged but not yet released
Development

Successfully merging this pull request may close these issues.

None yet

3 participants