summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-11-30 12:14:00 +0700
committerEugene Kosov <claprix@yandex.ru>2019-11-30 12:14:00 +0700
commit6fe2aae3ce8139864dfe45f2f9834f82ef54ff1e (patch)
treeb49d8812d324a5b4b545b38f60d8725c69255a54
parent2855edf9ee0344e596ff4b9ee70a23421ae60405 (diff)
downloadmariadb-git-6fe2aae3ce8139864dfe45f2f9834f82ef54ff1e.tar.gz
InnoDB: log unsuccessful calls to pthread_attr_init() and pthread_create() before crash
-rw-r--r--storage/innobase/os/os0thread.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc
index 792d9cc4e10..ed3f1a13f42 100644
--- a/storage/innobase/os/os0thread.cc
+++ b/storage/innobase/os/os0thread.cc
@@ -143,7 +143,13 @@ os_thread_create_func(
pthread_attr_t attr;
#ifndef UNIV_HPUX10
- pthread_attr_init(&attr);
+ ret = pthread_attr_init(&attr);
+ if (UNIV_UNLIKELY(ret)) {
+ fprintf(stderr,
+ "InnoDB: Error: pthread_attr_init() returned %d\n",
+ ret);
+ exit(1);
+ }
#endif
#ifdef UNIV_AIX
@@ -171,7 +177,11 @@ os_thread_create_func(
#else
ret = pthread_create(&pthread, &attr, func, arg);
#endif
- ut_a(ret == 0);
+ if (UNIV_UNLIKELY(ret)) {
+ fprintf(stderr,
+ "InnoDB: Error: pthread_create() returned %d\n", ret);
+ exit(1);
+ }
#ifndef UNIV_HPUX10
pthread_attr_destroy(&attr);