Hello,
I had a client created with DR 8.0.0-1 about two years ago. Been using it just fine. However, had to move to a system with a lib newer than 2.35, so now I am forced to update to a newer DR as well. I am now testing with the latest 11.3.0-1.
I have a lot of dr_insert_clean_call. Most of them were inserted in drmgr_register_bb_app2app_event and drmgr_register_bb_instru2instru_event callbacks. They were working fine before, but now are giving me the error "clean call app context flags not supported outside insertion phase".
Most of the clean called functions do not have any use of dr_get_mcontext except for 3 of them. I moved those three to drmgr_register_bb_instrumentation_event instead. But I am still getting the same error!
I managed to track it down with gdb, and the clean call in question gets to function drreg_event_clean_call_insertion with the flags (DR_CLEANCALL_READS_APP_CONTEXT | DR_CLEANCALL_WRITES_APP_CONTEXT) and still causes it to break. I am 100% sure that the clean call function (and every function called inside it) doesn't read or write app context (at least not explicitly through dr_get_mcontext and the like).
My question is, what causes these two flags to be set? Other than dr_get_mcontext? How do I debug this further?