<pre class="notranslate">misc/cgo/test fails after this change <a href="https://golang.org/cl/7304104/" rel="nofollow">https://golang.org/cl/7304104/</a>

test crashes sometimes. Perhaps, this will help you:

(gdb) disas
Dump of assembler code for function runtime.usleep:
    0x00416680 &lt;+0&gt;:     mov    %fs:0x14,%ecx
=&gt; 0x00416687 &lt;+7&gt;:     mov    (%ecx),%ecx
    0x00416689 &lt;+9&gt;:     cmp    (%ecx),%esp
    0x0041668b &lt;+11&gt;:    ja     0x416699 &lt;runtime.usleep+25&gt;
    0x0041668d &lt;+13&gt;:    xor    %edx,%edx
    0x0041668f &lt;+15&gt;:    mov    $0x4,%eax
    0x00416694 &lt;+20&gt;:    call   0x41c470 &lt;runtime.morestack&gt;
    0x00416699 &lt;+25&gt;:    sub    $0xc,%esp
    0x0041669c &lt;+28&gt;:    mov    0x10(%esp),%ecx
    0x004166a0 &lt;+32&gt;:    mov    $0x10624dd3,%eax
    0x004166a5 &lt;+37&gt;:    mul    %ecx
    0x004166a7 &lt;+39&gt;:    shr    $0x6,%edx
    0x004166aa &lt;+42&gt;:    mov    %edx,%ecx
    0x004166ac &lt;+44&gt;:    cmp    $0x0,%edx
    0x004166af &lt;+47&gt;:    jne    0x4166b6 &lt;runtime.usleep+54&gt;
    0x004166b1 &lt;+49&gt;:    mov    $0x1,%ecx
    0x004166b6 &lt;+54&gt;:    mov    0x58a0c4,%eax
    0x004166bc &lt;+60&gt;:    mov    %eax,(%esp)
    0x004166bf &lt;+63&gt;:    mov    $0x1,%eax
    0x004166c4 &lt;+68&gt;:    mov    %eax,0x4(%esp)
    0x004166c8 &lt;+72&gt;:    mov    %ecx,0x8(%esp)
    0x004166cc &lt;+76&gt;:    call   0x416ad0 &lt;runtime.stdcall&gt;
    0x004166d1 &lt;+81&gt;:    add    $0xc,%esp
    0x004166d4 &lt;+84&gt;:    ret
End of assembler dump.
(gdb) info r
eax            0x1      1
ecx            0x0      0
edx            0x0      0
ebx            0x0      0
esp            0x3182fecc       0x3182fecc
ebp            0x3182ff30       0x3182ff30
esi            0xa      10
edi            0x0      0
eip            0x416687 0x416687 &lt;runtime.usleep+7&gt;
eflags         0x10246  [ PF ZF IF RF ]
cs             0x1b     27
ss             0x23     35
ds             0x23     35
es             0x23     35
fs             0x3b     59
gs             0x0      0
(gdb) bt
#0  0x00416687 in runtime.usleep (us=void)
     at C:/go/root/src/pkg/runtime/thread_windows.c:146
#1  0x004121bd in lockextra (nilokay=void)
     at C:/go/root/src/pkg/runtime/proc.c:1044
#2  0x00411fbc in runtime.needm (x=void)
     at C:/go/root/src/pkg/runtime/proc.c:915
#3  0x0041c70c in runtime.cgocallback (fn=void, frame=void,
framesize=void)
     at C:/go/root/src/pkg/runtime/asm_386.s:495
#4  0x0042c780 in _cgoexp_e9125f37873d_Add (a=void, n=void)
     at
C:/DOCUME~1/brainman/LOCALS~1/Temp/go-build908326399/_/C_/go/root/misc/cgo/test/_test/_cgo_defun.c:321
#5  0x00480836 in ?? ()
#6  0x0042ccdb in ?? ()
#7  0x0042d65c in ?? ()
#8  0x77c3a3b0 in msvcrt!_endthreadex () from
C:\WINDOWS\system32\msvcrt.dll
#9  0x7c80b729 in KERNEL32!GetModuleFileNameA ()
    from C:\WINDOWS\system32\kernel32.dll
#10 0x00000000 in ?? ()
(gdb)</pre>
<pre class="notranslate">What steps will reproduce the problem?
1. When moving code from file A to file B, I copy file A's imports as well.
2. Run gofmt, which sorts the imports.
3. Compile the code, which detects unused imports, which I can remove.
4. I still need to remove duplicate unnamed imports manually.

What is the expected output? What do you see instead?
gofmt could safely remove the duplicate unnamed imports.

Please use labels and text to provide additional information.</pre>