google / or-tools

Google's Operations Research tools:
https://developers.google.com/optimization/
Apache License 2.0
11.24k stars 2.13k forks source link

Windows fatal exception when calling Solve() #4311

Closed Mark531 closed 3 months ago

Mark531 commented 3 months ago

What version of OR-Tools and what language are you using? Version: 9.10.4067 Language: Python 3.12

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi) CP-SAT

What operating system (Linux, Windows, ...) and version? Windows 10, version 22H2

What did you do? I just tried to run the sample code given in the documentation:

from ortools.linear_solver import pywraplp
solver = pywraplp.Solver.CreateSolver("SAT")
infinity = solver.infinity()
x = solver.IntVar(0.0, infinity, "x")
y = solver.IntVar(0.0, infinity, "y")
solver.Add(x + 7 * y <= 17.5)
solver.Add(x <= 3.5)
solver.Maximize(x + 10 * y)
status = solver.Solve()

What did you expect to see I expect the solver to return with the optimal parameters.

What did you see instead? The last line triggers a crash that causes the python kernel to restart:

Solving with CP-SAT solver v9.10.4067

Windows fatal exception: Windows fatal exception: access violation

Windows fatal exception: access violationWindows fatal exception: access violation

access violationWindows fatal exception: access violation

Windows fatal exception: access violation

Windows fatal exception: access violation

Windows fatal exception: access violation

Thread 0xWindows fatal exception: access violation

Windows fatal exception: access violation

Windows fatal exception: Windows fatal exception: access violation

Windows fatal exception: access violation

Windows fatal exception: access violation

00003b70 (most recent call first): access violation File

"Windows fatal exception: C:\Users\Mark4\anaconda3\envs\dev\Lib\site-packages\zmq\utils\garbage.pyaccess violation"

, line 47 in Windows fatal exception: runaccess violation File

"C:\Users\Mark4\anaconda3\envs\dev\Lib\threading.py", line 1052 in _bootstrap_inner File "C:\Users\Mark4\anaconda3\envs\dev\Lib\threading.py", line 1009 in _bootstrap

Thread 0xWindows fatal exception: 00001f7c (most recent call first): access violation

File "C:\Users\Mark4\anaconda3\envs\dev\Lib\site-packages\ipykernel\parentpoller.py", line 93 in run File "C:\Users\Mark4\anaconda3\envs\dev\Lib\threading.py", line 1052 in _bootstrap_inner File "C:\Users\Mark4\anaconda3\envs\dev\Lib\threading.py", line 1009 in _bootstrap

Main thread: Thread 0x00003374 (most recent call first): File "C:\Users\Mark4\anaconda3\envs\dev\Lib\site-packages\ortools\linear_solver\pywraplp.py", line 281 in Solve File "C:\Users\Mark4\AppData\Local\Temp\ipykernel_15900\452910094.py", line 2 in

Main thread: Current thread 0x00003374 (most recent call first): File "C:\Users\Mark4\anaconda3\envs\dev\Lib\site-packages\ortools\linear_solver\pywraplp.py", line 281 in Solve File "C:\Users\Mark4\AppData\Local\Temp\ipykernel_15900\452910094.py", line 2 in

Anything else we should know about your project / environment It's not linked to an IDE since it also crashes from an Anaconda prompt.

lperron commented 3 months ago

duplicate.

Mark531 commented 3 months ago

Duplicate with what? Please be specific so that I could follow the original issue.

lperron commented 3 months ago

https://github.com/google/or-tools/releases

In the 9.10 release notes

Mark531 commented 3 months ago

@lperron I upgraded C++ Redistributable, reinstalled ortools and I face the same issue. Could you please walk me through the way to fix this?

lperron commented 3 months ago

No idea. I do not have the issue. A lots of users reported success.

Le mar. 16 juil. 2024, 22:07, Mizux @.***> a écrit :

Assigned #4311 https://github.com/google/or-tools/issues/4311 to @lperron https://github.com/lperron.

— Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/4311#event-13526534366, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3JU3HL6EFQPGOLRQOLZMV4PJAVCNFSM6AAAAABK3CUHHCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGUZDMNJTGQZTMNQ . You are receiving this because you were assigned.Message ID: @.***>

Mark531 commented 3 months ago

Not all of them apparently: https://github.com/google/or-tools/issues/4227

Well, I guess the C++ compiler is used to build the wheel file during the installation. In any case, the installation procedure should ensure that the compiler has the right version and that the produced binary works correctly. Thanks @Mizux for adding this as a bug to be fixed in the 9.11 version of ortools.