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

Seg fault when decompiling Greeter Contract #40

Open
thpun opened this issue Nov 2, 2017 · 2 comments
Open

Seg fault when decompiling Greeter Contract #40

thpun opened this issue Nov 2, 2017 · 2 comments

Comments

@thpun
Copy link

thpun commented Nov 2, 2017

System Information

Porosity version: 20171027.5

solidity version: 0.4.9+commit.364da425.Linux.g++ & 0.4.17+commit.bdeb9e52.Linux.g++

Testing environment: Ubuntu 16.04

Behaviour

I'm testing how porosity performs when dealing with 'inheritance' of contract, so I start with the sample Ethereum contract - Greeter. And I compile the contract using solidity v0.4.9 & v0.4.17 to see if the version affects the result.
In both versions, the decompilation works "fine" for contract Mortal but gets segmentation fault for contract Greeter.

greeter.sol

pragma solidity ^0.4.9;

contract mortal {
    /* Define variable owner of the type address */
    address owner;

    /* This function is executed at initialization and sets the owner of the contract */
    function mortal() { owner = msg.sender; }

    /* Function to recover the funds on the contract */
    function kill() { if (msg.sender == owner) selfdestruct(owner); }
}

contract greeter is mortal {
    /* Define variable greeting of the type string */
    string greeting;

    /* This runs when the contract is executed */
    function greeter(string _greeting) public {
        greeting = _greeting;
    }

    /* Main function */
    function greet() constant returns (string) {
        return greeting;
    }
}

result of decompiling mortal

Porosity v0.1 (https://www.comae.io)
Matt Suiche, Comae Technologies <[email protected]>
The Ethereum bytecode commandline decompiler.
Decompiles the given Ethereum input bytecode and outputs the Solidity code.

Attempting to parse ABI definition...
Success.
Hash: 0x41C0E1B5
executeInstruction: NOT_IMPLEMENTED: REVERT
function kill() {
      if (!msg.value) {
      }
      return;
}


LOC: 5

result of decompiling greeter

Porosity v0.1 (https://www.comae.io)
Matt Suiche, Comae Technologies <[email protected]>
The Ethereum bytecode commandline decompiler.
Decompiles the given Ethereum input bytecode and outputs the Solidity code.

Attempting to parse ABI definition...
Success.
Hash: 0x41C0E1B5
executeInstruction: NOT_IMPLEMENTED: REVERT
function kill() {
      if (!msg.value) {
      }
      return;
}


LOC: 5
Hash: 0xCFAE3217
executeInstruction: NOT_IMPLEMENTED: REVERT
Segmentation fault (core dumped)
@anymos
Copy link

anymos commented Nov 23, 2017

Good morning,

I have the exact same issue with a contract ( no abi )

How could I help ? any error trapping framework that could be add on top of the cpp to help to track this kind of issue ?

Kindly let me know, I am willing to help on that project and I could release a PR accordingly

@sadgb
Copy link

sadgb commented Dec 10, 2017

same story here. No abi, segmentation fault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants