kmlebedev / gogfapi

A Go language wrapper around gfapi.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

failed TestReaddir test #3

Closed kmlebedev closed 1 month ago

kmlebedev commented 1 month ago
SIGSEGV: segmentation violation
PC=0x7f8bc127b4d3 m=0 sigcode=1 addr=0x0
signal arrived during cgo execution

goroutine 21 gp=0xc0001121c0 m=0 mp=0x894000 [syscall]:
runtime.cgocall(0x532200, 0xc000060a60)
    /usr/local/go/src/runtime/cgocall.go:167 +0x4b fp=0xc000060a38 sp=0xc000060a00 pc=0x46b3cb
github.com/kmlebedev/gogfapi/gfapi._C2func_glfs_readdirplus(0x2f38588, 0xc000024510)
    _cgo_gotypes.go:643 +0x56 fp=0xc000060a60 sp=0xc000060a38 pc=0x52c2d6
github.com/kmlebedev/gogfapi/gfapi.(*Fd).Readdir.func1(0xc000060af8?, 0xc000024510)
    /home/whitefox/gogfapi/sources-blExtdgG3C/gfapi/fd.go:240 +0x4d fp=0xc000060aa8 sp=0xc000060a60 pc=0x52dfad
github.com/kmlebedev/gogfapi/gfapi.(*Fd).Readdir(0xc000014398, 0x0)
    /home/whitefox/gogfapi/sources-blExtdgG3C/gfapi/fd.go:240 +0xb2 fp=0xc000060d40 sp=0xc000060aa8 pc=0x52dd52
github.com/kmlebedev/gogfapi/gfapi.(*File).Readdir(...)
    /home/whitefox/gogfapi/sources-blExtdgG3C/gfapi/file.go:113
github.com/kmlebedev/gogfapi/gfapi.TestReaddir(0xc000123d40)
    /home/whitefox/gogfapi/sources-blExtdgG3C/gfapi/gfapi_test.go:260 +0x129 fp=0xc000060f70 sp=0xc000060d40 pc=0x529369
testing.tRunner(0xc000123d40, 0x57b7b8)
    /usr/local/go/src/testing/testing.go:1690 +0xf4 fp=0xc000060fc0 sp=0xc000060f70 pc=0x4dbf14
testing.(*T).Run.gowrap1()
    /usr/local/go/src/testing/testing.go:1743 +0x25 fp=0xc000060fe0 sp=0xc000060fc0 pc=0x4dcf05
runtime.goexit({})
    /usr/local/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000060fe8 sp=0xc000060fe0 pc=0x4783a1
created by testing.(*T).Run in goroutine 1
    /usr/local/go/src/testing/testing.go:1743 +0x390

goroutine 1 gp=0xc000006380 m=nil [chan receive]:
runtime.gopark(0x111520?, 0x7f8bc187e1a8?, 0x18?, 0x0?, 0x54f300?)
    /usr/local/go/src/runtime/proc.go:424 +0xce fp=0xc00005f9c8 sp=0xc00005f9a8 pc=0x470a0e
runtime.chanrecv(0xc000100f50, 0xc00005faaf, 0x1)
    /usr/local/go/src/runtime/chan.go:639 +0x41c fp=0xc00005fa40 sp=0xc00005f9c8 pc=0x40a91c
runtime.chanrecv1(0x892d20?, 0x542ae0?)
    /usr/local/go/src/runtime/chan.go:489 +0x12 fp=0xc00005fa68 sp=0xc00005fa40 pc=0x40a4f2
testing.(*T).Run(0xc0001224e0, {0x56fc5a?, 0x0?}, 0x57b7b8)
    /usr/local/go/src/testing/testing.go:1751 +0x3ab fp=0xc00005fb28 sp=0xc00005fa68 pc=0x4dcdab
testing.runTests.func1(0xc0001224e0)
    /usr/local/go/src/testing/testing.go:2168 +0x37 fp=0xc00005fb68 sp=0xc00005fb28 pc=0x4df017
testing.tRunner(0xc0001224e0, 0xc00005fc70)
    /usr/local/go/src/testing/testing.go:1690 +0xf4 fp=0xc00005fbb8 sp=0xc00005fb68 pc=0x4dbf14
testing.runTests(0xc000012030, {0x87b460, 0x11, 0x11}, {0x46f190?, 0x46edfa?, 0x892ec0?})
    /usr/local/go/src/testing/testing.go:2166 +0x43d fp=0xc00005fca0 sp=0xc00005fbb8 pc=0x4deefd
