cffi.FFIError: multiple declarations of anonymous MPZ

122 views
Skip to first unread message

Ken Crowell

unread,
Mar 27, 2020, 3:15:58 PM3/27/20
to PyCryptodome
Hi,

I was wondering if anyone has ever seen something like this from the SelfTest, and knows what it might mean?

cffi.FFIError: multiple declarations of anonymous MPZ (for interactive usage, try cdef(xx, override=True))

Full traceback below.  The python here is installed as part of a Windows Salt minion; please take my word for it that this not a systematic issue with the Salt minion.  Directly modifying Util\_raw_api.py to add the override kwargs seems to make the problem go away.  Thanks for any help anyone might be able to provide.

PS C:\salt> c:\salt\bin\python.exe -V
Python 3.5.4

PS C:\salt> c:\salt\bin\python.exe -m Cryptodome.SelfTest
Traceback (most recent call last):
File "C:\salt\bin\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\salt\bin\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\salt\bin\lib\site-packages\Cryptodome\SelfTest\__main__.py", line 38, in <module>
SelfTest.run(stream=sys.stdout, verbosity=1, config=config)
File "C:\salt\bin\lib\site-packages\Cryptodome\SelfTest\__init__.py", line 61, in run
tests = get_tests(config=config)
File "C:\salt\bin\lib\site-packages\Cryptodome\SelfTest\__init__.py", line 90, in get_tests
from Cryptodome.SelfTest import Math; tests += Math.get_tests(config=config)
File "C:\salt\bin\lib\site-packages\Cryptodome\SelfTest\Math\__init__.py", line 41, in get_tests
tests += test_Numbers.get_tests(config=config)
File "C:\salt\bin\lib\site-packages\Cryptodome\SelfTest\Math\test_Numbers.py", line 744, in get_tests
from Cryptodome.Math._IntegerGMP import IntegerGMP
File "C:\salt\bin\lib\site-packages\Cryptodome\Math\_IntegerGMP.py", line 95, in <module>
lib = load_lib("gmp", gmp_defs)
File "C:\salt\bin\lib\site-packages\Cryptodome\Util\_raw_api.py", line 103, in load_lib
ffi.cdef(cdecl)
File "C:\salt\bin\lib\site-packages\cffi\api.py", line 112, in cdef
self._cdef(csource, override=override, packed=packed, pack=pack)
File "C:\salt\bin\lib\site-packages\cffi\api.py", line 126, in _cdef
self._parser.parse(csource, override=override, **options)
File "C:\salt\bin\lib\site-packages\cffi\cparser.py", line 347, in parse
self._internal_parse(csource)
File "C:\salt\bin\lib\site-packages\cffi\cparser.py", line 387, in _internal_parse
decl.type, name=decl.name, partial_length_ok=True)
File "C:\salt\bin\lib\site-packages\cffi\cparser.py", line 619, in _get_type_and_quals
tp = self._get_struct_union_enum_type('struct', type, name)
File "C:\salt\bin\lib\site-packages\cffi\cparser.py", line 751, in _get_struct_union_enum_type
self._declare('anonymous %s' % tp.forcename, tp)
File "C:\salt\bin\lib\site-packages\cffi\cparser.py", line 526, in _declare
"try cdef(xx, override=True))" % (name,))
cffi.FFIError: multiple declarations of anonymous MPZ (for interactive usage, try cdef(xx, override=True))


-Ken

Ken Crowell

unread,
Mar 27, 2020, 3:30:01 PM3/27/20
to PyCryptodome
Oh, and I should have noted: pycryptodomex (3.8.1)

Ken Crowell

unread,
Apr 2, 2020, 8:29:13 AM4/2/20
to PyCryptodome
The problem appears to be due to a gmp.dll in the Windows PATH installed by a third-party application (Documentum).  When its path is removed from PATH, the SelfTest completes fine.


On Friday, March 27, 2020 at 4:15:58 PM UTC-3, Ken Crowell wrote:
Reply all
Reply to author
Forward
0 new messages