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

Try to get GC analysis clean again #32090

Merged
merged 2 commits into from
May 20, 2019
Merged

Try to get GC analysis clean again #32090

merged 2 commits into from
May 20, 2019

Conversation

Keno
Copy link
Member

@Keno Keno commented May 20, 2019

Also fix one missing GC root I found in the process.

```
/home/keno/julia-old/src/gf.c:1220:30: note: Started tracking value here
        jl_value_t *isect2 = jl_type_intersection((jl_value_t*)mth->sig, (jl_value_t*)sig);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/keno/julia-old/src/gf.c:1223:13: note: Passing non-rooted value as argument to function that may GC
        if (jl_types_equal(isect, isect2)) {
            ^                     ~~~~~~
```
@Keno
Copy link
Member Author

Keno commented May 20, 2019

@staticfloat Once this is merged, can we set up a separate buildbot that runs these? Perhaps it can also run the llvmpasses tests and later also the ClangSA test suite once that's hooked up.

@staticfloat
Copy link
Sponsor Member

Yes; we already have a nightly_gc_debug task that runs once a day; would you want something similar here?

@Keno
Copy link
Member Author

Keno commented May 20, 2019

Not, I want it to run on every commit, it can just run in parallel with the regular tester.

src/jltypes.c Outdated
@@ -1677,7 +1680,7 @@ void jl_init_types(void) JL_GC_DISABLED
// create base objects
jl_datatype_type = jl_new_uninitialized_datatype();
jl_set_typeof(jl_datatype_type, jl_datatype_type);
jl_typename_type = jl_new_uninitialized_datatype();
jl_typename_type = jl_new_uninitialized_datatype();
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace issue?

This gets everything except for rtutils.c (which is also moved out of the make target).
rtutils will require some refactoring since the printing functions now are syntactically
safe points (just happen not to be on the path we care about there).
@@ -729,8 +730,10 @@ static char *jl_alloc_fiber(jl_ucontext_t *t, size_t *ssize, jl_task_t *owner)
char *stkbuf = (char*)jl_malloc_stack(ssize, owner);
if (stkbuf == NULL)
return NULL;
#ifndef __clang_analyzer__
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why this is here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The analyzer gets confused by this syntax construct because it's inside a rooted value. &ptls->base_ctx. Could probably be fixed, but didn't seem worth the effort.

@@ -44,9 +44,9 @@ RUNTIME_C_SRCS := \
dlload sys init task array dump staticdata toplevel jl_uv datatype \
simplevector runtime_intrinsics precompile \
threading partr stackwalk gc gc-debug gc-pages gc-stacks method \
jlapi signal-handling safepoint jloptions timing subtype rtutils \
jlapi signal-handling safepoint jloptions timing subtype \
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean this file doesn't get analyzed now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, see commit message. jl_printf is now a safepoint, so that file needs some refactoring that I thought would be too extensive for this commit.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is jl_printf now a safepoint?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mutex around uv_write can cause gc.

@Keno Keno merged commit 6e04733 into master May 20, 2019
@maleadt maleadt deleted the kf/clangsaclean branch May 21, 2019 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants