BinaryAnalysisPlatform/bap

x86 is missing dependency on Str library

grsnl opened this issue · 1 comments

grsnl commented

The x86 plugin uses the Str library

let lab_of_exp =
let re = Str.regexp "^pc_\\(.*\\)+" in
function
(* VEX style pc_0x1234 labels *)
| Lab s when Str.string_match re s 0 ->
Some(Addr(big_int_of_string (Str.matched_group 1 s)))
| Lab s -> Some(Name s)
| Int(i, t) ->
Some(Addr i)
| _ -> None

but doesn't declare a dependency on the Str library which can cause Dynlink errors loading the plugin.

This mistake is hidden when the elf plugin is available since it depends on bitstring which in turn depends on str and seems to be loaded (always?) before the x86 plugin.

ivg commented

Ouch, thanks for catching this! And yes, plugins are loaded in the alphabetic order, so indeed x86 is loaded probably the last. The fix is already in CI.