Bug #64994 | use of my_load_defaults() gives segmentation fault in my_stat() | ||
---|---|---|---|
Submitted: | 16 Apr 2012 13:44 | Modified: | 18 Apr 2012 8:52 |
Reporter: | Erik Remmelzwaal | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S3 (Non-critical) |
Version: | 5.5.21, 5.5.24 | OS: | Linux (2.6.16.60 64-bit) |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
Tags: | my_load_defaults segmentation fault, regression |
[16 Apr 2012 13:44]
Erik Remmelzwaal
[17 Apr 2012 18:01]
Sveta Smirnova
Thank you for the report. Verified as described. Not repeatable with version 5.1
[17 Apr 2012 18:03]
Sveta Smirnova
gdb output in my environment: (gdb) run Starting program: /home/sveta/src/bugs/bug64994 [Thread debugging using libthread_db enabled] Arguments 1: 0: this safe_mutex: Trying to lock unitialized mutex at /home/sveta/src/mysql-5.5/mysys/my_fopen.c, line 70 Program received signal SIGABRT, Aborted. 0x00000031d7432a45 in raise () from /lib64/libc.so.6 Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.25.el6.x86_64 zlib-1.2.3-25.el6.x86_64 (gdb) bt #0 0x00000031d7432a45 in raise () from /lib64/libc.so.6 #1 0x00000031d7434225 in abort () from /lib64/libc.so.6 #2 0x00007ffff7afc0e7 in safe_mutex_lock (mp=0x7ffff7ffcbe0, try_lock=0 '\000', file=0x7ffff7b632d0 "/home/sveta/src/mysql-5.5/mysys/my_fopen.c", line=70) at /home/sveta/src/mysql-5.5/mysys/thr_mutex.c:106 #3 0x00007ffff7af3ffc in inline_mysql_mutex_lock (that=0x7ffff7ffcbe0, src_file=0x7ffff7b632d0 "/home/sveta/src/mysql-5.5/mysys/my_fopen.c", src_line=70) at /home/sveta/src/mysql-5.5/include/mysql/psi/mysql_thread.h:615 #4 0x00007ffff7af41ee in my_fopen (filename=0x7fffffffdaa0 "/etc/my.cnf", flags=0, MyFlags=0) at /home/sveta/src/mysql-5.5/mysys/my_fopen.c:70 #5 0x00007ffff7aee1c8 in inline_mysql_file_fopen (key=0, src_file=0x7ffff7b61f38 "/home/sveta/src/mysql-5.5/mysys/default.c", src_line=803, filename=0x7fffffffdaa0 "/etc/my.cnf", flags=0, myFlags=0) at /home/sveta/src/mysql-5.5/include/mysql/psi/mysql_file.h:810 #6 0x00007ffff7aef850 in search_default_file_with_ext (opt_handler=0x7ffff7aeeb37 <handle_default_option>, handler_ctx=0x7fffffffded0, dir=0x601058 "/etc/", ext=0x7ffff7b61f7f ".cnf", config_file=0x400854 "my", recursion_level=0) at /home/sveta/src/mysql-5.5/mysys/default.c:803 #7 0x00007ffff7aef53e in search_default_file (opt_handler=0x7ffff7aeeb37 <handle_default_option>, handler_ctx=0x7fffffffded0, dir=0x601058 "/etc/", config_file=0x400854 "my") at /home/sveta/src/mysql-5.5/mysys/default.c:670 #8 0x00007ffff7aeea2e in my_search_option_files (conf_file=0x400854 "my", argc=0x7fffffffe04c, argv=0x7fffffffdfd8, args_used=0x7fffffffdf2c, func=0x7ffff7aeeb37 <handle_default_option>, func_ctx=0x7fffffffded0, default_directories=0x601020) at /home/sveta/src/mysql-5.5/mysys/default.c:321 #9 0x00007ffff7aef0c0 in my_load_defaults (conf_file=0x400854 "my", groups=0x7fffffffe038, argc=0x7fffffffe04c, argv=0x7fffffffdfd8, default_directories=0x0) at /home/sveta/src/mysql-5.5/mysys/default.c:576 #10 0x00000000004006d0 in main (argc=1, argv=0x7fffffffe138) at bug64994.c:17
[18 Apr 2012 5:39]
Davi Arnaut
Please read the documentation of my_init().
[18 Apr 2012 7:09]
Erik Remmelzwaal
Thanks for pointing to my_init(). Adding my_init() or mysql_init() before calling my_load_default() gives correct behavior. Call can be closed.
[18 Apr 2012 8:52]
Jon Olav Hauglid
Closing. Thanks Davi!