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

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

Open
nc7s opened this issue Jan 21, 2025 · 0 comments

Comments

@nc7s
Copy link

nc7s commented Jan 21, 2025

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.

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