[MXS-1529] OOM: mxs_realloc can be repeated this way Created: 2017-11-17  Updated: 2017-11-29  Resolved: 2017-11-29

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.1.10
Fix Version/s: 2.1.12

Type: Bug Priority: Major
Reporter: Wagner Bianchi (Inactive) Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS 7.2


Issue Links:
Blocks
blocks MXS-350 Return value of realloc must not be a... Closed
Sprint: 2017-46

 Description   

As for the message I posted on https://jira.mariadb.org/browse/MXS-350, another way to generate an error like that one (OOM: mxs_realloc) is calling a non-existing configuration file, like below (observe that I have two "~"):

[root@maxscale ~]# maxscale -f ~ ~/maxscale_configs/basic.cnf
* Error: Failed to start all MaxScale services. Exiting.
 
MariaDB MaxScale  /var/log/maxscale/maxscale.log  Thu Nov 16 11:35:42 2017
----------------------------------------------------------------------------
^@^@^@2017-11-16 11:35:42   notice : Working directory: /var/log/maxscale
2017-11-16 11:35:42   notice : MariaDB MaxScale 2.1.10 started
2017-11-16 11:35:42   notice : MaxScale is running in process 4237
2017-11-16 11:35:42   notice : Configuration file: /root
2017-11-16 11:35:42   notice : Log directory: /var/log/maxscale
2017-11-16 11:35:42   notice : Data directory: /var/lib/maxscale
2017-11-16 11:35:42   notice : Module directory: /usr/lib64/maxscale
2017-11-16 11:35:42   notice : Service cache: /var/cache/maxscale
2017-11-16 11:35:42   notice : Loading /root.
2017-11-16 11:38:58   error  : OOM: mxs_realloc
2017-11-16 11:38:58   notice : /root.d does not exist, not reading.
2017-11-16 11:38:58   notice : No query classifier specified, using default 'qc_sqlite'.
2017-11-16 11:38:58   notice : Loaded module qc_sqlite: V1.0.0 from /usr/lib64/maxscale/libqc_sqlite.so
2017-11-16 11:38:58   error  : Failed to start all MaxScale services. Exiting.
2017-11-16 11:38:58   MariaDB MaxScale is shut down.
----------------------------------------------------

Thanks folks.



 Comments   
Comment by Johan Wikman [ 2017-11-29 ]

There were a couple of problems.

If the provided configuration file actually referred to a directory, the code for reading the configuration file ended up in an endless realloc loop that in the end caused an OOM. The other problem was not to reject a configuration file that actually is a directory.

Now, if a directory is provided MaxScale aborts immediately with an error.

Generated at Thu Feb 08 04:07:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.