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

Crash in test suite x509write config full no seedfile #6100

Closed
mpg opened this issue Jul 19, 2022 · 2 comments · Fixed by #6109
Closed

Crash in test suite x509write config full no seedfile #6100

mpg opened this issue Jul 19, 2022 · 2 comments · Fixed by #6109
Assignees
Labels
bug size-s Estimated task size: small (~2d)

Comments

@mpg
Copy link
Contributor

mpg commented Jul 19, 2022

Steps to reproduce:

find . -name seedfile -exec rm {} +
scripts/config.py config full
(cd tests && make test_suite_x509write && ./test_suite_x509write)

Observed behaviour: the first few tests fail, then eventually there's a bus error and a core dump is produced. If we just add the seedfile again (dd if=/dev/urandom of=./tests/seedfile bs=64 count=1) everything passes and there is no crash.

Expected behaviour: it is known limitation of our test system that we have to generate a seedfile before running the tests. However, the absence of a seedfile should only result in tests failing, not in the whole process crashing. This might be the sign of a deeper issue.

With ASan and debug info (see CMake build type ASanDbg):

Certificate Request check Server1 SHA1 ............................ AddressSanitizer:DEADLYSIGNAL
=================================================================
==755975==ERROR: AddressSanitizer: SEGV on unknown address 0x000000010030 (pc 0x0000004eba8d bp 0x7fffe048cfb0 sp 0x7fffe048cf90 T0)
==755975==The signal is caused by a READ memory access.
    #0 0x4eba8d in mbedtls_asn1_free_named_data_list /home/manpeg01/src/mbedtls/library/asn1parse.c
    #1 0x4e847b in mbedtls_x509write_csr_free /home/manpeg01/src/mbedtls/library/x509write_csr.c:62:5
    #2 0x4c3536 in test_x509_csr_check /home/manpeg01/src/mbedtls/tests/suites/test_suite_x509write.function:161:5
    #3 0x4c3d87 in test_x509_csr_check_wrapper /home/manpeg01/src/mbedtls/tests/suites/test_suite_x509write.function:169:5
    #4 0x4c6c3f in dispatch_test /home/manpeg01/src/mbedtls/tests/suites/main_test.function:174:17
    #5 0x4c8053 in execute_tests /home/manpeg01/src/mbedtls/tests/suites/host_test.function:711:31
    #6 0x4ca31d in main /home/manpeg01/src/mbedtls/tests/suites/main_test.function:257:11
    #7 0x7f60d903a082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
    #8 0x41b40d in _start (/home/manpeg01/src/mbedtls/tests/test_suite_x509write+0x41b40d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/manpeg01/src/mbedtls/library/asn1parse.c in mbedtls_asn1_free_named_data_list
@mpg mpg added bug size-s Estimated task size: small (~2d) labels Jul 19, 2022
@mpg
Copy link
Contributor Author

mpg commented Jul 19, 2022

Note: I noticed this while working on driver-only builds, so I'm adding this to the corresponding EPIC - let's fix this before any work on driver-only X.509 write so that it doesn't become a distraction in the middle of other work.

@superna9999 superna9999 self-assigned this Jul 20, 2022
@superna9999
Copy link
Contributor

mbedtls_x509write_csr_free crashes on an unitialized mbedtls_x509write_csr in x509_csr_check_opaque() no idea why it doesn't in x509_csr_check()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants