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

Segfault on deleting tuple with observation, action, reward in example/libecole/src/branching.cpp #373

Open
nkrit1 opened this issue Sep 8, 2024 · 0 comments
Labels
type/bug 🐛 Something isn't working

Comments

@nkrit1
Copy link

nkrit1 commented Sep 8, 2024

Describe the bug

There is a segfault when deleting tuple with observation, action, reward in example/libecole/src/branching.cpp.
I changed NodeBipatite observation function for StrongBranchingScores in branching.cpp:

#include <exception>
#include <iostream>
#include <tuple>
#include <utility>

#include "ecole/environment/branching.hpp"
#include "ecole/information/nothing.hpp"
#include "ecole/instance/set-cover.hpp"
#include "ecole/observation/node-bipartite.hpp"
#include "ecole/reward/n-nodes.hpp"
#include "ecole/observation/strong-branching-scores.hpp"

int main() {
	try {
		auto env = ecole::environment::
			Branching<ecole::observation::StrongBranchingScores, ecole::reward::NNodes, ecole::information::Nothing>{};
		std::size_t constexpr n_rows = 100;
		std::size_t constexpr n_cols = 200;
		auto gen = ecole::instance::SetCoverGenerator{{n_rows, n_cols}};

		static constexpr auto n_episodes = 3;
		for (std::size_t i = 0; i < n_episodes; ++i) {
			auto [obs, action_set, reward, done, info] = env.reset(gen.next());
			while (!done && action_set.has_value()) {
				std::tie(obs, action_set, reward, done, info) = env.step(action_set.value()[0]);
			}
		}
	} catch (std::exception const& e) {
		std::cerr << "Error: " << e.what() << '\n';
	}
}

Setting

  • OS: Ubuntu 18.04
  • Compiler: gcc 12.4.0
  • Python version: 3.11.9
  • Ecole version: 0.8.1 (last release)
  • SCIP: 8.0.0 (passed as CMAKEARGS to ecole)
  • CMake: 3.30.3
  • xsimd: 8.1.0
  • xtensor: 0.24.6
  • xtensor-python: 0.26.1

To Reproduce

  1. Change branching.cpp example in a way presented above.
  2. Run

Expected behavior

Expected behavior is to get strong branching scores in observation.

Additional context

I use gdb for debugging and the main tread is paused on exception(our segfault) and everything starts from std::tuple()::~tuple().

@nkrit1 nkrit1 added the type/bug 🐛 Something isn't working label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant