The TracePoint bumb!

The TracePoint bumb!

RubyKaigi 2019 LT
https://rubykaigi.org/2019

023b04c98f39cc041293d780352432ff?s=128

Koichi ITO

April 19, 2019
Tweet

Transcript

  1.  'SJ The TracePoint Bomb! ,PJDIJ*50&4. *OD 3VCZ,BJHJ 'VLVPLB*OUFSOBUJPOBM$POHSFTT$FOUFS Bug

    of the year 2018
  2. !LPJD w 3VCP$PQ$PNNJUUFS w "30SBDMFFOIBODFE BEBQUFS$PNNJUUFS w $PNNVOJUZ.BOBHFS BU&4. *OD

  3. &4. *OD

  4. 044ίϛϡχςΟͱͷڞੜΛࢧԉ Support coexistence with OSS community

  5. !ZBIPOEBTBJEBU3BJMTEN “I appreciate valuable relationships with people who create, break,

    and fix software”
  6. None
  7. This story
 I broke a gem

  8. “TracePoint bomb” "3VCZDPNNJUUFSTBZT IUUQTUXJUUFSDPNNSLOTUBUVT

  9. 5IFCFHJOOJOHPG
 UIFCPNC

  10. .BS

  11. 8FC.PDL$*GBJMVSF IUUQTUSBWJTDJPSHCCMJNLFXFCNPDLKPCT--

  12. TVQFS /FU#V⒎FSFE*0 8FC.PDLFYUFOET3VCZ`TTUEMJC SCVG@pMM 8FC.PDL/FU#V⒎FSFE*0 SCVG@pMM

  13. TVQFS /FU#V⒎FSFE*0 /FUTUEMJC"1*DIBOHFE SCVG@pMM 8FC.PDL/FU#V⒎FSFE*0 SCVG@pMM

  14. SVCZSVCZ!CGDG OFUQSPUPDPMSFBEEJSFDUMZJOUPSCVGJGJUTFNQUZ

  15. Net::BufferedIO#rbuf_fill

  16. Net::BufferedIO#rbuf_fill The value for the second default arg is `nil`

  17. Net::BufferedIO#rbuf_fill Changed to assign the value of `@rbuf` or `nil`

    The value for the second default arg is `nil`
  18. Net::BufferedIO#rbuf_fill Use the lvar `tmp` Changed to assign the value

    of `@rbuf` or `nil` The value for the second default arg is `nil`
  19. CCMJNLFXFCNPDL 1SFWFOUA/FU3FBE5JNFPVUAFSSPSJO3VCZ

  20. None
  21. TVQFS /FU#V⒎FSFE*0 'PMMPXTVQFSDMBTTDIBOHFT SCVG@pMM 8FC.PDL/FU#V⒎FSFE*0 SCVG@pMM

  22. WebMockNetBufferedIO#rbuf_fill

  23. 8IBUJT5SBDF1PJOU class Framework end

  24. "TTJHOUPMWBS class Framework def initialize hard_config = '' end end

  25. %FpOFBNFUIPEUPTIPXUIFMWBS class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end
  26. MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> ''
  27. %FpOFBTVCDMBTT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework end
  28. 6TFAMPDBM@WBSJBCMF@TFUA class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end Specify the event to evaluate the expression with `trace(:line)`
  29. 6TFAMPDBM@WBSJBCMF@TFUA class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end 4QFDJGZMWBSAIBSE@DPOpHA
  30. MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end p Application.new.config #=> '' 4QFDJGZMWBSAIBSE@DPOpHA
  31. MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end p Application.new.config #=> '' p Framework.new.config #=> '' 4QFDJGZMWBSAIBSE@DPOpHA
  32. WebMockNetBufferedIO#rbuf_fill (Repeat)

  33. w*EJEOPUXBOUUPXSJUFB NFUIPEPWFSXSJUUFODPEFT VTJOHDPQZBOEQBTUF w*EJEOPUXBOUUPEVQBMPU PGDPEFTUPJNQMFNFOU TNBMMEJGGFSFODF 8IZ5SBDF1PJOU

  34. w(PUIFPQQPTJUFPG3VCZ Y w8FC.PDLJTBMJCSBSZGPS UFTUJOH w*UTIPVMEOPUBGGFDU QSPEVDUJPOSVOUJNF 5SBDF1PJOUJTTMPX

  35. .ZQBUDIXBTSFMFBTFE

  36. 9 months later

  37. %FD

  38. None
  39. “Ruby is funny because this method returns nil” "3VCZDPNNJUUFSTBZT IUUQTUXJUUFSDPN@LPTUBUVT

  40. CCMJNLFXFCNPDL EJTBCMF5SBDF1PJOUQSPQFSMZ

  41. None
  42. None
  43. *GPSHPUAFOTVSFA

  44. A5SBDF1PJOUAXBTFOBCMFEHMPCBMMZ XIFOBOFYDFQUJPOPDDVST *GPSHPUAFOTVSFA

  45. Fall through A5SBDF1PJOUAXBTFOBCMFEHMPCBMMZ XIFOBOFYDFQUJPOPDDVST *GPSHPUAFOTVSFA

  46. “Ruby is funny because this method returns nil” "3VCZDPNNJUUFSTBZT IUUQTUXJUUFSDPN@LPTUBUVT

  47. w#FDBSFGVMJGZPVVTF5SBDF1PJOU UPIBSEEFQFOEPOJOUFSOBM JNQMFNFOUBUJPO w#FDBSFGVMXIFOVTJOH5SBDF1PJOU XJUIA#JOEJOHMPDBM@WBSJBCMF@TFUA w-FUTDSFBUFFYUFOTJPOQPJOUTUP UIFVQTUSFBNGPSFBTZFYUFOTJPO %PTBHFBOE"ENJOJTUSBUJPO

  48. “The culprit was koic" "3VCZDPNNJUUFSTBZT IUUQTUXJUUFSDPN@LPTUBUVT

  49. “Thanks for using Ruby's trunk” "3VCZDPNNJUUFSTBZT IUUQTUXJUUFSDPNLLVCVOTUBUVT

  50. Koichi fixes Koichi’s bug ,PJDIJ*50&4. *OD Bug of the year

    2018 5IBOLZPVGPSMJTUFOJOH
  51. Culprit Koichi Ito Detective Koichi Sasada Cast

  52. l Š5IFSFBSFOPCVHTJOGSPOUPGNF Š#VHTBSFCFIJOENF !OPCV

  53. .FTTBHFTGSPN3VCZDPNNJUUFST 1SFTFOUFECZBNBUTVEBBOE3VCZ%FWFMPQNFOUUFBN

  54. 5IFQBUDINPOTUFSTBZT “Bug of the year”