Skip to content
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

sys_eval crash mysql and sys_exec do nothing #10

Open
hamshiva opened this issue Jan 8, 2016 · 2 comments
Open

sys_eval crash mysql and sys_exec do nothing #10

hamshiva opened this issue Jan 8, 2016 · 2 comments

Comments

@hamshiva
Copy link

hamshiva commented Jan 8, 2016

Hi,

I try to use this plugin on a 5.5.42-MariaDB, Thus I compiled (gcc -DMYSQL_DYNAMIC_PLUGIN -fPIC -Wall -I/usr/include/mysql -shared lib_mysqludf_sys.c -o /usr/lib/mysql/plugin/lib_mysqludf_sys.so) the .so and placed it in the right folder then created the function like this:

CREATE FUNCTION sys_exec RETURNS int SONAME 'lib_mysqludf_sys.so';
CREATE FUNCTION sys_eval RETURNS string SONAME 'lib_mysqludf_sys.so';

No errors, but:
MariaDB [(none)]> select sys_exec('pwd');
+-----------------+
| sys_exec('pwd') |
+-----------------+
| -1 |
+-----------------+
1 row in set (0.01 sec)

and

MariaDB [(none)]> SELECT sys_eval('id');
ERROR 2013 (HY000): Lost connection to MySQL server during query

With this in the syslog right after the sys_eval:
mysqld: 160108 14:43:29 [ERROR] mysqld got signal 11 ;
mysqld: This could be because you hit a bug. It is also possible that this binary
mysqld: or one of the libraries it was linked against is corrupt, improperly built,
mysqld: or misconfigured. This error can also be caused by malfunctioning hardware.

Any idea ?

@csonuryilmaz
Copy link

I have the same issue with MySql 5.6. Here is the error log section for the problem:
`01:36:06 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=14
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68245 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x174590a0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fc0ead2ae18 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x911b05]
/usr/sbin/mysqld(handle_fatal_signal+0x494)[0x69a1c4]
/lib64/libpthread.so.0[0x34ebc0f710]
/lib64/libc.so.6(fgets+0x2d)[0x34eb866cad]
/usr/lib64/mysql/plugin/lib_mysqludf_sys.so(sys_eval+0xec)[0x7fc0eb28a09f]
/usr/sbin/mysqld(ZN11udf_handler7val_strEP6StringS1+0x6e)[0x63415e]
/usr/sbin/mysqld(_ZN17Item_func_udf_str7val_strEP6String+0x1c)[0x63421c]
/usr/sbin/mysqld(_ZN22Item_func_set_user_var5checkEb+0x192)[0x631922]
/usr/sbin/mysqld(_ZN12set_var_user5checkEP3THD+0x3b)[0x69884b]
/usr/sbin/mysqld(_Z17sql_set_variablesP3THDP4ListI12set_var_baseE+0x2d)[0x69897d]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x2390)[0x7184a0]
/usr/sbin/mysqld(_ZN13sp_instr_stmt9exec_coreEP3THDPj+0xa2)[0x84ad92]
/usr/sbin/mysqld(_ZN12sp_lex_instr23reset_lex_and_exec_coreEP3THDPjb+0x228)[0x84b0d8]
/usr/sbin/mysqld(_ZN12sp_lex_instr29validate_lex_and_execute_coreEP3THDPjb+0x8f)[0x84cf8f]
/usr/sbin/mysqld(_ZN13sp_instr_stmt7executeEP3THDPj+0x1b0)[0x84d670]
/usr/sbin/mysqld(_ZN7sp_head7executeEP3THDb+0x782)[0x6a0ba2]
/usr/sbin/mysqld(_ZN7sp_head17execute_procedureEP3THDP4ListI4ItemE+0x6d7)[0x6a2097]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x11ba)[0x7172ca]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x3b8)[0x71b208]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x14ba)[0x71c77a]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0xcf)[0x6e8f0f]
/usr/sbin/mysqld(handle_one_connection+0x47)[0x6e9037]
/usr/sbin/mysqld(pfs_spawn_thread+0x12a)[0xb36fba]
/lib64/libpthread.so.0[0x34ebc079d1]
/lib64/libc.so.6(clone+0x6d)[0x34eb8e88fd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fc070047480): is an invalid pointer
Connection ID (thread ID): 228059
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.`

@alfadon
Copy link

alfadon commented Mar 17, 2020

I have the same issue with MySql 5.7 on Centos 7. Does no one know the answer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants