Proper lifting of atomic operations

Open
#5,066 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

Start by reproducing the two examples and comparing the decompiled output with the corresponding disassembly, focusing on the atomic nature of lock cmpxchg and lock inc. Trace how these instructions are lifted and determine how the decompiled result should visibly distinguish atomic operations. Done means the lifted output preserves and communicates atomicity clearly.

Written by the indexing model from the issue text.

Description

Component: Core Effort: Medium Impact: High

As I'm delving deeper into multithreaded code, the lack of proper lifting for atomic operations is starting to become a bit of a problem.

Some examples:

image
image

There's no obvious indicator that these are actually lock cmpxchg and lock inc respectively. You'd only realize that if you switch over to disassembly. This can lead to bugs if I start writing code that interoperates with the decompiled code in question but doesn't do operations atomically because I missed that detail.

(Is this already tracked somewhere? I seem to recall it being discussed on other issues, but couldn't find anything.)

Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Vector35/binaryninja-api

All issues in Vector35/binaryninja-api

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.