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.

False positive "reachable exception" on fallback function

See original GitHub issue

I’m getting a false positive on a few contracts that don’t have a fallback function declared.

Here’s the report output:

Exception state

  • Type: Informational
  • Contract: Vault
  • Function name: _function_0x43d726d6
  • PC address: 979

Description

A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that assert() should only be used to check invariants. Use require() for regular input checking.

In Vault.json:44

state == _state

Note that the given source code corresponds to a modifier with require(state == _state_), not assert.

Two situations I see there are here:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
muellerberndtcommented, May 24, 2018

In both cases out-of-bounds array access can cause an exception.

mapping(address => Disbursement[]) public disbursements

^^ Out-of-bounds-access in the automatically generated getter function.

0reactions
sameepsicommented, Sep 13, 2018

@b-mueller I don’t think so. In that case it will simply set it. In solidity everything is set to default if it does not exists

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does fallback cause exception when expecting return ...
Have a look at this excerpt from a fallback function in a proxy contract. It offers no expectation about the return data size...
Read more >
Ethereum Smart Contract Security Recommendations
From how to handle external calls to commitment schemes, here are 10+ smart contract security patterns to follow when you're building on Ethereum....
Read more >
Oracle-Supported Dynamic Exploit Generation for Smart ...
Fallback Function. The fallback function is an important mechanism in Ethereum and is highly relevant to the reentrancy and exception disorder vulnerabilities.
Read more >
Model Optimizer Frequently Asked Questions
A : Model Optimizer cannot infer shapes or values for the specified node. It can happen because of the following reasons: a bug...
Read more >
arXiv:1901.01292v2 [cs.CR] 21 Jan 2019
Our approach does not produce false positives for safety properties ... Solidity fallback functions are further discussed in Appendix C.1.
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