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

Barely reproducible malloc_consolidate() failure. #2192

Open
ni4 opened this issue Feb 15, 2024 · 0 comments
Open

Barely reproducible malloc_consolidate() failure. #2192

ni4 opened this issue Feb 15, 2024 · 0 comments

Comments

@ni4
Copy link
Contributor

ni4 commented Feb 15, 2024

Description

The following test case causes malloc_consolidate(): unaligned fastbin chunk detected in a single runner (Fedora 36 + Botan 3.1.1), which is not reproducible with enabled santizers or on local Docker container.
Additionally, from comment on this issue https://stackoverflow.com/questions/3100193/segfaults-in-malloc-and-malloc-consolidate :

Interestingly my code was crashing on malloc_consolidate somewhere deep within the google test library... setting MALLOC_CHECK_ to any value 0, 1, or 2 seems to prevent the crash but no matter what setting I use it doesn't print any additional diagnostic information so I still have no clue what was causing the error.

TEST_F(rnp_tests, test_ffi_wrong_hex_length)
{
    rnp_ffi_t ffi = NULL;

    // setup FFI
    assert_rnp_success(rnp_ffi_create(&ffi, "GPG", "GPG"));
    // load our keyrings
    assert_true(load_keys_gpg(ffi, "data/keyrings/1/pubring.gpg"));

    // edge cases
    {
        rnp_key_handle_t key = NULL;
        assert_rnp_failure(rnp_locate_key(ffi, "keyid", "BC6709B15C23A4A", &key));
        assert_rnp_failure(rnp_locate_key(ffi, "keyid", "C6709B15C23A4A", &key));
    }

    rnp_ffi_destroy(ffi);
}
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

1 participant