Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

vcmap__error_handling_oom_0__none test fails #623

Closed
igchor opened this issue Mar 10, 2020 · 3 comments
Closed

vcmap__error_handling_oom_0__none test fails #623

igchor opened this issue Mar 10, 2020 · 3 comments
Labels

Comments

@igchor
Copy link
Contributor

igchor commented Mar 10, 2020

This test is introduced in #617

I have made a reprocuder (with only tbb in version 2019~U8-1) and it looks like this binary fails (with segfault) only when all of following are true:

  • compiled with clang (I tested on clang-9.0.0-2)
  • linked with libunwind (version 1.2.1-9)
  • compiled with -O2

I'm not sure where is the problem yet.

#include <sys/time.h>
#include <sys/resource.h>

#include <iostream>

#include <tbb/concurrent_hash_map.h>

#include <dlfcn.h>
#include <stdio.h>

#define MB (1024 * 1024)
#define HEAP_LIMIT_SIMULATE (100 * MB)

typedef tbb::concurrent_hash_map<std::string, std::string,
			 tbb::tbb_hash_compare<std::string>> map_t;

int main(int argc, char *argv[])
{
	const struct rlimit heap_limit = { HEAP_LIMIT_SIMULATE, HEAP_LIMIT_SIMULATE };
	auto err = setrlimit(RLIMIT_DATA, &heap_limit);
	if (err) {
		fprintf(stderr, "Unable to set heap limit.\n");
		return 1;
	}

	map_t map;

	size_t cnt = 0;
	while (1) {
		try {
			map_t::value_type kv_pair{
					std::to_string(cnt),
					std::string(cnt + 1, 'a')};

			map.insert(kv_pair);
		} catch (std::bad_alloc &) {
			std::cout << "OOM at " << cnt << std::endl;
			return 1;
		}


		cnt++;
	}

	return 0;
}
@igchor igchor added Type: Bug new need to be triaged labels Mar 10, 2020
@szyrom
Copy link

szyrom commented Mar 17, 2020

probably to verify by @vinser52 ?

@karczex
Copy link

karczex commented Oct 14, 2020

I was able to reproduce this issue only with libunwind in version from ubuntu repository (19.10 and 20.04)

Cannot reproduce with libunwind 1.2.1 (or newer) built from source.

@igchor
Copy link
Contributor Author

igchor commented Jan 12, 2021

Closing since not reproducible on newer versions

@igchor igchor closed this as completed Jan 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants