mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
b02bd63dc5
Calling the `Method#{parameters,source_location}` method on a static `Proc` object resulted in `SIGSEGV`.
The trigger is https://github.com/mruby/mruby/pull/5402.
The original implementation of the `Method#{parameters,source_location}` method was to temporarily rewrite the object and then call the method of the same name in `Proc`.
Rewriting of objects placed in the ROM section by #5402 above is prohibited by hardware such as the CPU.
This caused a `SIGSEGV`.
mruby-method
An implementation of class Method and UnboundMethod for mruby
p Enumerable.instance_method(:find_all).source_location
#=> ["mruby/mruby/mrblib/enum.rb", 148]
Note
You need to enable debug option in your build configuration to use
source_location method in this gem, for example:
MRuby::Build.new do |conf|
conf.enable_debug
end
Supported Methods
Kernel
Kernel#methodKernel#singleton_method
Module
Module#instance_method
Method class
Method#nameMethod#callMethod#super_methodMethod#arityMethod#unbindMethod#[]Method#ownerMethod#receiverMethod#parametersMethod#source_locationMethod#to_proc
UnboundMethod class
UnboundMethod#nameUnboundMethod#bindUnboundMethod#super_methodUnboundMethod#arityUnboundMethod#ownerUnboundMethod#parametersUnboundMethod#source_location