Skip to main content

Segmentation fault error under ubuntu

Answered

Comments

4 comments

  • Eli Towle
    Gurobi Staff Gurobi Staff

    Could you post some minimal self-contained code that reproduces the segfault, as well as the output by Gurobi (if applicable)? If the segfault occurs while building the model, can you determine which line of code causes the error? Also, which versions of Gurobi and Python are you using?

    0
  • Vanessa Voelz
    Gurobi-versary
    First Comment
    First Question

    Hi Eli,

     

    thanks a lot for your answer, I really appreciate it. I am using Python 2.7.18 and Gurobi 9.0.2 (linux64). Unfortunately it's rather difficult for me to provide a minimal self-contained code that reproduces the segfault, because it is not consistent. For example yesterday afternoon I got the error message straight away - the output didn't even confirm the license - and this was also the case for quite simple models with one minute runtime. Earlier that day, I was able to run the program until the error occured at the ~15 % gap. When I started the server this morning, the code was running smoothly again and reached the desired 5 % optimality gap. In the second run (with a parameter change) the optimization stopped again at a ~ 20 % gap with the segfault. The error message then is "segmentation fault (core dumped)" and all previous gurobi outputs look normal. It appears to me that the segfault occurs randomly over time and I do not see any consistency, except that it mostly occured with large problem instances. If you like I could provide a code example that most likely wont reproduce the segfault.

    My model is quite big and depending on the input files easily contains 1 Mio. variables. I've been wondering if I need to delete/remove the model and its variables after the optimization process is finished in order to free RAM space. So far I don't have anything like this in my code.

     

    Regards,

    Vanessa

    0
  • Eli Towle
    Gurobi Staff Gurobi Staff

    Thanks for the extra information. In Python, you don't have to worry memory management yourself. Do you encounter segfaults when running other memory- or CPU-intensive processes? Is enough memory allocated to the VM?

    It sounds to me like this is an issue with the system hardware, guest OS, or virtual machine configuration. While it's certainly possible that Gurobi can cause a segfault, the solver is designed to be deterministic. If Gurobi were the source of the segfault, you would usually be able to run the same code on the same machine and run into the segfault in the same place every time. This does not seem to be the case here, since the segfault happens randomly throughout the code, even before model-building can begin.

    You could try to identify memory issues on the VM and/or its host machine with MemTest86/Memtest86+. Otherwise, I might create a new VM or at least re-install the guest OS like your colleague did, since that apparently fixed the problem.

    0
  • Vanessa Voelz
    Gurobi-versary
    First Comment
    First Question

    You were right and I have some memory issues according to the memory tests. They also show the inconsistent emergence of the problem. We'll try to fix it - at least the new set up of the VM. Thanks a lot for your time, it really helped me to narrow down the problem source.

    Regards, Vanessa 

    0

Please sign in to leave a comment.