-
Notifications
You must be signed in to change notification settings - Fork 4
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
Track initialised yk locations #64
Conversation
bors try |
So this fixes the crashes? |
It fixes the crashes but only for serialised compilation.
|
looks like |
return LYK_VERBOSE; | ||
} | ||
|
||
void print_proto_info(char *msg, Proto *f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I hear Laurie's footsteps approaching...
I'm OK with leaving this debugging code in for now, but once we have everything solved, we should remove it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there's a convincing reason, we should not include it, because we'll never remember to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also all of the debugging stuff should not be compiled-in for non-devug builds, since they will impact performance.
See NDEBUG
in the assert
manual page for more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we conditionally compile it in, I'd still like to know: is it going to be useful going forwards? Code, once committed, has a tendency to stay put...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there's a convincing reason, we should not include it, because we'll never remember to remove it.
I knew he'd say that.
So maybe it's best kept as a private patch @Pavel-Durov ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel your pain @Pavel-Durov.
Since Laurie is letting you keep it in, I'd jump on that. Just make sure it's all guarded #ifndef NDEBUG
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 👉 5048954
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I wasn't clear. We need to use a flag of our own devising so that we can later differentiate "we added this block" from "Lua uses NDEBUG
for other purposes". [Admittedly I only see two NDEBUG
s in Lua, but it's greater than zero.]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok np
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 👉 632330f
bors try |
tryAlready running a review |
If the |
I don't thing |
bors try- |
bors ping |
pong |
bors try |
@Pavel-Durov Sometimes bors is a bit lazy and needs a |
tryBuild failed: |
failed cause of my typo in buildbot.sh |
OK, please push a new commit with the fix. |
fixed 👉 f499cb1 |
bors try |
Please squash if |
tryBuild succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
f499cb1
to
150d826
Compare
Remove reallocarray in favour of calloc Change YkLocations to be stored as pointers Change lyk interface to reflect its "hooks" functionality Move tests to a separate test script and enabled serialised all.lua test suite Added logging in lyk module for ease of debugging Updated readme with debugging instructions
150d826
to
ff503eb
Compare
squashed 👉 ff503eb |
bors r+ |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Partially fixes (only for serial compilation) - #62
Changes
test.sh
was tested for resiliency multiple times:Issues
Uninitialised locations memory
reallocarray
does not initialise memory with default zero bytes locations ascalloc
.Moving to
calloc
and using pointers allowed to check for NULL with default values set at initialisation time.Tests
When lua tests are executed one by one as single files it produces different results from when it's executed via
all.lua
test suite.Example:
When run through
all.lua
it passes:Since
all.lua
is what we base the stability of yklua, I think we should include it in the tests as is, currently only serialised compilation works.Running
all.lua
prior to these changes results in error (main/56c5787799b876f36babbae24e9afc025806b831
):That's cause we're freeing uninitialised yk locations.