ds4dm / ecole

Extensible Combinatorial Optimization Learning Environments
https://www.ecole.ai
BSD 3-Clause "New" or "Revised" License
321 stars 68 forks source link

Segmentation fault when reading an instance from a file #325

Closed SelinBayramoglu closed 2 years ago

SelinBayramoglu commented 2 years ago

Describe the bug

I can use the method env.reset only when the instances are generated from an instance generator. When I use the path of an existing lp as an argument to env.reset, I get a segmentation fault.

Setting

To Reproduce

import ecole

env = ecole.environment.Branching()
instance = "test.lp"
observation, action_set, reward_offset, done, info = env.reset(instance)

Expected behavior

I was expecting the program to work without errors, since there are examples in this repository where env.reset is called on the path to an instance file, for example env.reset("myinstance.lp").

Any help will be much appreciated!

AntoinePrv commented 2 years ago

Hello @SelinBayramoglu,

Unfortunately I cannot reproduce your error, especially without knowing what test.lp is. I would suggest you try to solve test.lp with SCIP/PySCIPOpt alone.

tegg89 commented 2 years ago

I also have the same error. I could read an instance problem and optimize it with SCIP and PySCIPOpt. However, when I reset the Ecole environment with the same instance, the system corrupted due to the segmentation fault error. If I run it with Ecole installed via conda, I can run the instance without any error. However, Ecole installed via pip causes the segmentation fault error.

Setting

AntoinePrv commented 2 years ago

I also have the same error. I could read an instance problem and optimize it with SCIP and PySCIPOpt. However, when I reset the Ecole environment with the same instance, the system corrupted due to the segmentation fault error.

Is this one specific file? Or any file you try with?

If I run it with Ecole installed via conda, I can run the instance without any error. However, Ecole installed via pip causes the segmentation fault error.

Did you try calling other SCIP functions from Ecole (e.g. ecole.scip.Model.prob_basic())? If none of them work with your pip install, it could be an installation problem rather than a problem in the library (Ecole pip installations are hard to get right because SCIP is not part of the environment).

amf272 commented 2 years ago

Hi, I am running into this segfault as well. I am getting the segfault with this instance: instance_0.cip.zip Is there any ability to run in debug mode to give a better description of the error? If it helps I also ran this with a .lp file from a separate instance which failed as well. On my end I am able to run your snippet without error ecole.scip.Model.prob_basic()

I installed ecole from source with scip 8.0.2 and ecole version 0.8.1. Also, on my end it seemed to work in an earlier version of ecole but I installed the newer version as I am starting a new project.

On my end the command that doesn't work is ecole.scip.Model.from_file(instance) rather than the above code (but the above code doesn't work as well)

SelinBayramoglu commented 2 years ago

I also solved that problem with using an earlier version of Ecole (0.7.3).

tegg89 commented 2 years ago

I tried multiple problem files, and the program interrupted with the error message: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV). When I use the conventional problem with the implemented generator, i.e., set cover, the environment successfully loads the problem. I found that the Ecole CAN load the customized problem file in the terminal. However, the environment failed when using in PyCharm.

AntoinePrv commented 1 year ago

Unfortunately I am still not able to reproduce the error even with instance_0.cip.

There may well be something not working with Ecole or Scip, but it's impossible for me to tell without a reproducible example.