Opened 3 years ago

Closed 3 years ago

Last modified 4 weeks ago

#21449 closed defect (fixed)

CoinBackend: _test_solve fails on 32-bit

Reported by: jdemeyer Owned by:
Priority: blocker Milestone: sage-7.4
Component: doctest coverage Keywords: sdl
Cc: mkoeppe Merged in:
Authors: Jeroen Demeyer Reviewers: Thierry Monteil, Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: 5eacf72 (Commits) Commit:
Dependencies: Stopgaps:

Description (last modified by mkoeppe)

On Linux arando 3.13.0-95-generic #142-Ubuntu SMP Fri Aug 12 17:05:16 UTC 2016 i686 i686 i686 GNU/Linux:

**********************************************************************
File "src/sage/numerical/backends/coin_backend.pyx", line 39, in sage.numerical.backends.coin_backend.CoinBackend
Failed example:
    TestSuite(p).run(skip="_test_pickling")               # optional - cbc
Expected nothing
Got:
    Failure in _test_solve:
    Traceback (most recent call last):
      File "/home/jdemeyer/sage-git/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 283, in run
        test_method(tester = tester)
      File "sage/numerical/backends/generic_backend.pyx", line 697, in sage.numerical.backends.generic_backend.GenericBackend._test_solve (build/cythonized/sage/numerical/backends/generic_backend.c:8748)
        with tester.assertRaises(MIPSolverException) as cm:   # unbounded
      File "/home/jdemeyer/sage-git/local/lib/python/unittest/case.py", line 116, in __exit__
        "{0} not raised".format(exc_name))
    AssertionError: MIPSolverException not raised
    ------------------------------------------------------------
    The following tests failed: _test_solve
**********************************************************************

This is what is happening on a 32-bit Linux:

sage: from sage.numerical.backends.coin_backend import CoinBackend
sage: p = CoinBackend()
sage: p.add_linear_constraints(5, 0, None)
sage: p.add_col(range(5), range(5))
sage: p.objective_coefficient(0,1)
sage: p.solve()
0
sage: p.set_verbosity(3)
sage: p.solve()
Cbc3007W No integer variables - nothing to do
Clp0006I 0  Obj 0 Dual inf 0.9999999 (1)
Clp0000I Optimal - objective value -1.7976931e+308
0   ### Instead, an exception should have been raised.
sage: p.get_variable_value(0)
1.7976931348623157e+308  ### BAD

Change History (24)

comment:1 Changed 3 years ago by jdemeyer

  • Branch set to u/jdemeyer/coinbackend___test_solve_fails_on_32_bit

comment:2 Changed 3 years ago by jdemeyer

  • Cc mkoeppe added
  • Commit set to 4b1e5a71451f1f5834dbcf62cfcbfc832c890bbc
  • Status changed from new to needs_review

New commits:

4b1e5a7CoinBackend: _test_solve fails on 32-bit

comment:3 Changed 3 years ago by git

  • Commit changed from 4b1e5a71451f1f5834dbcf62cfcbfc832c890bbc to 33ad25e5f987021eff7eb501e9e8416b89d9eca8

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

33ad25eCoinBackend: _test_solve fails on 32-bit

comment:4 follow-up: Changed 3 years ago by mkoeppe

"known bug on 32 bit" -- to whom is this bug known?

comment:5 in reply to: ↑ 4 Changed 3 years ago by jdemeyer

Replying to mkoeppe:

"known bug on 32 bit" -- to whom is this bug known?

To you now :-)

comment:6 follow-up: Changed 3 years ago by tmonteil

I also fall on this problem. I see that the fix is to ignore the doctest for 32bit systems. How do you know that the doctest failure does not mean that there is a problem somewhere (that should be addressed) ?

comment:7 Changed 3 years ago by mkoeppe

There definitely is a problem, and it should NOT be ignored.

comment:8 in reply to: ↑ 6 Changed 3 years ago by jdemeyer

Replying to tmonteil:

How do you know that the doctest failure does not mean that there is a problem somewhere

I am not claiming that. I am adding # known bug, which means that I agree that there is a problem somewhere.

Of course, if the real bug can be fixed, that would be better. But in the mean time, just to have all doctests formally passing (and make a 32-bit patchbot useful), I propose to add the # known bug.

comment:9 Changed 3 years ago by tmonteil

  • Reviewers set to Thierry Monteil

If Mathias is OK with that, i am also in favor to set this ticket to positive review (i confirm that the patch fixes the doctest on my 32bit VM).

If someone has an idea where the bug comes from and how to fix it, that would be great.

comment:10 Changed 3 years ago by mkoeppe

I am building a 32-bit environment at the moment to look at what's going on here.

comment:11 Changed 3 years ago by mkoeppe

  • Description modified (diff)

comment:12 follow-up: Changed 3 years ago by mkoeppe

Upgrading CBC to 2.9.8 (latest) does NOT fix this problem.

comment:13 in reply to: ↑ 12 Changed 3 years ago by tmonteil

Replying to mkoeppe:

Upgrading CBC to 2.9.8 (latest) does NOT fix this problem.

Do you have an idea about where the problem comes from ? Does upstream say something about this ?

comment:14 follow-up: Changed 3 years ago by mkoeppe

I haven't checked with upstream yet. I am actually not sure yet if this a problem with the library or with our Cython wrapper.

comment:15 in reply to: ↑ 14 Changed 3 years ago by tmonteil

Replying to mkoeppe:

I haven't checked with upstream yet. I am actually not sure yet if this a problem with the library or with our Cython wrapper.

So shall we accept the current fix and postpone a real fix for when we understant more the situation ?

comment:16 Changed 3 years ago by mkoeppe

The patch at least needs to include reference to a ticket; and when this ticket is closed a follow-up tickets for an actual fix needs to be opened.

comment:17 Changed 3 years ago by jdemeyer

I created a new ticket at #21550 (details to be filled in) and added a reference to that ticket in the doctest.

comment:18 Changed 3 years ago by git

  • Commit changed from 33ad25e5f987021eff7eb501e9e8416b89d9eca8 to 5eacf72e79d02bc30ce5701d86db4ce8a03a10f2

Branch pushed to git repo; I updated commit sha1. New commits:

5eacf72Add ticket number

comment:19 follow-up: Changed 3 years ago by dimpase

I am surprised to see that sys.float_info returns the same on 32-bit and on 64-bit Linux. On 32-bit:

dima@arando:~$ python
Python 2.7.6 (default, Jun 22 2015, 18:00:18) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.float_info
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)

anyhow we might be hitting a classic like https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

comment:20 in reply to: ↑ 19 Changed 3 years ago by jdemeyer

Replying to dimpase:

I am surprised to see that sys.float_info returns the same on 32-bit and on 64-bit Linux. On 32-bit:

Why? The C type double is the same on 32-bit and 64-bit architectures.

comment:21 Changed 3 years ago by tmonteil

  • Reviewers changed from Thierry Monteil to Thierry Monteil, ​Matthias Koeppe
  • Status changed from needs_review to positive_review

comment:22 Changed 3 years ago by vbraun

  • Branch changed from u/jdemeyer/coinbackend___test_solve_fails_on_32_bit to 5eacf72e79d02bc30ce5701d86db4ce8a03a10f2
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:23 Changed 2 years ago by jdemeyer

  • Commit 5eacf72e79d02bc30ce5701d86db4ce8a03a10f2 deleted
  • Reviewers changed from Thierry Monteil, ​Matthias Koeppe to Thierry Monteil, Matthias Koeppe

comment:24 Changed 4 weeks ago by tmonteil

  • Keywords sdl added
Note: See TracTickets for help on using tickets.