question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug in bitwise_or_simplifier?

See original GitHub issue

Hello,

I am encountering a crash in angr. The exact scenario is difficult to reproduce, but I think the following information might be sufficient.

Here is a backtrace of the Claripy exception:

(Pdb) traceback.print_exc()
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/angr/engines/vex/claripy/irop.py", line 375, in calculate
    return self.extend_size(self._calculate(args))
  File "/usr/local/lib/python3.7/site-packages/angr/engines/vex/claripy/irop.py", line 437, in _op_mapped
    return getattr(claripy.ast.BV, o)(*sized_args)
  File "/usr/local/lib/python3.7/site-packages/claripy/operations.py", line 53, in _op
    simp = _handle_annotations(simplifications.simpleton.simplify(name, fixed_args), args)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 42, in simplify
    return self._simplifiers[op](*args)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 604, in bitwise_or_simplifier
    elif (a == b).is_true():
  File "/usr/local/lib/python3.7/site-packages/claripy/operations.py", line 53, in _op
    simp = _handle_annotations(simplifications.simpleton.simplify(name, fixed_args), args)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 42, in simplify
    return self._simplifiers[op](*args)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 227, in eq_simplifier
    simp = SimplificationManager.zeroext_extract_comparing_against_constant_simplifier(operator.__eq__, a, b)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 950, in zeroext_extract_comparing_against_constant_simplifier
    return op(ast.all_operations.ZeroExt(to_extend, a_inner_expr), b)
  File "/usr/local/lib/python3.7/site-packages/claripy/operations.py", line 53, in _op
    simp = _handle_annotations(simplifications.simpleton.simplify(name, fixed_args), args)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 42, in simplify
    return self._simplifiers[op](*args)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 232, in eq_simplifier
    simp = SimplificationManager.zeroext_comparing_against_simplifier(operator.__eq__, a, b)
  File "/usr/local/lib/python3.7/site-packages/claripy/simplifications.py", line 968, in zeroext_comparing_against_simplifier
    b_highbits = b[b.size() - 1 : b.size() - a_zeroext_bits]
  File "/usr/local/lib/python3.7/site-packages/claripy/ast/bv.py", line 72, in __getitem__
    return Extract(left, right, self)
  File "/usr/local/lib/python3.7/site-packages/claripy/operations.py", line 50, in _op
    raise ClaripyOperationError(msg)
claripy.errors.ClaripyOperationError: Extract low must be <= high

And here are the args of the bitwise OR operation:

(Pdb) print(args)
(<BV8 (0 .. mem_c0000000_255_32{UNINITIALIZED}[14:0])[15:8]>, <BV8 128>)

Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ltfishcommented, Jan 23, 2021

This is probably my code. I’ll take a look after my meetings today.

0reactions
ltfishcommented, Jan 25, 2021

You are welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Identical expressions should not be used on both sides of a ...
In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and...
Read more >
80588 – GCC can't simplify static inline function with xor/xnor
Bug 80588 - GCC can't simplify static inline function with xor/xnor ... For bitwise binary operations apply operand conversions to the ...
Read more >
The curious case of Binary Search — The famous bug that ...
All Divide and Conquer algorithms (like Binary Search, Merge Sort) are vulnerable to this simple bug that went undetected for decades.
Read more >
bugs - What's wrong with Simplify and FullSimplify?
Extended comment: $Version. "10.1.0 for Mac OS X x86 (64-bit) (March 24, 2015)". eq = 0.0055356626 + 0.000029 x + 0.000034 y <=...
Read more >
Modular Bug-finding for Integer Overflows in the Large
tool combines the scalable static analysis engine PREfix [14] and the bit-precise efficient SMT solver. Z3 [20]. Since 1999, PREfix has been used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found