Skip to content

SIGFPE due to max_background_threads_write_test writing 0, and a possible patch #115

Open
@nc7s

Description

@nc7s

Hi, after investigating our CI failures, I concluded that the write test for max_background_threads wrote libc::size_t::default(), which is 0, thus causing division by zero in jemalloc function background_thread_create_locked():

static bool
background_thread_create_locked(tsd_t *tsd, unsigned arena_ind) {
	assert(have_background_thread);
	malloc_mutex_assert_owner(tsd_tsdn(tsd), &background_thread_lock);

	/* We create at most NCPUs threads. */
	size_t thread_ind = arena_ind % max_background_threads;

I believe 996e5b3 is caused by this; indeed, with the patch below, and its disabling #[cfg] directives for mips64el removed, a thousand runs on our mips64el porter box didn't fail. I also suspect that fd6f565 was due to the same reason, since the ptr2str function doesn't seem to have any division, but I didn't test.

I've patched our package to write 1 instead (see its description for the investigation process), but the style might not be preferable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions