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

Vladimir Mezentsev vladimir.mezentsev@oracle.com
Wed Jan 5 06:54:11 GMT 2022



On 1/4/22 09:47, H.J. Lu wrote:
> On Tue, Jan 04, 2022 at 09:38:40AM -0800, Vladimir Mezentsev via Binutils wrote:
>> Ping.
>>
>>
>> -------- Forwarded Message --------
>> Subject: 	[PATCH] opcodes/i386-dis.c is not thread-safe
>> Date: 	Mon, 20 Dec 2021 15:04:17 -0800
>> From: 	vladimir.mezentsev@oracle.com
>> To: 	binutils@sourceware.org
>>
>>
>>
>> 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:
>> 2021-12-20 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
>> ---
>> opcodes/i386-dis.c | 3488 ++++++++++++++++++++++----------------------
>> 1 file changed, 1754 insertions(+), 1734 deletions(-)
>>
>> ....
>>
> Please follow GNU coding standard:
>
> https://www.gnu.org/prep/standards/
>
> contrib/check_GNU_style.py in gcc source:
>
> https://gcc.gnu.org/git?p=gcc.git;a=blob;f=contrib/check_GNU_style.py

Thank you for links.

check_GNU_style.py really helps.
I will send a new path after testing.

>
> and clang-format may help.

clang-format reports no errors now.
But I've run clang-format after  check_GNU_style.p.

Thank you,
-Vladimir


>
>
> H.J.



More information about the Binutils mailing list