Description:
My stored procedure is called provoke_segfault.sql. Its an endless loop that defines and sets variables. I removed all interaction with databases but the segfault still happens.
1. I log in to the database server using the mysql client.
2. I source the procedure provoke_segfault.sql
3. I run it using CALL provoke_segfault.
It runs until a segfault happens on the client after: 1 day 2 hours 10 min 9.33 sec.
How to repeat:
Do the above mentioned steps. provoke_segfault.sql looks like this:
DELIMITER //
DROP PROCEDURE IF EXISTS Provoke_segfault;
CREATE PROCEDURE Provoke_segfault()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i < 10 do
BEGIN
DECLARE entity_obj_id bigint;
DECLARE customer_number bigint;
DECLARE subscription_id bigint;
DECLARE subscription_id2 bigint;
DECLARE clientsystem_id varchar(10);
DECLARE subscription_type varchar(5);
DECLARE creation_date date;
DECLARE user_chdate date;
DECLARE ctime datetime;
DECLARE subscription_status enum('A','D','F','G','I','O','P','R','X');
DECLARE activation_date date;
DECLARE deactivation_date date;
DECLARE subscription_number varchar(15);
DECLARE payment_method enum('POST','PRE');
DECLARE imsi varchar(10);
DECLARE imsi_valid tinyint;
DECLARE roam tinyint;
DECLARE istt_merge_date date;
DECLARE istt_receive_datetime datetime;
DECLARE istt_creation_date timestamp;
DECLARE istt_replace_date datetime;
DECLARE cusin_msg_id bigint;
-- SET i=i+1;
SET entity_obj_id= 88888;
SET customer_number= 1005521;
SET subscription_id= 10101054;
SET subscription_id2= 10101054;
SET clientsystem_id= 'GSM-AHS';
SET subscription_type= 'DN';
SET creation_date= '2008-09-04';
SET user_chdate= '2008-09-04';
-- SET ctime= '2008-09-04 15:06:06';
SET ctime= concat('2010-05-0', floor(1 + rand()*8), ' 15:06:06');
SET subscription_status= 'D';
SET activation_date= '2008-09-04';
SET deactivation_date= NULL;
-- SET subscription_number= '46730992440';
SET subscription_number= concat('467309', floor(10000 + rand() * 80000)) ;
SET payment_method= 'POST';
SET imsi= concat('2', floor(100000000 + rand() * 800000000));
SET imsi_valid= 0;
SET roam= 0;
SET istt_merge_date= '2010-05-10';
SET istt_receive_datetime= '2010-05-10 09:16:28';
SET istt_creation_date= '2010-05-10 09:16:28';
SET istt_replace_date= '2010-05-10 09:16:30';
SET cusin_msg_id= 31123;
select sleep(1);
END;
END while;
END //
DELIMITER ;