[MXS-270] Crash with MySQLBackend protocol module Created: 2015-07-15  Updated: 2015-09-17  Resolved: 2015-08-19

Status: Closed
Project: MariaDB MaxScale
Component/s: mariadbbackend, readwritesplit
Affects Version/s: 1.1.1
Fix Version/s: 1.2.1

Type: Bug Priority: Blocker
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS 7


Attachments: File test.cc    
Issue Links:
Duplicate
is duplicated by MXS-314 Read Write Split Error with Galera Nodes Closed

 Description   

MaxScale crashes with the following configuration soon after startup.

[Galera Service]
type=service
router=readwritesplit
servers=server1,server2,server3
max_slave_connections=90%
user=maxuser
passwd=
enable_root_user=0

Stack trace from the crash.

2015-07-07 07:57:00   Fatal: MaxScale received fatal signal 11. Attempting backtrace.
2015-07-07 07:57:00     /usr/local/mariadb-maxscale/bin/maxscale() [0x542a98]
2015-07-07 07:57:00     /lib64/libpthread.so.0(+0xf130) [0x7f105782f130]
2015-07-07 07:57:00     /usr/local/mariadb-maxscale/modules/libMySQLBackend.so(+0x514b) [0x7f1038a1614b]
2015-07-07 07:57:00     /usr/local/mariadb-maxscale/modules/libMySQLBackend.so(+0x318f) [0x7f1038a1418f]
2015-07-07 07:57:00     /usr/local/mariadb-maxscale/bin/maxscale() [0x554a92]
2015-07-07 07:57:00     /usr/local/mariadb-maxscale/bin/maxscale(poll_waitevents+0x616) [0x55435b]
2015-07-07 07:57:00     /usr/local/mariadb-maxscale/bin/maxscale(main+0x1a10) [0x545563]
2015-07-07 07:57:00     /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f1056021af5]
2015-07-07 07:57:00     /usr/local/mariadb-maxscale/bin/maxscale() [0x5418dd]



 Comments   
Comment by markus makela [ 2015-07-15 ]

I was not able to reproduce this crash in the same environment.

Comment by Dipti Joshi (Inactive) [ 2015-08-16 ]

markus makela Can you please locate the line number where the crash occurred based on stack trace (libMySQLBackend.so(+0x514b) [0x7f1038a1614b])?

Comment by markus makela [ 2015-08-16 ]

It seem the crash happened on line 1608 in mysql_backend.c if the stack trace is correct. This is a place where a NULL pointer could possibly cause a segmentation fault if the network has sent a packet with an odd length. I still haven't been able to reproduce this error but I've added checks for possible NULL values in the mysql_backend.c.

Comment by Dipti Joshi (Inactive) [ 2015-08-16 ]

markus makela line 1608 in which branch ?

Comment by markus makela [ 2015-08-17 ]

On the 1.1.1 tag on git.

Comment by markus makela [ 2015-08-19 ]

Added a test which can reproduce the error. The test assumes MaxScale is listening on the same host to port 4006 and uses readwritesplit.

Compile with c++ -g -lmysqlclient test.cc

Comment by markus makela [ 2015-08-19 ]

Fixed by storing the partial response in the DCB read queue.

Generated at Thu Feb 08 03:58:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.