aregm / nff-go

NFF-Go -Network Function Framework for GO (former YANFF)
BSD 3-Clause "New" or "Revised" License
1.38k stars 156 forks source link

VectorSplitFunction and VectorSeparateFunction error:SIGILL: illegal instruction #704

Closed cang233 closed 4 years ago

cang233 commented 4 years ago

I run the github.com/intel-go/nff-go/test/stability/testSingleWorkingFF TestVectorSplit test function by go test -run TestVectorSplit,then return error,but the other TestSplit,TestVectorHandle,TestHandle is ok.

------------***-------- Initializing DPDK --------***------------
------------***------ Initializing scheduler -----***------------
DEBUG: Scheduler can use cores: [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
Source MAC 0: xx:xx:ba:90:xx:xx
Source MAC 1: xx:xx:9f:xx:01:xx
No config file specified, stub destination MAC addresses will be used
------------***---------- Creating ports ---------***------------
DEBUG: Port 0 MAC address: xx:xx:ba:90:xx:xx
DEBUG: Port 1 MAC address: xx:xx:9f:xx:01:xx
------------***------ Starting FlowFunctions -----***------------
DEBUG: Start SCHEDULER at 0 core
DEBUG: Start STOP at scheduler 0 core
DEBUG: Start new instance for fast generator1
DEBUG: Start new clone for fast generator1 instance 0 at 1 core
DEBUG: Start new instance for segment1
DEBUG: Start new clone for segment1 instance 0 at 2 core
SIGILL: illegal instruction
PC=0x7cb864 m=0 sigcode=2

goroutine 50 [running, locked to thread]:
github.com/intel-go/nff-go/asm.GenerateMask(0xc000106100, 0x12712c0, 0xc0001060e0, 0xc000110008)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/asm/asm.s:21 +0x14 fp=0xc0014d49f0 sp=0xc0014d49e8 pc=0x7cb864
github.com/intel-go/nff-go/flow.segmentProcess(0xa43060, 0xc00013a1b0, 0xc000138180, 0x2, 0x2, 0xc0014c0120, 0xc0014c0180, 0xc0014d6000, 0xc000096000, 0x4, ...)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/flow.go:1506 +0x994 fp=0xc0014d4ef0 sp=0xc0014d49f0 pc=0x7e0a84
github.com/intel-go/nff-go/flow.(*instance).startNewClone.func1(0xc00012d380, 0x2, 0xc0014ae300)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:289 +0x245 fp=0xc0014d4fc8 sp=0xc0014d4ef0 pc=0x7e8be5
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc0014d4fd0 sp=0xc0014d4fc8 pc=0x494e21
created by github.com/intel-go/nff-go/flow.(*instance).startNewClone
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:283 +0x2b2

goroutine 1 [chan receive]:
testing.(*T).Run(0xc00011c200, 0xb009ea, 0xf, 0xb1f230, 0x4b9b01)
    /usr/local/go/src/testing/testing.go:961 +0x377
testing.runTests.func1(0xc00011c100)
    /usr/local/go/src/testing/testing.go:1202 +0x78
testing.tRunner(0xc00011c100, 0xc000127dc0)
    /usr/local/go/src/testing/testing.go:909 +0xc9
testing.runTests(0xc0000d62a0, 0x10eefc0, 0xb, 0xb, 0x0)
    /usr/local/go/src/testing/testing.go:1200 +0x2a7
testing.(*M).Run(0xc00015a080, 0x0)
    /usr/local/go/src/testing/testing.go:1117 +0x176
main.main()
    _testmain.go:64 +0x135

goroutine 19 [syscall]:
os/signal.signal_recv(0x0)
    /usr/local/go/src/runtime/sigqueue.go:147 +0x9c
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
    /usr/local/go/src/os/signal/signal_unix.go:29 +0x41

goroutine 22 [sync.Cond.Wait]:
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:310
sync.runtime_notifyListWait(0xc00013c050, 0xc000000000)
    /usr/local/go/src/runtime/sema.go:510 +0xf8
sync.(*Cond).Wait(0xc00013c040)
    /usr/local/go/src/sync/cond.go:56 +0x9d
github.com/intel-go/nff-go/test/stability/testSingleWorkingFF.executeTest(0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0xc8827b3, 0xc8827b30000000f)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/test/stability/testSingleWorkingFF/testSingleWorkingFF.go:254 +0x482
github.com/intel-go/nff-go/test/stability/testSingleWorkingFF.launch(0xc00011c200, 0x3)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/test/stability/testSingleWorkingFF/singleWorkingFF_test.go:63 +0x45
github.com/intel-go/nff-go/test/stability/testSingleWorkingFF.TestVectorSplit(0xc00011c200)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/test/stability/testSingleWorkingFF/singleWorkingFF_test.go:47 +0x34
testing.tRunner(0xc00011c200, 0xb1f230)
    /usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
    /usr/local/go/src/testing/testing.go:960 +0x350

goroutine 43 [runnable, locked to thread]:
github.com/intel-go/nff-go/flow.(*instance).startNewClone(0xc0014ae300, 0xc00015c000, 0x0, 0x2, 0x10)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:300 +0x302
github.com/intel-go/nff-go/flow.(*flowFunction).startNewInstance(0xc00012d380, 0xc000138180, 0x2, 0x2, 0xc00015c000, 0x0, 0x0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:255 +0x15a
github.com/intel-go/nff-go/flow.(*scheduler).systemStart(0xc00015c000, 0xc0014ac080, 0xa57ea0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:237 +0x2a5
github.com/intel-go/nff-go/flow.SystemStartScheduler(0x0, 0x0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/flow.go:794 +0x31
github.com/intel-go/nff-go/flow.SystemStart(0x0, 0x0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/flow.go:822 +0x35
github.com/intel-go/nff-go/test/stability/testSingleWorkingFF.executeTest.func1(0xc00014c040)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/test/stability/testSingleWorkingFF/testSingleWorkingFF.go:246 +0x22
created by github.com/intel-go/nff-go/test/stability/testSingleWorkingFF.executeTest
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/test/stability/testSingleWorkingFF/testSingleWorkingFF.go:245 +0x429

goroutine 27 [syscall]:
github.com/intel-go/nff-go/internal/low._Cfunc_nff_go_stop(0x7f5f10000a20, 0x7f5f00000010, 0xc00015c074, 0x0, 0xc00002e1c0)
    _cgo_gotypes.go:777 +0x45
github.com/intel-go/nff-go/internal/low.Stop.func1(0xc00015a000, 0x10, 0x10, 0xc00015c074, 0x0, 0xc00002e1c0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/internal/low/low.go:537 +0xa7
github.com/intel-go/nff-go/internal/low.Stop(0xc00015a000, 0x10, 0x10, 0xc00015c074, 0x0, 0xc00002e1c0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/internal/low/low.go:537 +0x5d
github.com/intel-go/nff-go/flow.(*scheduler).systemStart.func1(0xc00015c000, 0x0, 0xc00002e1c0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:234 +0x5e
created by github.com/intel-go/nff-go/flow.(*scheduler).systemStart
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:233 +0x215

goroutine 28 [runnable, locked to thread]:
github.com/intel-go/nff-go/test/stability/testSingleWorkingFF.generatePacket(0x17ea42e80, 0x0, 0x0)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/test/stability/testSingleWorkingFF/testSingleWorkingFF.go:404 +0x360
github.com/intel-go/nff-go/flow.pFastGenerate(0xa42e60, 0xc00014a240, 0x0, 0x0, 0x0, 0xc000038060, 0xc0000380c0, 0xc001490000, 0xc000082130, 0x1, ...)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/flow.go:1632 +0x184
github.com/intel-go/nff-go/flow.(*instance).startNewClone.func1(0xc00012d200, 0x1, 0xc000001c80)
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:289 +0x245
created by github.com/intel-go/nff-go/flow.(*instance).startNewClone
    /home/pvs1/gopath/src/github.com/intel-go/nff-go/flow/scheduler.go:283 +0x2b2

rax    0xc000106100
rbx    0x12712c0
rcx    0xc0001060e0
rdx    0xc000110008
rdi    0xc000110008
rsi    0xc000106100
rbp    0xc0014d4ee0
rsp    0xc0014d49e8
r8     0xc000110000
r9     0x0
r10    0x0
r11    0xc00148e100
r12    0xc0014cc000
r13    0xc000110000
r14    0xc000110008
r15    0x0
rip    0x7cb864
rflags 0x13256
cs     0x33
fs     0x0
gs     0x0
exit status 2

even I wrote a simple test myself,it return error like above.

func TestUseVSplitter(t *testing.T) {
    vs := func(ps []*packet.Packet, mask *[32]bool, out *[32]uint8, ctx flow.UserContext) {
        for i := 0; i < 32; i++ {
            if mask[i] {
                out[i] = uint8(i % 3)
            }
        }
    }
    flow.CheckFatal(flow.SystemInit(nil))
    IN, err := flow.SetReceiver(0)
    flow.CheckFatal(err)
    flows, err := flow.SetVectorSplitter(IN, vs, 3, nil)
    flow.CheckFatal(err)
    for i := 0; i < 3; i++ {
        flow.CheckFatal(flow.SetStopper(flows[i]))
    }
    flow.CheckFatal(flow.SystemStart())
}
root@pvs1:/gopath/src# go version
go version go1.13.4 linux/amd64
root@pvs1:/gopath/src# uname -a
Linux pvs1 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

update dpdk binding NIC info:

Network devices using DPDK-compatible driver
============================================
0000:04:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection 10fb' drv=igb_uio unused=
0000:05:00.0 '82580 Gigabit Network Connection 150e' drv=igb_uio unused=
cang233 commented 4 years ago

I use the VectorSeparateFunction,which is called by SetVectorHandlerDrop,return errors too.

------------***------ Starting FlowFunctions -----***------------
DEBUG: Start SCHEDULER at 0 core
DEBUG: Start STOP at scheduler 0 core
DEBUG: Start new instance for receiverPort1
DEBUG: Start new clone for receiverPort1 instance 0 at 1 core
DEBUG: Start new instance for segment1
DEBUG: Start new clone for segment1 instance 0 at 2 core
DEBUG: Start new instance for segment2
DEBUG: Start new clone for segment2 instance 0 at 3 core
SIGILL: illegal instruction
PC=0x779964 m=5 sigcode=2

goroutine 115 [running, locked to thread]:
github.com/intel-go/nff-go/asm.GenerateMask(0xc00cdcc060, 0x1200040, 0xc00cdcc040, 0xc00cde0008)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/asm/asm.s:21 +0x14 fp=0xc00cddc9f0 sp=0xc00cddc9e8 pc=0x779964
github.com/intel-go/nff-go/flow.segmentProcess(0xa09b40, 0xc00014e330, 0xc00cdc6000, 0x11, 0x11, 0xc00cdd4000, 0xc00cdd4060, 0xc00cdd2000, 0xc0000aaa80, 0x3, ...)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/flow.go:1510 +0x994 fp=0xc00cddcef0 sp=0xc00cddc9f0 pc=0x789204
github.com/intel-go/nff-go/flow.(*instance).startNewClone.func1(0xc000082900, 0x3, 0xc00017de00)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:289 +0x245 fp=0xc00cddcfc8 sp=0xc00cddcef0 pc=0x790175
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc00cddcfd0 sp=0xc00cddcfc8 pc=0x490b91
created by github.com/intel-go/nff-go/flow.(*instance).startNewClone
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:283 +0x2b2

goroutine 1 [chan receive, locked to thread]:
github.com/intel-go/nff-go/flow.(*scheduler).measure(0xc000e42000, 0x7, 0x1, 0xed)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:836 +0x2cf
github.com/intel-go/nff-go/flow.(*scheduler).systemStart(0xc000e42000, 0xc0000e6120, 0xa1d7c0)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:244 +0x3ca
github.com/intel-go/nff-go/flow.SystemStartScheduler(0x0, 0x0)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/flow.go:794 +0x31
github.com/intel-go/nff-go/flow.SystemStart(0x0, 0xada178)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/flow.go:822 +0x35
main.main()
    /home/pvs1/gopath/src/flowparser/main.go:70 +0x2ef

goroutine 19 [syscall]:
os/signal.signal_recv(0x0)
    /usr/local/go/src/runtime/sigqueue.go:147 +0x9c
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
    /usr/local/go/src/os/signal/signal_unix.go:29 +0x41

goroutine 38 [sleep]:
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:310
time.Sleep(0x3b9aca00)
    /usr/local/go/src/runtime/time.go:105 +0x157
main.IPv4TCPCounter()
    /home/pvs1/gopath/src/flowparser/main.go:75 +0xfe
created by main.main
    /home/pvs1/gopath/src/flowparser/main.go:67 +0x2ea

goroutine 39 [syscall]:
github.com/intel-go/nff-go/internal/low._Cfunc_nff_go_stop(0x7f4a44000a20, 0x7f4a00000010, 0xc000e42074, 0x0, 0xc0000e6180)
    _cgo_gotypes.go:790 +0x45
github.com/intel-go/nff-go/internal/low.Stop.func1(0xc000134080, 0x10, 0x10, 0xc000e42074, 0x0, 0xc0000e6180)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/internal/low/low.go:542 +0xa7
github.com/intel-go/nff-go/internal/low.Stop(0xc000134080, 0x10, 0x10, 0xc000e42074, 0x0, 0xc0000e6180)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/internal/low/low.go:542 +0x5d
github.com/intel-go/nff-go/flow.(*scheduler).systemStart.func1(0xc000e42000, 0x0, 0xc0000e6180)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:234 +0x5e
created by github.com/intel-go/nff-go/flow.(*scheduler).systemStart
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:233 +0x215

goroutine 24 [syscall]:
github.com/intel-go/nff-go/internal/low._Cfunc_receiveRSS(0xa00000, 0xc004e20000, 0x7f4a140008c0, 0xc0000b8278, 0x1, 0xc00014c0ac, 0xc0000ee2b8)
    _cgo_gotypes.go:858 +0x45
github.com/intel-go/nff-go/internal/low.ReceiveRSS.func1(0x200000000, 0xc004e20000, 0x11, 0x11, 0xc00002c180, 0x10, 0x10, 0xc0000b8278, 0x1, 0xc00014c0ac, ...)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/internal/low/low.go:508 +0xd9
github.com/intel-go/nff-go/internal/low.ReceiveRSS(0x0, 0xc004e20000, 0x11, 0x11, 0xc00002c180, 0x10, 0x10, 0xc0000b8278, 0x1, 0xc00014c0ac, ...)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/internal/low/low.go:508 +0xf9
github.com/intel-go/nff-go/flow.recvRSS(0xa09ac0, 0xc0000ee280, 0xc004e20000, 0x11, 0x11, 0xc0000b8278, 0x1)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/flow.go:1541 +0x127
github.com/intel-go/nff-go/flow.(*instance).startNewClone.func1(0xc000082600, 0x1, 0xc0000cb680)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:294 +0xd2
created by github.com/intel-go/nff-go/flow.(*instance).startNewClone
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:283 +0x2b2

goroutine 25 [runnable, locked to thread]:
github.com/intel-go/nff-go/internal/low.nffgoRingMcDoDequeue(0x1c68350, 0xc000e45ac0, 0x20, 0x20, 0x20, 0x0)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/internal/low/low.go:440 +0x119
github.com/intel-go/nff-go/internal/low.nffgoRingMcDequeueBurst(...)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/internal/low/low.go:494
github.com/intel-go/nff-go/internal/low.(*Ring).DequeueBurst(...)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/internal/low/low.go:307
github.com/intel-go/nff-go/flow.segmentProcess(0xa09b40, 0xc00014e180, 0xc004e20050, 0x11, 0x11, 0xc00009e060, 0xc00009e0c0, 0xc00cdbe600, 0xc00cdc4000, 0x8, ...)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/flow.go:1446 +0x369
github.com/intel-go/nff-go/flow.(*instance).startNewClone.func1(0xc000082780, 0x2, 0xc0000cb980)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:289 +0x245
created by github.com/intel-go/nff-go/flow.(*instance).startNewClone
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:283 +0x2b2

goroutine 117 [runnable, locked to thread]:
github.com/intel-go/nff-go/flow.segmentProcess(0xa09b40, 0xc000122690, 0xc00ce007e0, 0x8, 0x8, 0xc00cdea480, 0xc00cdea4e0, 0xc004e5d000, 0x0, 0x0, ...)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/flow.go:1423 +0xc36
github.com/intel-go/nff-go/flow.(*scheduler).measure.func1(0x4, 0xc000122690, 0xc00ce007e0, 0x8, 0x8, 0xc00cde8060, 0xc004e5d000)
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:830 +0xab
created by github.com/intel-go/nff-go/flow.(*scheduler).measure
    /home/pvs1/gopath/pkg/mod/github.com/intel-go/nff-go@v0.9.2/flow/scheduler.go:828 +0x441

rax    0xc00cdcc060
rbx    0x1200040
rcx    0xc00cdcc040
rdx    0xc00cde0008
rdi    0xc00cde0008
rsi    0xc00cdcc060
rbp    0xc00cddcee0
rsp    0xc00cddc9e8
r8     0xc00cde0000
r9     0x0
r10    0x0
r11    0x3202
r12    0x0
r13    0x40
r14    0x5
r15    0xaa
rip    0x779964
rflags 0x13256
cs     0x33
fs     0x0
gs     0x0
exit status 2
aregm commented 4 years ago

@cang233 is this issue still actual?