You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: 2 problems in test-managed.c when running "make check".
When running:
make check
the test "test_max_session_load" fails, first, because it attempts to
register 10 + P11_VIRTUAL_MAX_FIXED modules, while fixed_closures[] contains
only P11_VIRTUAL_MAX_FIXED cells (see in p11-kit/virtual.c) and trying to
store more than this limit will lead to a NULL result rejected by the function
p11_virtual_wrap_fixed (see p11-kit/virtual.c).
In the process of investigation this issue, I also found that a call
to p11_module_release_inlock_reentrant() seems missing in the function
test_initialize_fail() in test-managed.c. At the end of test_initialize_fail()
a cleanup is necessary to ensure that the cells in the array fixed_closures
(see p11-kit/virtual.c) are freed before the next test is run.
The attached patch addresses the missing cleanup function and shows that,
assuming one does not try to register more than P11_VIRTUAL_MAX_FIXED modules,
the test passes.
Local config:
uname -a
[...] Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64 x86_64
Thank you for the report; however, it is on purpose that the test checks against 10 + P11_VIRTUAL_MAX_FIXED. Maybe, the test should be skipped if p11-kit is not compiled with libffi, because, in that case exhaustion of fixed closures would be fatal.
Summary: 2 problems in test-managed.c when running "make check".
When running:
make check
the test "test_max_session_load" fails, first, because it attempts to
register 10 + P11_VIRTUAL_MAX_FIXED modules, while fixed_closures[] contains
only P11_VIRTUAL_MAX_FIXED cells (see in p11-kit/virtual.c) and trying to
store more than this limit will lead to a NULL result rejected by the function
p11_virtual_wrap_fixed (see p11-kit/virtual.c).
In the process of investigation this issue, I also found that a call
to p11_module_release_inlock_reentrant() seems missing in the function
test_initialize_fail() in test-managed.c. At the end of test_initialize_fail()
a cleanup is necessary to ensure that the cells in the array fixed_closures
(see p11-kit/virtual.c) are freed before the next test is run.
The attached patch addresses the missing cleanup function and shows that,
assuming one does not try to register more than P11_VIRTUAL_MAX_FIXED modules,
the test passes.
Local config:
uname -a
[...] Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64 x86_64
call to configure:
./configure --without-libffi --without-libtasn1 --without-gtk-doc --without-xlstproc --without-freebl3 --enable-doc=no --with-system-config=/usr/local/etc -enable-debug
No problem encountered while running configure, nor while compiling
through make.
test-managed.diff.txt
The text was updated successfully, but these errors were encountered: