Issue

Failures of the following kind are happening: #I9AID8:[R&D][CFI]control flow integrity check for type 'OHOS::RefBase' failed during virtual call

Reason

!1272:多线程环境下dlopen同一个so崩溃 changed the order of running the destructors and unmapping the library from the CFI shadow in case of dlclose, so CFI-protected calls inside those destructors are now confused and can't use information from the currently unloading DSOs.

how to fix

Unmap from CFI shadow only after all of the destructors are run.

Test (libc-test is mandatory, but not limited to)

  • pass libc-test
    libc-test before adding the new test:
All: 1245 | Run: 1201 | Skip: 44
Pass: [1201/1201]
Fail: [0/1201]

the new test fails before this PR, passes with this PR

Need to cherry-pick to release(eg:3.0LTS ... )branch?

  • yes,branch list:
  • no

why:

Compatibility impact assessment, please indicate (Y/N)