Model Save causes Segmentation Fault

After saving a model from inside a command I am given the beautiful Segmentation Fault error. I am not sure what is causing this so any help would be greatly appreciated. According to php -i Zend OPCache is turned Off and I do not have XCache. I have provided a stack trace from gdb below.

I have the following in my command:-

print_r("Updating active state on contract... \n");
$this->contract->active = $this->status;
print_r("Saving contract state... \n");
$this->contract->save();
print_r("Saved contract state... \n");

And the following is output to the console:-

Updating active state on contract...
Saving contract state...
Segmentation fault

Stacktrace:-

#0  0x00007feca2520ae0 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#1  0x000055a03022e88d in ?? ()
#2  0x000055a0301e9d9b in execute_ex ()
#3  0x000055a030199861 in dtrace_execute_ex ()
#4  0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#5  0x000055a03019b4c9 in zend_call_function ()
#6  0x000055a0301c7702 in zend_call_method ()
#7  0x000055a0301e1a23 in zend_std_read_dimension ()
#8  0x000055a0301eae66 in ?? ()
#9  0x000055a0301eb887 in ?? ()
#10 0x000055a0301e9d9b in execute_ex ()
#11 0x000055a030199861 in dtrace_execute_ex ()
#12 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#13 0x000055a03022e88d in ?? ()
#14 0x000055a0301e9d9b in execute_ex ()
#15 0x000055a030199861 in dtrace_execute_ex ()
#16 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#17 0x000055a03022e88d in ?? ()
#18 0x000055a0301e9d9b in execute_ex ()
#19 0x000055a030199861 in dtrace_execute_ex ()
#20 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#21 0x000055a03022e88d in ?? ()
#22 0x000055a0301e9d9b in execute_ex ()
#23 0x000055a030199861 in dtrace_execute_ex ()
#24 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#25 0x000055a03022e88d in ?? ()
#26 0x000055a0301e9d9b in execute_ex ()
#27 0x000055a030199861 in dtrace_execute_ex ()
#28 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#29 0x000055a03022e88d in ?? ()
#30 0x000055a0301e9d9b in execute_ex ()
#31 0x000055a030199861 in dtrace_execute_ex ()
#32 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#33 0x000055a03022e88d in ?? ()
#34 0x000055a0301e9d9b in execute_ex ()
#35 0x000055a030199861 in dtrace_execute_ex ()
#36 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#37 0x000055a03022e88d in ?? ()
#38 0x000055a0301e9d9b in execute_ex ()
#39 0x000055a030199861 in dtrace_execute_ex ()
#40 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
#41 0x000055a03022e88d in ?? ()
#42 0x000055a0301e9d9b in execute_ex ()
#43 0x000055a030199861 in dtrace_execute_ex ()
#44 0x00007feca2520ae6 in bf_zend_execute () from /usr/lib/php/20151012/blackfire.so
Welfordian
Welfordian
  • 1 week ago

Just to follow up on this, the problem itself isn't actually coming from $this->contract->save(); as when this alone is used the command runs fine, but when used together with $this->contract->active = 1; this is when the Segmentation Fault occurs.

I have changed my implementation to DB::table()->where()->update() anyway and this now works but if anybody has any ideas around the problem please follow up here.