ibm-s390-linux / smc-tools

Tools for use with AF_SMC sockets
Eclipse Public License 1.0
19 stars 14 forks source link

smc_run: bugfix for concurrent socket creation #7

Open GuangguanWang opened 1 year ago

GuangguanWang commented 1 year ago

The initialize process was not protected by lock, causing segmentation fault due to null pointer exception on orig_socket when creating sockets concurrently.

GuangguanWang commented 1 year ago

Hi, @wenjia-wezh, This issue can be reproduced by mysql. The steps to reproduce are as follows start mysql server: smc_run mysqld --user=root --bind-address=0.0.0.0 & clean up data: smc_run sysbench /usr/share/sysbench/oltp_read_only.lua --mysql-host= --mysql-port= --mysql-user=root --mysql-password= --mysql-db=dbtest1a --db-driver=mysql --tables=8 --table-size=1000000 --report-interval=10 --threads=8 --time=120 cleanup prepare data: smc_run sysbench /usr/share/sysbench/oltp_read_only.lua --mysql-host= --mysql-port= --mysql-user=root --mysql-password= --mysql-db=dbtest1a --db-driver=mysql --tables=8 --table-size=1000000 --report-interval=10 --threads=8 --time=120 prepare When running prepare data command, there is a high probability of segment fault, because of null pointer of orig_socket. If you have any comments about this patch, please let me know. Thanks.