Skip to content

Commit 6fe2aae

Browse files
committed
InnoDB: log unsuccessful calls to pthread_attr_init() and pthread_create() before crash
1 parent 2855edf commit 6fe2aae

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

storage/innobase/os/os0thread.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,13 @@ os_thread_create_func(
143143
pthread_attr_t attr;
144144

145145
#ifndef UNIV_HPUX10
146-
pthread_attr_init(&attr);
146+
ret = pthread_attr_init(&attr);
147+
if (UNIV_UNLIKELY(ret)) {
148+
fprintf(stderr,
149+
"InnoDB: Error: pthread_attr_init() returned %d\n",
150+
ret);
151+
exit(1);
152+
}
147153
#endif
148154

149155
#ifdef UNIV_AIX
@@ -171,7 +177,11 @@ os_thread_create_func(
171177
#else
172178
ret = pthread_create(&pthread, &attr, func, arg);
173179
#endif
174-
ut_a(ret == 0);
180+
if (UNIV_UNLIKELY(ret)) {
181+
fprintf(stderr,
182+
"InnoDB: Error: pthread_create() returned %d\n", ret);
183+
exit(1);
184+
}
175185

176186
#ifndef UNIV_HPUX10
177187
pthread_attr_destroy(&attr);

0 commit comments

Comments
 (0)