eastany / eastany.github.com

我的博客
4 stars 3 forks source link

掉坑里了 #51

Open 0x9e3779b9 opened 8 years ago

0x9e3779b9 commented 8 years ago

周五安心提交完 想着周末跑两天 结果今天看日志的时候发现: unexpected fault address 0x0
fatal error: fault [signal 0xb code=0x80 addr=0x0 pc=0x45f943]

goroutine 78 [running]: runtime.throw(0xaf8e28, 0x5) /home/go/src/runtime/panic.go:527 +0x90 fp=0xc82d4cd880 sp=0xc82d4cd868 runtime.sigpanic() /home/go/src/runtime/sigpanic_unix.go:27 +0x2ab fp=0xc82d4cd8d0 sp=0xc82d4cd880 runtime.aeshashbody() /home/go/src/runtime/asm_amd64.s:1040 +0x2c3 fp=0xc82d4cd8d8 sp=0xc82d4cd8d0 runtime.mapaccess2_faststr(0x926ac0, 0xc8212648a0, 0x3334322c36353432, 0x38, 0xc821d15520, 0x92ad01) /home/go/src/runtime/hashmap_fast.go:347 +0x37e fp=0xc82d4cd938 sp=0xc82d4cd8d8 .(*FPTree).getHeader(0xc82017e070)

for index := range ft.Input {                                                                                                
        for in := range ft.Input[index] {                                                                                        
            if _, ok := ft.HeaderIndex[ft.Input[index][in]]; !ok {    // ----就这这里                                                                                           
                ft.HeaderIndex[ft.Input[index][in]] = &FreOrdered{                                                               
                    Name:  ft.Input[index][in],                                                                                  
                    Count: 1,                                                                                                    
                }                                                                                                                
            } else {                                                                                                             
                ft.HeaderIndex[ft.Input[index][in]].Count++                                                                      
            }                                                                                                                    
        }                                                                                                                        
    }   
0x9e3779b9 commented 8 years ago

go version go1.5 linux/amd64

查看半天看到http://cmgs.me/life/wtf 有提到 作者 https://github.com/golang/go/issues/13062 也提到可能是竞争race引起的 可是我的逻辑是一个goroutine中啊....不能是GC吧