testing.(*M).Run(0xc00010a0a0)
    /usr/local/go/src/testing/testing.go:2034 +0x64a fp=0xc00005fed0 sp=0xc00005fca0 pc=0x4dd92a
main.main()
    _testmain.go:77 +0x9b fp=0xc00005ff50 sp=0xc00005fed0 pc=0x531c3b
runtime.main()
    /usr/local/go/src/runtime/proc.go:272 +0x28b fp=0xc00005ffe0 sp=0xc00005ff50 pc=0x43d42b
runtime.goexit({})
    /usr/local/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00005ffe8 sp=0xc00005ffe0 pc=0x4783a1

goroutine 2 gp=0xc000006e00 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:424 +0xce fp=0xc000048fa8 sp=0xc000048f88 pc=0x470a0e
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:430
runtime.forcegchelper()
    /usr/local/go/src/runtime/proc.go:337 +0xb3 fp=0xc000048fe0 sp=0xc000048fa8 pc=0x43d773
runtime.goexit({})
    /usr/local/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000048fe8 sp=0xc000048fe0 pc=0x4783a1
created by runtime.init.7 in goroutine 1
    /usr/local/go/src/runtime/proc.go:325 +0x1a

goroutine 3 gp=0xc000007340 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:424 +0xce fp=0xc000049780 sp=0xc000049760 pc=0x470a0e
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:430
runtime.bgsweep(0xc000026080)
    /usr/local/go/src/runtime/mgcsweep.go:277 +0x94 fp=0xc0000497c8 sp=0xc000049780 pc=0x425d94
runtime.gcenable.gowrap1()
    /usr/local/go/src/runtime/mgc.go:203 +0x25 fp=0xc0000497e0 sp=0xc0000497c8 pc=0x41a525
runtime.goexit({})
    /usr/local/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000497e8 sp=0xc0000497e0 pc=0x4783a1
created by runtime.gcenable in goroutine 1
    /usr/local/go/src/runtime/mgc.go:203 +0x66

goroutine 4 gp=0xc000007880 m=nil [GC scavenge wait]:
runtime.gopark(0xc000026080?, 0x5a4cf8?, 0x1?, 0x0?, 0xc000007880?)
    /usr/local/go/src/runtime/proc.go:424 +0xce fp=0xc000049f78 sp=0xc000049f58 pc=0x470a0e
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:430
runtime.(*scavengerState).park(0x892f40)
    /usr/local/go/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc000049fa8 sp=0xc000049f78 pc=0x4237c9
runtime.bgscavenge(0xc000026080)
    /usr/local/go/src/runtime/mgcscavenge.go:653 +0x3c fp=0xc000049fc8 sp=0xc000049fa8 pc=0x423d3c
runtime.gcenable.gowrap2()
    /usr/local/go/src/runtime/mgc.go:204 +0x25 fp=0xc000049fe0 sp=0xc000049fc8 pc=0x41a4c5
runtime.goexit({})
    /usr/local/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000049fe8 sp=0xc000049fe0 pc=0x4783a1
created by runtime.gcenable in goroutine 1
    /usr/local/go/src/runtime/mgc.go:204 +0xa5

goroutine 5 gp=0xc000112000 m=nil [finalizer wait]:
runtime.gopark(0xc000048648?, 0x411065?, 0xb0?, 0x1?, 0xc000006380?)
    /usr/local/go/src/runtime/proc.go:424 +0xce fp=0xc000048620 sp=0xc000048600 pc=0x470a0e
runtime.runfinq()
    /usr/local/go/src/runtime/mfinal.go:193 +0x107 fp=0xc0000487e0 sp=0xc000048620 pc=0x4195a7
runtime.goexit({})
    /usr/local/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000487e8 sp=0xc0000487e0 pc=0x4783a1
created by runtime.createfing in goroutine 1
    /usr/local/go/src/runtime/mfinal.go:163 +0x3d

rax    0x2f385e0
rbx    0x2f38588
rcx    0x0
rdx    0x7ffc6d866740
rdi    0x7f8b34004318
rsi    0x7ffc6d866740
rbp    0x7f8b4001ee08
rsp    0x7ffc6d866660
r8     0x0
r9     0x2585028
r10    0x0
r11    0x7
r12    0x2f5fb98
r13    0x4
r14    0x7f8bc18b5888
r15    0x7ffc6d866670
rip    0x7f8bc127b4d3
rflags 0x10202
cs     0x33
fs     0x0
gs     0x0
FAIL    github.com/kmlebedev/gogfapi/gfapi  0.097s
FAIL
kmlebedev commented 1 month ago

The problem was that when opening a directory, the file opening function returned a descriptor in the error location that was not suitable for the directory reading functions.