Closed cavidan1 closed 5 years ago
What does
sage: from fpylll import BKZ
sage: BKZ.DEFAULT_STRATEGY
return? Is there a file at the location pointed to by that filename? If not, that's your issue and it seems you moved the installation after installing it.
Sage package is in Singularity container. It works for LLL reduction but not for BKZ.
It returns
/usr/local/SageMath/local/share/fplll/strategieparse error - unpreprocessing_blpruning_parameteError: gptr == nullpointer.
Thanks.
Okay, I have no idea what's going on there. It seems fpylll can't find the BKZ strategies file.
I see. Thank you for your time.
Hello,
I am the sysadmin who installed this. This is installed in a Singularity container. The installation was NOT moved. Within the container the strategies directory and default.json exist.
Singularity sage-8.6_ubuntu-16.04.simg:/usr/local/SageMath/local/share/fplll/strategies> ls /usr/local/SageMath/local/share/fplll/strategies/default.json /usr/local/SageMath/local/share/fplll/strategies/default.json
Nevertheless the error reported by cavidan1 is persistant. Are there any environment variable that need to be set. I looke d but was unable to find.
Nope. The deeper problem seems to be the parse error, no idea why that happens.
/usr/local/SageMath/local/share/fplll/strategieparse error - unpreprocessing_blpruning_parameteError: gptr == nullpointer.
So it finds the file but can't read it?
Seems you're getting a NULL pointer somehow?
Any idea what I can do to trouble shoot this?
sage: from fpylll import BKZ
sage: BKZ.DEFAULT_STRATEGY
b'default.json'
and then (a Sage doctest):
sage: from sage.modules.free_module_integer import IntegerLattice
sage: L = IntegerLattice(sage.crypto.gen_lattice(type='modular', m=10, seed=1337, dual=True))
sage: L.shortest_vector()
terminate called after throwing an instance of 'std::runtime_error'
what(): Cannot open strategies file.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/work/sage/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10347)()
1942 try:
-> 1943 return cache[k]
1944 except TypeError: # k is not hashable
KeyError: ((True, 'fplll'), ())
...
sage: from fpylll import BKZ sage: BKZ.DEFAULT_STRATEGY b'default.json'
and then (a Sage doctest):
sage: from sage.modules.free_module_integer import IntegerLattice sage: L = IntegerLattice(sage.crypto.gen_lattice(type='modular', m=10, seed=1337, dual=True)) sage: L.shortest_vector() terminate called after throwing an instance of 'std::runtime_error' what(): Cannot open strategies file. --------------------------------------------------------------------------- KeyError Traceback (most recent call last) ~/work/sage/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10347)() 1942 try: -> 1943 return cache[k] 1944 except TypeError: # k is not hashable KeyError: ((True, 'fplll'), ()) ...
Could I get some more information on this? Is this the latest Sage version? How was this built?
I tried to fix a similar bug in #220 but it's possible that my local Sage is different from yours. If you could let me know I'll take a look tomorrow and get back to you.
It's probably a Debian 11 bug - I'm using fplll that comes in Debian, and it appears they just don't install default.json
anywhere.
See https://packages.debian.org/bullseye/libfplll-dev
more precisely, Debian 11 installs default.json
in /usr/share/libfplll7/strategies/
- and apparently fpylll can't find it there.
Thanks for the info! I'll try reproduce it tomorrow (and if possible get a patch done too).
On Fri, 4 Feb 2022, 23:10 Dima Pasechnik, @.***> wrote:
more precisely, Debian 11 installs default.json in /usr/share/libfplll7/strategies/ - and apparently fpylll can't find it there.
— Reply to this email directly, view it on GitHub https://github.com/fplll/fpylll/issues/133#issuecomment-1030420151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF7CASDODTGUMHYCC2DR4DTUZRMHTANCNFSM4HAJQW7A . You are receiving this because you commented.Message ID: @.***>
If fplll wrote that location in fplll.pc
, for pkg-config, it would be trivial to find from Python, or otherwise.
What does
sage: from fpylll import BKZ sage: BKZ.DEFAULT_STRATEGY
return? Is there a file at the location pointed to by that filename? If not, that's your issue and it seems you moved the installation after installing it.
see #221 - something is not right in fpylll.
I am running Sage on a remote cluster within a Singularity container. I am trying make BKZ reductions on different dimensional lattices.
My code:
But it returns runtime error:
terminate called after throwing an instance of 'std::runtime_error' what(): Cannot open strategies file. Traceback (most recent call last): File "./bkz_1", line 8, in
B = L.BKZ(block_size=80, proof=False)
File "/usr/local/SageMath/local/lib/python2.7/site-packages/sage/modules/free_module_integer.py", line 462, in BKZ
basis = [v for v in basis.BKZ(*args, **kwds) if v]
File "sage/matrix/matrix_integer_dense.pyx", line 2985, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.BKZ (build/cythonized/sage/matrix/matrix_integer_dense.c:24789)
File "src/fpylll/fplll/bkz_param.pyx", line 216, in fpylll.fplll.bkz_param.load_strategies_json
RuntimeError: Aborted
What should be done in this case? Thank you very much.