Extract base analysis flag to separate analysis, refactor thread spawning#130
Extract base analysis flag to separate analysis, refactor thread spawning#130
Conversation
There is mtflag analysis but it's lacking compared to what base does with the flag.
…tions This should allow reducing the duplication of ctx.spawn logic in different analyses.
# Conflicts: # src/analyses/base.ml
Every analysis should specify it itself like otherstate previously
After splitting part_access, this is unnecessary.
threadspawn result is joined anyway.
|
It is definitely a lot nicer to have these things separate now, good job! |
Absolutely! I was thinking the same when i had to fix the merge conflicts in 100 regression test |
The new The new
The biggest peculiarity with If only we had somewhere to nicely document this sort of things... |
# Conflicts: # src/analyses/region.ml
ldv-consumption/32_7a_cilled_linux-3.8-rc1-32_7a-sound--core--snd-rawmidi.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.iSomething quite funny is happening that this turns Why didn't this happen before? Probably because thanks to mallocWrapper the freed blob is more precise (a struct containing a function pointer, not top). Why didn't this happen immediately when mallocWrapper was added but just now with thread flag changes? I didn't bother looking into it that deep but my guess is that the thread spawning logic, which previously was duplicated in multiple analyses, had weaker implementations in some (not using reachability for unknown specials). Now that this happens centrally in base where the logic is the most powerful, it now arises. Obviously this is silly behavior, so I see two ways to avoid this from happening:
|
It already existed but was completely unused.
|
The pull_request CI checks now seem to be failing because the added regression test 29/21 in master doesn't enable But it's weird because base analysis doesn't depend on What makes is weird that adding analyses fixes the start variables, not removing problematic analyses. |
…sound--core--snd-rawmidi.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i
Now without threadid enabled, morphstate gets called with bot, that reduce removes. This is unintentional.

This is my ongoing effort to extract the flag (containing a "boolean" of single-/multithreaded mode and current thread ID) from base analysis to a separate analysis.
Additionally, I'm trying to refactor thread spawning, which multiple analyses currently try to do in parallel in
specialin a very similar way. The idea is to add additional transfer functions (currentlythreadenterandthreadspawn) which make other analyses aware of a thread spawned by base analysis without needing to duplicate the logic.This should make it easier to handle thread joins (
pthread_join) and in simpler cases go back to singlethreaded mode, avoiding races that come from the end of main thread after other threads have been joined.