Segmentation fault with ruby 2.4.4
obromios opened this issue · 0 comments
obromios commented
I am frequently seeing a segmentation fault during iteration of the nelder-mead algorithm:
app/services/g_amoeba.rb:47: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin17]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0063 p:---- s:0325 e:000324 CFUNC :iterate
c:0062 p:0009 s:0321 e:000320 BLOCK
I have attached the crash report. Sometimes it does not cause a segmentation fault, but instead reports that
Failure/Error: minimizer.iterate
NoMethodError:
undefined method `call' for 0:Integer
My cost function, includes a summation along the lines of ary.map{|a| (a -x)**2} . It appears that the problem occurs more frequently the larger the size of ary. When ary is 1000 then it happens almost every time. The crash is occurring when the dimensionality is 1 (the final implementation has higher dimensionality but I am comparing against an known solution when there is a dimensionality of 1.