Slide 1

Slide 1 text

How to 
 Contribute Go Hatena Co., Ltd. Shinji Tanaka @stanaka

Slide 2

Slide 2 text

Shinji Tanaka @stanaka / id:stanaka Hatena Co., Ltd. CTO 2

Slide 3

Slide 3 text

One day, a tool couldn’t start • only on Amazon Linux 2016.03 $ some-tool (linux/386 build) Trace/breakpoint trap $

Slide 4

Slide 4 text

>> Trace/breakpoint trap <<

Slide 5

Slide 5 text

modify_ldt • System call called at the boot process of Go 386 binary. • Disabled on Amazon Linux 2016.04 $ cat /boot/config-4.4.5-15.26.amzn1.x86_64 \ | grep MODIFY_LDT # CONFIG_MODIFY_LDT_SYSCALL is not set https://github.com/golang/go/issues/14795

Slide 6

Slide 6 text

Die or Contribute • O.K. Let’s contribute.

Slide 7

Slide 7 text

How to fix it (partial diff) https://github.com/golang/go/commit/ 0f86d1edfb87fddb2c7f50d177b67f48219151f3

Slide 8

Slide 8 text

Go’s Assembler • It’s like a Plan-9 assembler TEXT runtime·profileloop(SB),NOSPLIT,$8 MOVQ $runtime·profileloop1(SB), CX MOVQ CX, 0(SP) CALL runtime·externalthreadhandler(SB) RET

Slide 9

Slide 9 text

Merged!!

Slide 10

Slide 10 text

Go contribute Outline

Slide 11

Slide 11 text

Contribution Guidelines IUUQTHPMBOHPSHEPDDPOUSJCVUFIUNM

Slide 12

Slide 12 text

File an Issues on GitHub • https://github.com/golang/go/issues/14795

Slide 13

Slide 13 text

git codereview • Subcommand of git for Go code review. git codereview change git codereview mail git codereview … [alias] change = codereview change gofmt = codereview gofmt mail = codereview mail pending = codereview pending submit = codereview submit sync = codereview sync

Slide 14

Slide 14 text

git codereview change • Make a change on some branch • Same as git codereview change git checkout -b branch git branch --set-upstream-to origin/master git commit

Slide 15

Slide 15 text

Detailed commit message runtime: use set_thread_area instead of modify_ldt on linux/386 linux/386 depends on modify_ldt system call, but recent Linux kernels can disable this system call. Any Go programs built as linux/386 crash with the message 'Trace/ breakpoint trap'. The kernel config CONFIG_MODIFY_LDT_SYSCALL, which control enable/disable modify_ldt, is disabled on Amazon Linux 2016.03. This fixes this problem by using set_thread_area instead of modify_ldt on linux/386. Fixes #14795.

Slide 16

Slide 16 text

git codereview mail • Push to go-review • Same as git codereview mail git push origin HEAD:refs/for/master.

Slide 17

Slide 17 text

Revise the commit • change & mail again

Slide 18

Slide 18 text

Gerrit https://go-review.googlesource.com/

Slide 19

Slide 19 text

Code reviewing #1

Slide 20

Slide 20 text

Code reviewing #2

Slide 21

Slide 21 text

Save as Draft & Reply

Slide 22

Slide 22 text

Merged!! • ‘Code-Review +2’ is required. • +2 approved • +1 LGTM, but not approved • Maybe this fix released with Go 1.7?

Slide 23

Slide 23 text

Let’s Contribute Go We’re hiring