Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Historically, calling a method with a very large number of arguments resulted in a core dump. In Ruby 1.9, this was improved to instead raise SystemStackError. In Ruby 2.2, the issue was fixed for methods defined in Ruby. However, in Ruby 3.2, this is still an issue for methods defined in C. This issue was reported as a bug over 12 years ago, and was the second oldest open bug in Ruby's bug tracker. Come learn about stacks, heaps, argument handling during method dispatch, and how we fixed this bug in Ruby 3.3.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this presentation, Jeremy Evans discusses the second oldest open bug in Ruby's bug tracker, identified as bug 4040, which involves a SystemStackError triggered by calling methods with very large array arguments. Over the years, Ruby's handling of method calls with large argument arrays has evolved significantly, from crashing with a core dump in Ruby 1.8 to raising SystemStackError in later versions. The bug primarily affected methods defined in C and persisted through Ruby 3.2. Evans details the journey to fix this enduring issue and the complexities that arose during the process. The key points include: - **Historical Context**: - The initial behavior in Ruby 1.8 resulted in crashes due to method calls with too many arguments, which transitioned to raising SystemStackError in Ruby 1.9. - Ruby 2.2 partially addressed the issue for Ruby-defined methods, leaving C-defined methods vulnerable. - **Bug Fix Process**: - Extensive debugging techniques involved using GDB and examining how arguments were passed to methods. - The solution introduced a method to manage larger argument arrays by allocating them on the heap rather than the VM stack, thereby avoiding stack overflow. - **Implementation Challenges**: - Multiple method types needed to be considered, each requiring different handling strategies, particularly for methods defined by blocks. - The ongoing effort felt like a game of 'whack-a-mole' as addressing one bug led to the emergence of others. - **Performance Considerations**: - Initial fixes resulted in a minor slowdown in method calls, prompting optimizations that improved performance in certain cases. - Changes made were discussed extensively within the Ruby community, considering their potential impact. - **Integration and Future Outlook**: - The comprehensive fix was merged into Ruby 3.3, but the possibility of reverting the patch exists if future performance concerns arise. The main takeaway is that persistence and collaboration within the Ruby community can lead to resolving long-standing issues. Evans encourages other developers to engage with Ruby's bug-fixing process, underscoring the value of determination and teamwork in improving programming languages.
Suggest modifications
Cancel