Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinearFunction.__hash__ overflow #13797

Closed
jdemeyer opened this issue Dec 5, 2012 · 12 comments
Closed

LinearFunction.__hash__ overflow #13797

jdemeyer opened this issue Dec 5, 2012 · 12 comments

Comments

@jdemeyer
Copy link

jdemeyer commented Dec 5, 2012

On cicero (32-bit Linux), the following random test might fail:

sage -t  --long -force_lib devel/sage/sage/graphs/generic_graph.py
**********************************************************************
File "/home/buildbot/build/sage/cicero-1/cicero_full/build/sage-5.5.rc1/devel/sage-main/sage/graphs/generic_graph.py", line 4436:
    sage: arborescences = g.edge_disjoint_spanning_trees(k)  # long time (up to 15s on sage.math, 2011)
Exception raised:
    Traceback (most recent call last):
      File "/home/buildbot/build/sage/cicero-1/cicero_full/build/sage-5.5.rc1/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/home/buildbot/build/sage/cicero-1/cicero_full/build/sage-5.5.rc1/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/home/buildbot/build/sage/cicero-1/cicero_full/build/sage-5.5.rc1/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_68[8]>", line 1, in <module>
        arborescences = g.edge_disjoint_spanning_trees(k)  # long time (up to 15s on sage.math, 2011)###line 4436:
    sage: arborescences = g.edge_disjoint_spanning_trees(k)  # long time (up to 15s on sage.math, 2011)
      File "/home/buildbot/build/sage/cicero-1/cicero_full/build/sage-5.5.rc1/local/lib/python/site-packages/sage/graphs/generic_graph.py", line 4511, in edge_disjoint_spanning_trees
        p.add_constraint(r_edges[j][(u,v)] + r_edges[j][(v, u)] - edges[j][(u,v)], min=0)
      File "mip.pyx", line 1976, in sage.numerical.mip.MIPVariable.__getitem__ (sage/numerical/mip.c:10250)
      File "linear_functions.pyx", line 821, in sage.numerical.linear_functions.LinearFunction.__hash__ (sage/numerical/linear_functions.c:6740)
    OverflowError: Python int too large to convert to C long
**********************************************************************

Apply

CC: @vbraun @dimpase

Component: linear programming

Author: Volker Braun

Reviewer: Dmitrii Pasechnik

Merged: sage-5.5.rc1

Issue created by migration from https://trac.sagemath.org/ticket/13797

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 5, 2012

Author: vbraun, dimpase

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 5, 2012

Changed author from vbraun, dimpase to none

@vbraun
Copy link
Member

vbraun commented Dec 5, 2012

comment:3

I also fixed the comparison (which has to fulfill a contract with __hash__).

@vbraun
Copy link
Member

vbraun commented Dec 5, 2012

comment:4

I've tested in in a 32-bit VM and it works for me...

@vbraun
Copy link
Member

vbraun commented Dec 5, 2012

Author: Volker Braun

@vbraun
Copy link
Member

vbraun commented Dec 5, 2012

Attachment: trac_13797_hash_overflow.patch.gz

Updated patch

@vbraun
Copy link
Member

vbraun commented Dec 5, 2012

comment:5

Accidentally uploaded the wrong version, fixed now.

@dimpase

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Dec 12, 2012

comment:8

Looks OK.

@jdemeyer
Copy link
Author

Reviewer: Dmitrii Pasechnik

@jdemeyer
Copy link
Author

Merged: sage-5.5.rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants