Closed as not planned
Description
Description
The following code:
Sometimes when I run php script using php command,I get a Segmentation fault.
I don't know why.so I need some help!
<?php
require_once "/var/www/html/function.php";
require_once "/var/www/html/send_sms.php";
global $DB;
$path = '/var/www/html//times/';
$fileName = 'sendTimes.json';
$sql = "SELECT DeviceID,Tel,AdminID FROM TSMSCode GROUP BY DeviceID,Tel,AdminID";
$res = $DB->getFetchAll($sql);
if (!file_exists($path . $fileName)) {
cutil_php_debug("File not exist ,Quit!", 'SmsLimitReset');
exit;
}
$sendSMS = AjaxSend_SMS::recordSMSTimes($sendSMS, 1);
if (is_array($res) && count($res) > 0) {
foreach ($res as $index => $smsVal) {
$id = 0;
$SendType = $smsVal['AdminID'] > 0 ? 'admin' : 'user';
if ($SendType === 'admin') {
$id = $smsVal['AdminID'];
} else {
$id = $smsVal['DeviceID'];
}
if (isset($sendSMS[$SendType][$id][$smsVal['Tel']])
&& $sendSMS[$SendType][$id][$smsVal['Tel']]['expired'] < time()
&& $sendSMS[$SendType][$id][$smsVal['Tel']]['usedTimes'] >= AjaxSend_SMS::getSendTimes('times')) {
$sendSMS[$SendType][$id][$smsVal['Tel']] = AjaxSend_SMS::defaultSmsLimit();
// print_r($sendSMS);
AjaxSend_SMS::recordSMSTimes($sendSMS);
cutil_php_debug("Reset Device :" . $smsVal['DeviceID'] . " Tel:" . $smsVal['Tel'], 'SmsLimitReset');
}
}
}
Resulted in this output:

But I expected this output instead:
run success!
there is a core dump file:
[core.php.1498679.11.zip](https://github.com/php/php-src/files/9069261/core.php.1498679.11.zip)
I have tried using gdb command to analyze core dump file,but I still don't know why.
I hope the screenshots below are of some help to you:


### PHP Version
PHP 7.3.24
### Operating System
Centos 6.10