Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve keyword arguments coercion and fix GC crash #3112

Merged
merged 2 commits into from
Oct 17, 2014

Conversation

ryoqun
Copy link
Member

@ryoqun ryoqun commented Aug 19, 2014

I stil don't grasp the exact reason of GC crash being fixed..

It was reproducible was by this:

RBXOPT='-Xgc.young_autotune_lifetime=0 -Xgc.young_initial_bytes=1000000 -Xgc.young_max_bytes=1000000 -Xgc.show -Xint=1 -Xjit.show -Xjit.call_til_compile=10 -Xjit.call_inline_threshold=10 -Xjit.inline.debug -Xjit.debug' ./bin/mspec --repeat 200 spec/ruby/language/method_spec.rb

Errors were like these:

1)
A method assigns local variables from method parameters for definition
    def m(*a, b: 1) [a, b] end FAILED
Expected [[#<MockObject:0x1fbda0 @name="splat", @null=nil>], 1]
to equal [[#<MockObject:0x1fbda0 @name="splat", @null=nil>], 1]

[[[ JIT queued Rubinius::CompiledCode#line_from_ip (method)  (5) 1383/519 ]]]
[[[ JIT queued Rubinius::Location#is_block (method)  (10) 1384/519 ]]]
[[[ JIT queued ANONYMOUS#show (block)  (10) 1385/519 ]]]
[[[ JIT queued Rubinius::Location#describe (method)  (10) 1386/519 ]]]
[[[ JIT queued Rubinius::Location#describe_receiver (method)  (10) 1387/519 ]]]
[[[ JIT queued Rubinius::Location#line (method)  (10) 1388/519 ]]]
[[[ JIT queued String#=~ (method)  (10) 1389/519 ]]]
[[[ JIT queued Rubinius::Backtrace#color_from_loc (method)  (10) 1390/519 ]]]
[[[ JIT queued ANONYMOUS#show (block)  (10) 1391/519 ]]]
[[[ JIT queued Rubinius::Location#position (method)  (10) 1392/519 ]]]
[[[ JIT queued Rubinius::Location#file (method)  (10) 1393/519 ]]]
[[[ JIT queued Rubinius::CompiledCode#active_path (method)  (10) 1394/519 ]]]
[[[ JIT queued String#* (method)  (10) 1395/519 ]]]
[[[ JIT queued ANONYMOUS#backtrace (block)  (10) 1396/519 ]]]
   { } in Object(SpecEvaluate)#__script__ at spec/ruby/language/method_spec.rb:905
  BasicObject(SpecEvaluate)#instance_eval at kernel/common/eval.rb:43
        BasicObject(Object)#instance_eval at kernel/common/eval.rb:43
            { } in Enumerable(Array)#all? at kernel/common/enumerable.rb:325
                               Array#each at kernel/bootstrap/array.rb:76
                   Enumerable(Array)#all? at kernel/common/enumerable.rb:325
                    Integer(Fixnum)#times at kernel/common/integer.rb:196
                               Array#each at kernel/bootstrap/array.rb:76
                               Array#each at kernel/bootstrap/array.rb:76
                        Object#__script__ at spec/ruby/language/method_spec.rb:441
                              Kernel.load at kernel/common/kernel.rb:447
        BasicObject(Object)#instance_eval at kernel/common/eval.rb:43
                               Array#each at kernel/bootstrap/array.rb:76
         Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66
         Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152

Rubinius Crash Report #rbxcrashreport

Error: signal SIGSEGV

[[Backtrace]]
bin/rbx[0x67f171]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7f2e53570340]
/lib/x86_64-linux-gnu/libc.so.6(+0x98f00)[0x7f2e528e7f00]
bin/rbx(_ZN8rubinius11MarkSweepGC11move_objectEPNS_6ObjectEmPb+0xa5)[0x738175]
bin/rbx(_ZN8rubinius12ObjectMemory14promote_objectEPNS_6ObjectE+0x84)[0x664c84]
bin/rbx(_ZN8rubinius7BakerGC10saw_objectEPNS_6ObjectE+0x138)[0x72e758]
bin/rbx(_ZN8rubinius14SingletonClass4Info9auto_markEPNS_6ObjectERNS_10ObjectMarkE+0x2a5)[0x6a29b5]
bin/rbx(_ZN8rubinius6Module4Info4markEPNS_6ObjectERNS_10ObjectMarkE+0x12)[0x6e2042]
bin/rbx(_ZN8rubinius16GarbageCollector11scan_objectEPNS_6ObjectE+0xc6)[0x732826]
bin/rbx(_ZN8rubinius7BakerGC7collectEPNS_6GCDataEPNS_17YoungCollectStatsE+0x154)[0x72ea24]
bin/rbx(_ZN8rubinius12ObjectMemory13collect_youngEPNS_5StateEPNS_6GCDataEPNS_17YoungCollectStatsE+0x71)[0x665061]
bin/rbx(_ZN8rubinius12ObjectMemory13collect_maybeEPNS_5StateERNS_11GCTokenImplEPNS_9CallFrameE+0x12d)[0x664dbd]
bin/rbx(_ZN8rubinius2VM13collect_maybeERNS_11GCTokenImplEPNS_9CallFrameE+0x45)[0x6b20f5]
bin/rbx[0x6bf383]
bin/rbx(_ZN8rubinius5Class8allocateEPNS_5StateERNS_11GCTokenImplEPNS_9CallFrameE+0x40)[0x6bedd0]
bin/rbx(_ZN8rubinius10Primitives14class_allocateEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x6e)[0x62500e]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius16BlockEnvironment19execute_interpreterEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x397)[0x6b9ed7]
bin/rbx(_ZN8rubinius16BlockEnvironment6invokeEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x200)[0x6b9ac0]
bin/rbx(_ZN8rubinius16BlockEnvironment4callEPNS_5StateEPNS_9CallFrameERNS_9ArgumentsEi+0x3d)[0x6ba18d]
bin/rbx(_ZN8rubinius4Proc4callEPNS_5StateEPNS_9CallFrameERNS_9ArgumentsE+0x283)[0x6fd4d3]
bin/rbx(_ZN8rubinius10Primitives9proc_callEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x52)[0x63f482]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x21eb)[0x5c6d2b]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius16BlockEnvironment19execute_interpreterEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x397)[0x6b9ed7]
bin/rbx(_ZN8rubinius16BlockEnvironment6invokeEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x200)[0x6b9ac0]
bin/rbx(_ZN8rubinius16BlockEnvironment10call_underEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0xeb)[0x6ba3ab]
bin/rbx(_ZN8rubinius10Primitives16block_call_underEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x52)[0x621c22]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius8CallSite11empty_cacheEPNS_5StateEPS0_PNS_9CallFrameERNS_9ArgumentsE+0x156)[0x6bc216]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x2068)[0x5c6ba8]
bin/rbx(_ZN8rubinius16BlockEnvironment19execute_interpreterEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x397)[0x6b9ed7]
bin/rbx(_ZN8rubinius16BlockEnvironment6invokeEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x200)[0x6b9ac0]
bin/rbx(_ZN8rubinius16BlockEnvironment10call_underEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0xeb)[0x6ba3ab]
bin/rbx(_ZN8rubinius10Primitives16block_call_underEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x52)[0x621c22]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x1f83)[0x5c6ac3]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x2068)[0x5c6ba8]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x2068)[0x5c6ba8]
bin/rbx(_ZN8rubinius16BlockEnvironment19execute_interpreterEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x397)[0x6b9ed7]
bin/rbx(_ZN8rubinius16BlockEnvironment6invokeEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x200)[0x6b9ac0]
bin/rbx(_ZN8rubinius16BlockEnvironment4callEPNS_5StateEPNS_9CallFrameERNS_9ArgumentsEi+0x3d)[0x6ba18d]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x2ec4)[0x5c7a04]
bin/rbx(_ZN8rubinius16BlockEnvironment19execute_interpreterEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x397)[0x6b9ed7]
bin/rbx(_ZN8rubinius16BlockEnvironment6invokeEPNS_5StateEPNS_9CallFrameEPS0_RNS_9ArgumentsERNS_15BlockInvocationE+0x200)[0x6b9ac0]
bin/rbx(_ZN8rubinius16BlockEnvironment4callEPNS_5StateEPNS_9CallFrameERNS_9ArgumentsEi+0x3d)[0x6ba18d]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x2ce7)[0x5c7827]
bin/rbx(_ZN8rubinius11MachineCode19execute_specializedINS_16GenericArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x39f)[0x619e2f]
bin/rbx(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x2068)[0x5c6ba8]

[[System Info]]
sysname: Linux
nodename: rrm
release: 3.16.0-9-generic
version: #14-Ubuntu SMP Fri Aug 15 15:03:57 UTC 2014
machine: x86_64

Maybe, this should also be fixed in vm/block_environment.cpp. But my sleep time has come... ;)

@yorickpeterse
Copy link
Contributor

Could you separate the commit in to two separate ones?:

  • One commit containing the spec changes
  • One commit containing the actual code changes

This makes it easier to sync the specs with RubySpec whenever (and if) needed.

@ryoqun
Copy link
Member Author

ryoqun commented Aug 21, 2014

Oh,.. I forgot to separate.. I'll do once I fixs the CI error

@ryoqun ryoqun force-pushed the keyword-arguments-coercion-gc branch from adb6601 to 6c09fc3 Compare August 22, 2014 15:21
@ryoqun
Copy link
Member Author

ryoqun commented Aug 26, 2014

@brixen could you take a look at this when you have some free time?

@ryoqun
Copy link
Member Author

ryoqun commented Oct 5, 2014

@brixen ping

@brixen brixen merged commit 6c09fc3 into rubinius:master Oct 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants