@@ -144,7 +144,6 @@ extern "C" sig_handler handle_fatal_signal(int sig)
144
144
We will try and print the query at the end of the signal handler, in case
145
145
we're wrong.
146
146
*/
147
- bool print_invalid_query_pointer= false ;
148
147
#endif
149
148
150
149
if (segfaulted)
@@ -173,57 +172,19 @@ extern "C" sig_handler handle_fatal_signal(int sig)
173
172
goto end;
174
173
}
175
174
176
- my_safe_printf_stderr (" [ERROR] mysqld got " SIGNAL_FMT " ;\n " ,sig);
175
+ my_safe_printf_stderr (" [ERROR] %s got " SIGNAL_FMT " ;\n " , my_progname, sig);
177
176
178
177
my_safe_printf_stderr (" %s" ,
179
178
" Sorry, we probably made a mistake, and this is a bug.\n\n "
180
179
" Your assistance in bug reporting will enable us to fix this for the next release.\n "
181
- " To report this bug, see https://mariadb.com/kb/en/reporting-bugs\n\n " );
182
-
183
- my_safe_printf_stderr (" %s" ,
184
- " We will try our best to scrape up some info that will hopefully help\n "
185
- " diagnose the problem, but since we have already crashed, \n "
186
- " something is definitely wrong and this may fail.\n\n " );
180
+ " To report this bug, see https://mariadb.com/kb/en/reporting-bugs about how to report\n "
181
+ " a bug on https://jira.mariadb.org/.\n\n "
182
+ " Please include the information from the server start above, to the end of the\n "
183
+ " information below.\n\n " );
187
184
188
185
set_server_version (server_version, sizeof (server_version));
189
- my_safe_printf_stderr (" Server version: %s source revision: %s\n " ,
190
- server_version, SOURCE_REVISION);
191
-
192
- if (dflt_key_cache)
193
- my_safe_printf_stderr (" key_buffer_size=%zu\n " ,
194
- dflt_key_cache->key_cache_mem_size );
195
-
196
- my_safe_printf_stderr (" read_buffer_size=%lu\n " ,
197
- global_system_variables.read_buff_size );
198
-
199
- my_safe_printf_stderr (" max_used_connections=%lu\n " ,
200
- max_used_connections);
201
-
202
- if (thread_scheduler)
203
- my_safe_printf_stderr (" max_threads=%lu\n " ,
204
- thread_scheduler->max_threads +
205
- extra_max_connections);
206
-
207
- my_safe_printf_stderr (" thread_count=%u\n " , THD_count::value ());
208
-
209
- if (dflt_key_cache && thread_scheduler)
210
- {
211
- size_t used_mem=
212
- (dflt_key_cache->key_cache_mem_size +
213
- (global_system_variables.read_buff_size +
214
- (size_t ) global_system_variables.sortbuff_size ) *
215
- (thread_scheduler->max_threads + extra_max_connections) +
216
- (max_connections + extra_max_connections) * sizeof (THD)) / 1024 ;
217
-
218
- my_safe_printf_stderr (" It is possible that mysqld could use up to \n "
219
- " key_buffer_size + "
220
- " (read_buffer_size + sort_buffer_size)*max_threads = "
221
- " %zu K bytes of memory\n " , used_mem);
222
-
223
- my_safe_printf_stderr (" %s" ,
224
- " Hope that's ok; if not, decrease some variables in "
225
- " the equation.\n\n " );
226
- }
186
+ my_safe_printf_stderr (" Server version: %s source revision: %s\n\n " ,
187
+ server_version, SOURCE_REVISION);
227
188
228
189
#ifdef WITH_WSREP
229
190
Wsrep_server_state::handle_fatal_signal ();
@@ -234,12 +195,14 @@ extern "C" sig_handler handle_fatal_signal(int sig)
234
195
235
196
if (opt_stack_trace)
236
197
{
237
- my_safe_printf_stderr (" Thread pointer: %p\n " , thd);
238
198
my_safe_printf_stderr (" %s" ,
239
- " Attempting backtrace. You can use the following "
240
- " information to find out\n "
241
- " where mysqld died. If you see no messages after this, something went\n "
242
- " terribly wrong...\n " );
199
+ " The information page at "
200
+ " https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/\n "
201
+ " contains instructions to obtain a better version of the backtrace below.\n "
202
+ " Following these instructions will help MariaDB developers provide a fix quicker.\n\n "
203
+ " Attempting backtrace. Include this in the bug report.\n "
204
+ " (note: Retrieving this information may fail)\n\n " );
205
+ my_safe_printf_stderr (" Thread pointer: %p\n " , thd);
243
206
my_print_stacktrace (thd ? (uchar*) thd->thread_stack : NULL ,
244
207
(ulong)my_thread_stack_size, 0 );
245
208
}
@@ -287,20 +250,12 @@ extern "C" sig_handler handle_fatal_signal(int sig)
287
250
kreason= " KILL_WAIT_TIMEOUT" ;
288
251
break ;
289
252
}
290
- my_safe_printf_stderr (" %s" , " \n "
291
- " Trying to get some variables.\n "
292
- " Some pointers may be invalid and cause the dump to abort.\n " );
293
-
294
- my_safe_printf_stderr (" Query (%p): " , thd->query ());
295
- if (my_safe_print_str (thd->query (), MY_MIN (65536U , thd->query_length ())))
296
- {
297
- // Query was found invalid. We will try to print it at the end.
298
- print_invalid_query_pointer= true ;
299
- }
300
253
301
254
my_safe_printf_stderr (" \n Connection ID (thread ID): %lu\n " ,
302
255
(ulong) thd->thread_id );
303
- my_safe_printf_stderr (" Status: %s\n\n " , kreason);
256
+ my_safe_printf_stderr (" Status: %s\n " , kreason);
257
+ my_safe_printf_stderr (" Query (%p): " , thd->query ());
258
+ my_safe_print_str (thd->query (), MY_MIN (65536U , thd->query_length ()));
304
259
my_safe_printf_stderr (" %s" , " Optimizer switch: " );
305
260
ulonglong optsw= thd->variables .optimizer_switch ;
306
261
for (uint i= 0 ; optimizer_switch_names[i+1 ]; i++, optsw >>= 1 )
@@ -312,52 +267,9 @@ extern "C" sig_handler handle_fatal_signal(int sig)
312
267
}
313
268
my_safe_printf_stderr (" %s" , " \n\n " );
314
269
}
315
- my_safe_printf_stderr (" %s" ,
316
- " The manual page at "
317
- " https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/ contains\n "
318
- " information that should help you find out what is causing the crash.\n " );
319
270
320
271
#endif /* HAVE_STACKTRACE */
321
272
322
- #ifdef HAVE_INITGROUPS
323
- if (calling_initgroups)
324
- {
325
- my_safe_printf_stderr (" %s" , " \n "
326
- " This crash occurred while the server was calling initgroups(). This is\n "
327
- " often due to the use of a mysqld that is statically linked against \n "
328
- " glibc and configured to use LDAP in /etc/nsswitch.conf.\n "
329
- " You will need to either upgrade to a version of glibc that does not\n "
330
- " have this problem (2.3.4 or later when used with nscd),\n "
331
- " disable LDAP in your nsswitch.conf, or use a "
332
- " mysqld that is not statically linked.\n " );
333
- }
334
- #endif
335
-
336
- if (locked_in_memory)
337
- {
338
- my_safe_printf_stderr (" %s" , " \n "
339
- " The \" --memlock\" argument, which was enabled, "
340
- " uses system calls that are\n "
341
- " unreliable and unstable on some operating systems and "
342
- " operating-system versions (notably, some versions of Linux).\n "
343
- " This crash could be due to use of those buggy OS calls.\n "
344
- " You should consider whether you really need the "
345
- " \" --memlock\" parameter and/or consult the OS distributer about "
346
- " \" mlockall\" bugs.\n " );
347
- }
348
-
349
- #ifdef HAVE_STACKTRACE
350
- if (print_invalid_query_pointer)
351
- {
352
- my_safe_printf_stderr (
353
- " \n We think the query pointer is invalid, but we will try "
354
- " to print it anyway. \n "
355
- " Query: " );
356
- my_write_stderr (thd->query (), MY_MIN (65536U , thd->query_length ()));
357
- my_safe_printf_stderr (" \n\n " );
358
- }
359
- #endif
360
-
361
273
output_core_info ();
362
274
#ifdef HAVE_WRITE_CORE
363
275
if (test_flags & TEST_CORE_ON_SIGNAL)
0 commit comments