Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to Contribute Go

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

How to Contribute Go

Go Conference 2016 Spring

Avatar for Shinji Tanaka

Shinji Tanaka

April 23, 2016

More Decks by Shinji Tanaka

Other Decks in Technology

Transcript

  1. One day, a tool couldn’t start • only on Amazon

    Linux 2016.03 $ some-tool (linux/386 build) Trace/breakpoint trap $
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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.
  7. git codereview mail • Push to go-review • Same as

    git codereview mail git push origin HEAD:refs/for/master.
  8. Merged!! • ‘Code-Review +2’ is required. • +2 approved •

    +1 LGTM, but not approved • Maybe this fix released with Go 1.7?