-
Notifications
You must be signed in to change notification settings - Fork 1k
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
test_malloc_shutdown_hang (Debug build): Assertion isMallocInitialized() failed #558
Comments
For some reason |
On Windows 7 SP1 - each time. |
It seems your environment is the cornucopia of mysterious issues :). Can you please help to investigate the issue? Is the issue reproduced when child processes are not created? Can you replace child process spawn with direct call of -void processSpawn(const char* self) {
- _spawnl(_P_WAIT, self, self, "1", NULL);
-}
+int main(int argc, char* argv[]);
+void processSpawn(const char* ) {
+ //_spawnl(_P_WAIT, self, self, "1", NULL);
+ char* args[2] = { "", "1" };
+ main(2, args);
+} |
Windows 7 Professional SP1 installed from scratch + Visual Studio 2019 (with all C++ components) + CMake. After replace to direct call:
"Assertion failed" is present. |
Replace to void processSpawn(const char* /*self*/) {
REPORT("Known issue: no support for process spawn on this platform.\n");
REPORT("done\n");
exit(0);
} also raises an error:
|
Can you try the following steps:
|
Replace (https://github.com/oneapi-src/oneTBB/blob/master/src/tbbmalloc/frontend.cpp#L1947) static std::atomic<intptr_t> mallocInitialized{0}; // implicitly initialized to 0 to static std::atomic<intptr_t> mallocInitialized; fix this error. But this change is not valid C++ (https://en.cppreference.com/w/cpp/atomic/atomic/atomic)... |
I would not say that it is not valid C++. Perhaps, it as a grey area but consider the following statements in the C++11 standard
So, if the atomic with static storage duration is default constructed, it should be zero-initialized. I.e. [26.9.5:4] guarantees that zero initialization will not be overwritten with default constructor (while the constructor with Thank you for catching one more issue. |
But since C++20 See: |
Strictly speaking, it is default constructor because it "can be called with no arguments" ((cppreference)[https://en.cppreference.com/w/cpp/language/default_constructor]). I believe you mean that it does not perform (default initialization)[https://en.cppreference.com/w/cpp/language/default_initialization] of underlying type. It is Ok in that case because we rely on static zero-initialization. |
I misunderstood the statement "[26.9.5: 4] guarantees that zero initialization will not be overwritten with default constructor" |
@alexey-katranov , I believe enabliblig C++20 should not break 'tbbmalloc' ? |
As far as I remember, C++20 brings interesting topic of atomic objects initialization and access in data sections (static storage duration). It seems it is not safe to use global atomics and it is better to consider |
Signed-off-by: Vladislav Shchapov <phprus@gmail.com>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Commit: 86fe3f0
MSVC: 19.21 32 bit
Windows 7 SP1.
CMake command:
Error:
Call Stack:
Dump and PDB files in attach:
test_malloc_shutdown_hang.zip
The text was updated successfully, but these errors were encountered: