Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

v1.6.1 segfault with abi generation #511

Closed
johndebord opened this issue Apr 26, 2019 · 4 comments
Closed

v1.6.1 segfault with abi generation #511

johndebord opened this issue Apr 26, 2019 · 4 comments
Assignees

Comments

@johndebord
Copy link
Contributor

johndebord commented Apr 26, 2019

v1.6.1 of eosio-cpp currently has a bug which causes a seg fault, but only with abi generation and under certain circumstances.

@johndebord johndebord self-assigned this Apr 26, 2019
@johndebord johndebord changed the title v1.6.1 and v1.5.0 segfault bug v1.6.1 segfault with abi generation Apr 26, 2019
@cryptosig
Copy link

cryptosig commented May 8, 2019

I believe I'm running into this error as well
Update:
I have traced the segmentation fault whilst generating abi to the following line of code, "fixed_bytes<32> bytes_value;", declaring this inside of my table is what has been causing my seg fault. I hope this helps.

@johndebord
Copy link
Contributor Author

johndebord commented May 14, 2019

@cryptosig This issue has been resolved. The problem we encountered was that the tool eosio-abigen segfaults when declaring a std::vector of itself within its own data structure.


For example:

#include <vector>

#include <eosio/contract.hpp>
#include <eosio/multi_index.hpp>

using namespace eosio;

struct [[eosio::contract]] main : eosio::contract {
   using contract::contract;

   struct [[eosio::table]] structure {
      std::vector<structure> vec;
   };

   [[eosio::action]] void act()
   { }
};

Compiles, but segaults during .abi generation.


#include <vector>

#include <eosio/contract.hpp>
#include <eosio/multi_index.hpp>

using namespace eosio;

struct [[eosio::contract]] con : eosio::contract {
   using contract::contract;

   struct [[eosio::table]] structure {
      std::vector<int> vec;
   };

   [[eosio::action]] void act()
   { }
};

Compiles and does not segault during .abi generation.


@cryptosig If the issue you're having is still not solved by this solution, please open up a new issue and provide some code/context of the issue you're encountering.

@znebby
Copy link

znebby commented Jul 23, 2019

@johndebord How is this issue solved? 1.6.2 still SegFaults when a table references itself in a vector. Can we re-open this issue?

@jeffreyssmith2nd
Copy link
Contributor

@znebby See issue #527, there's an ongoing discussion on that issue about table references in a vector.

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

No branches or pull requests

4 participants