[PATCH] opcodes/i386-dis.c is not thread-safe

Jan Beulich jbeulich@suse.com
Wed Jan 5 11:42:14 GMT 2022


On 05.01.2022 08:07, Vladimir Mezentsev via Binutils wrote:
> From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
> 
> We plan to use print_insn_i386_att, print_insn_i386_intel and
> print_insn_i386 in a multithreaded application.
> These functions are not thread safe due to the use of static variables.
> 
> Tested on x86_64-pc-linux-gnu.
> 
> opcodes/ChangeLog:
> 2022-01-04 Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
> 
> 	* opcodes/i386-dis.c: Make print_insn_i386_att, print_insn_i386_intel
> 	and print_insn_i386 thread-safe

While I appreciate this step, I don't think the result is quite thread-
safe yet. In particular the various abort() invocations aren't going to
play well with a multi-threaded consumer of the library. And we know
that there have been bugs in this area, i.e. where abort() would have
got triggered by certain invalid encodings; I'm pretty certain we haven't
found (and eliminated) all of them just yet.

Jan



More information about the Binutils mailing list