Search code examples
pythoncdebuggingscip

PySCIPOpt is frequently interrupted by segmentation fault (SIGSEGV)


I want to debug a Python program involving pyscipopt and contraint handler, but I get a segmentation fault very often.

I attach a cppgdb process to the main Python debugger like this. I notice that during the optimization I have several gdb threads running, one of them prints the optimal solution and then pauses on the exception:

python3: /home/avrech/scipoptsuite-6.0.2/scip/src/scip/debug.c:2029: SCIPcheckStage: Assertion `scip != NULL' failed.

The other one just exits with Segmentation fault (core dumped) and no additional information.

I want to understand why it happens, and to find a workaround to avoid this exception.

I have some hypothesis that it is related to SCIP internal threading and a shared memory that is freed by one thread and then accessed by another one. However, I don't know how to assess it. Maybe disabling multi-threading will help to test it? and more importantly to debug SCIP without exceptions?

To summarize my questions: 1. What can be the reason to this exception/segfault? 2. How to avoid it? 3. How to disable SCIP multi-threading if any?

Thanks


Solution

  • Unfortunately I do not know the answer to questions 1 and 2, but regarding question 3: SCIP does not use multi-threading, so your problem does not lie there.