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

[MacOS/X, p11-kit 0.23.14] test_max_session_load fails when running "make check" #198

Open
young-git2046 opened this issue Oct 21, 2018 · 1 comment

Comments

@young-git2046
Copy link

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

@ueno
Copy link
Member

ueno commented Oct 22, 2018

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.

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

No branches or pull requests

2 participants