-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
GC analyzer does not spot safepoint issue #33501
Comments
So partly this is by design, because the analyzer is interprocedural, so if it has the body of |
(Meaning that whether it complains about foobar depends on whether or not it has the definition - Looks like we have a separate issue with that callback function). |
But it's never warning about |
Right yeah, I saw that after. That is potentially ok, since the analyzer is heuristic based, so it's possible for it to stop early, but have the introduction of the foobar change the heuristics (it explores more in the vicinity of other errors). It could then determine that the callback issue is more important than the foobar issue (because it has a shorter chain of events) and report that instead. |
The following piece of C code, reduced from
gc.c
(ab
wasgc_cblist_notify_external_free
,b
wasgc_cblist_notify_external_free
), confuses the GC analyzer based on the definition offoobar
. If it's a function declaration,void foobar() { }
, the analyzer doesn't spot the potential safepoint by calling theab
function pointer fromJL_NOTSAFEPOINT
-annotatedf
:If you instead define only a prototype,
void foobar();
, the analyzer does spot the issue:Removing seemingly trivial stuff that would never affect the analysis makes both cases detect the issue:
Furthermore, defining
foobar
through-include reduce_proto.c
or-include reduce_decl.c
seems necessary to reproduce the issue. This wasn't the case before reduction, so it doesn't look like a simple logic issue.Tested with LLVM 6.0.1 from BinaryBuilder on Julia master. This issue is the reason that the llvmpasses buildbot fails over at #33467. Thoughts, @Keno?
The real fix would be to (document and) annotate the callback function pointer, i.e.
typedef (*ab)() JL_NOTSAFEPOINT
, which silences the error.The text was updated successfully, but these errors were encountered: