Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Only you can prevent Cthulhu How finding a bug in BioRuby fixed a bug in Rails Andrew Grimm, University of New South Wales
Bite me once... <ul><li>Tried running my work project under JRuby </li><ul><li>Result: BioRuby DO NOT LIKE </li></ul><li>G...
Conclusions at the time: </li><ul><li>Notify them of the issue
Stop experimenting with other implementations, stick with MRI/YARV </li></ul></ul>
Bite me twice... <ul><li>Next week, tried RubyInstaller on Windows </li><ul><li>Result: BioRuby DO NOT LIKE </li></ul><li>...
Culprit: trying to determine OS by parsing RUBY_PLATFORM, rather than using rbconfig's Config::CONFIG[&quot;host_os&quot;]...
Summoning Cthulhu
How did Rails handle it? <ul><li>Couldn't find ideal test for ability to fork (e.g. telling if JRuby has fork enabled)
May as well see how Rails handles it </li><ul><li>949 forkers and 5606 watchers can't be wrong!
Rails summons Cthulhu too? </li></ul></ul>
Pick a bug. Any bug <ul><li>Couldn't understand why they still used RUBY_PLATFORM
Decided to test one of the uses of RUBY_PLATFORM and see if it produced a bug
It did – duplicate of #3999 </li></ul>
So Easy a Caveman Can Do It <ul><li>Here's the bug
Upcoming SlideShare
Loading in …5
×

Only You Can Prevent Cthulhu

771 views

Published on

  • Be the first to comment

  • Be the first to like this

Only You Can Prevent Cthulhu

  1. 1. Only you can prevent Cthulhu How finding a bug in BioRuby fixed a bug in Rails Andrew Grimm, University of New South Wales
  2. 2. Bite me once... <ul><li>Tried running my work project under JRuby </li><ul><li>Result: BioRuby DO NOT LIKE </li></ul><li>Googled whether anyone else had tried doing this. No-one had, but core reckoned it ought to work
  3. 3. Conclusions at the time: </li><ul><li>Notify them of the issue
  4. 4. Stop experimenting with other implementations, stick with MRI/YARV </li></ul></ul>
  5. 5. Bite me twice... <ul><li>Next week, tried RubyInstaller on Windows </li><ul><li>Result: BioRuby DO NOT LIKE </li></ul><li>This time it needed fixing!
  6. 6. Culprit: trying to determine OS by parsing RUBY_PLATFORM, rather than using rbconfig's Config::CONFIG[&quot;host_os&quot;] </li></ul>
  7. 7. Summoning Cthulhu
  8. 8. How did Rails handle it? <ul><li>Couldn't find ideal test for ability to fork (e.g. telling if JRuby has fork enabled)
  9. 9. May as well see how Rails handles it </li><ul><li>949 forkers and 5606 watchers can't be wrong!
  10. 10. Rails summons Cthulhu too? </li></ul></ul>
  11. 11. Pick a bug. Any bug <ul><li>Couldn't understand why they still used RUBY_PLATFORM
  12. 12. Decided to test one of the uses of RUBY_PLATFORM and see if it produced a bug
  13. 13. It did – duplicate of #3999 </li></ul>
  14. 14. So Easy a Caveman Can Do It <ul><li>Here's the bug
  15. 15. Here's the offending code
  16. 16. Here's a link showing what to do
  17. 17. If you know require , you could fix it
  18. 18. No-one did for 2 months </li></ul>
  19. 19. Lessons learnt <ul><li>It's ok to extensively test code
  20. 20. Select can be broken
  21. 21. Check for duplicates before filing
  22. 22. Don't forget to put your name and email in git
  23. 23. Only you can prevent Cthulhu! </li></ul>
  24. 24. It's ok to extensively test code <ul><li>You're not being unreasonable in testing code in JRuby </li></ul>
  25. 25. Select can be broken <ul><li>“Select isn't broken” (SIB) suggests that if there's a bug either in heavily-used code third-party code, and code you've just written, consider the possibility that it's the latter
  26. 26. Rails can't possibly have a bug? </li><ul><li>It can. It has 800 tickets. (Hat tip: Ryan Bigg) </li></ul><li>SIB applies less if the code can't be unit tested, only manifests under certain circumstances, and isn't used much </li></ul>
  27. 27. Check for duplicates before filing <ul><li>I assumed the bug was so simple that if it had been noticed before, it would have been fixed
  28. 28. Check for duplicates before filing
  29. 29. Check for duplicates before filing
  30. 30. Check for duplicates before filing
  31. 31. Check for duplicates before filing
  32. 32. Check for duplicates before filing </li></ul>
  33. 33. Don't forget username and email <ul><li>With people named “Avdi Grimm” and “Andrew Grim”, agrimm@unknown is unhelpful for a commit
  34. 34. Happened because I was on a rarely-used partition </li></ul>
  35. 35. Only you can prevent Cthulhu! <ul><li>My bug fix inspired someone else to remove use of RUBY_PLATFORM for determining OS from Rails entirely </li></ul>
  36. 36. Best way to test something: use it? <ul><li>I've heard people complain that ruby core don't test whether their changes break Rails </li><ul><li>Should Rails developers do that? </li></ul><li>I've heard Rails users complain that changes to Rails breaks their code </li><ul><li>Should Rails users run their code's tests against new versions of Rails? </li></ul></ul>

×