Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

&4. *OD

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

!ZBIPOEBTBJEBU3BJMTEN “I appreciate valuable relationships with people who create, break, and fix software”

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

This story
 I broke a gem

Slide 8

Slide 8 text

“TracePoint bomb” "3VCZDPNNJUUFSTBZT IUUQTUXJUUFSDPNNSLOTUBUVT

Slide 9

Slide 9 text

5IFCFHJOOJOHPG
 UIFCPNC

Slide 10

Slide 10 text

.BS

Slide 11

Slide 11 text

8FC.PDL$*GBJMVSF IUUQTUSBWJTDJPSHCCMJNLFXFCNPDLKPCT--

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

SVCZSVCZ!CGDG OFUQSPUPDPMSFBEEJSFDUMZJOUPSCVGJGJUTFNQUZ

Slide 15

Slide 15 text

Net::BufferedIO#rbuf_fill

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

Net::BufferedIO#rbuf_fill Changed to assign the value of `@rbuf` or `nil` The value for the second default arg is `nil`

Slide 18

Slide 18 text

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`

Slide 19

Slide 19 text

CCMJNLFXFCNPDL 1SFWFOUA/FU3FBE5JNFPVUAFSSPSJO3VCZ

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

WebMockNetBufferedIO#rbuf_fill

Slide 23

Slide 23 text

8IBUJT5SBDF1PJOU class Framework end

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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 #=> ''

Slide 27

Slide 27 text

%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

Slide 28

Slide 28 text

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)`

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

WebMockNetBufferedIO#rbuf_fill (Repeat)

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

.ZQBUDIXBTSFMFBTFE

Slide 36

Slide 36 text

9 months later

Slide 37

Slide 37 text

%FD

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

CCMJNLFXFCNPDL EJTBCMF5SBDF1PJOUQSPQFSMZ

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

*GPSHPUAFOTVSFA

Slide 44

Slide 44 text

A5SBDF1PJOUAXBTFOBCMFEHMPCBMMZ XIFOBOFYDFQUJPOPDDVST *GPSHPUAFOTVSFA

Slide 45

Slide 45 text

Fall through A5SBDF1PJOUAXBTFOBCMFEHMPCBMMZ XIFOBOFYDFQUJPOPDDVST *GPSHPUAFOTVSFA

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

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

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

Culprit Koichi Ito Detective Koichi Sasada Cast

Slide 52

Slide 52 text

l Š5IFSFBSFOPCVHTJOGSPOUPGNF Š#VHTBSFCFIJOENF !OPCV

Slide 53

Slide 53 text

.FTTBHFTGSPN3VCZDPNNJUUFST 1SFTFOUFECZBNBUTVEBBOE3VCZ%FWFMPQNFOUUFBN

Slide 54

Slide 54 text

5IFQBUDINPOTUFSTBZT “Bug of the year”