Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal error: entered unreachable code at analyzer/src/traversal/functions.rs:379:5 #212

Closed
agroce opened this issue Jan 29, 2021 · 1 comment

Comments

@agroce
Copy link

agroce commented Jan 29, 2021

Compiling this file:

contract Ownable:
  pub def renounceOwnership():
    emit Owners^ipTransferred(msg.sender, address(0))
Warning: bytecode output requires 'solc-backend' feature. Try `cargo build --release --features solc-backend`. Skipping.
thread 'main' panicked at 'internal error: entered unreachable code', semantics/src/traversal/functions.rs:383:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c0b64d97beebb09325b5587abed39f4f1621026f/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/c0b64d97beebb09325b5587abed39f4f1621026f/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/c0b64d97beebb09325b5587abed39f4f1621026f/library/core/src/panicking.rs:50:5
   3: fe_semantics::traversal::functions::traverse_statements
   4: fe_semantics::traversal::functions::func_body
   5: fe_semantics::traversal::contracts::contract_def
   6: fe_semantics::traversal::module::module
   7: fe_semantics::analysis
   8: fe_compiler::compile
   9: fe::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aborted

On latest github master, built with

[profile.dev]
debug = true
panic = "abort"

for fuzzing. Using https://github.com/agroce/afl-compiler-fuzzer (we've found more than 50 bugs (that were worth fixing, and have been fixed) in solc using this afl variant) + afl.rs.

This might be a more interesting type of bug, if you think fe is ready for fuzzing at all.

@agroce
Copy link
Author

agroce commented Feb 17, 2021

More minimal (very minimal) contract:

contract o:
 pub def s():
    emit d

Current backtrace and failure is:

thread 'main' panicked at 'internal error: entered unreachable code', analyzer/src/traversal/functions.rs:379:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c0b64d97beebb09325b5587abed39f4f1621026f/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/c0b64d97beebb09325b5587abed39f4f1621026f/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/c0b64d97beebb09325b5587abed39f4f1621026f/library/core/src/panicking.rs:50:5
   3: fe_analyzer::traversal::functions::traverse_statements
   4: fe_analyzer::traversal::functions::func_body
   5: fe_analyzer::traversal::contracts::contract_def
   6: fe_analyzer::traversal::module::module
   7: fe_analyzer::analyze
   8: fe_compiler::compile
   9: fe::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aborted

@agroce agroce changed the title internal error: entered unreachable code at semantics/src/traversal/functions.rs:383:5 internal error: entered unreachable code at analyzer/src/traversal/functions.rs:379:5 Feb 17, 2021
cburgdorf added a commit to cburgdorf/fe that referenced this issue Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants