Open zt9 opened 2 years ago
I need a reproducible program to investigate this. That also includes all required environment, like database and db driver.
Alex
Hi Alex, Thanks for the response, I am happy to share my dev system to you, but it might involve some coordination on specifics. I have emailed you and looking forward to hearing back.
I am happy to share my dev system to you, but it might involve some coordination on specifics.
I am not sure I will be willing to fiddle with other people systems.
But before we get to this point, is it possible for you to provide the smallest but complete program that reproduces your bug? I should be able to build your program. Also, please, run the program on your system, and provide your program output that you see.
Thank you.
Alex
Yes, please see a small example here: https://f002.backblazeb2.com/file/shpublic/alex.example.go
Output of the program as it crashes:
fetched = 1447
fetched = 1448
Exception 0xc0000005 0x0 0x2873d95b004 0x7ffe9d1d20de
PC=0x7ffe9d1d20de
runtime.cgocall(0x2a2860, 0xc00004aae0)
C:/Program Files/Go/src/runtime/cgocall.go:156 +0x4a fp=0xc000063240 sp=0xc000063208 pc=0x243aea
syscall.Syscall6(0x7ffe78c12dd0, 0x6, 0x2871673b820, 0xd, 0x1, 0xc0000633c8, 0x400, 0xc000063398)
C:/Program Files/Go/src/runtime/syscall_windows.go:493 +0xfa fp=0xc000063278 sp=0xc000063240 pc=0x29d8da
syscall.Syscall6(0xc000063348, 0x2887f4, 0x400, 0x0, 0xc0000ec000, 0x3ff, 0x400, 0x0)
<autogenerated>:1 +0x3a fp=0xc0000632e0 sp=0xc000063278 pc=0x2a377a
github.com/alexbrainman/odbc/api.SQLGetData(0x336f13, 0xd, 0x1, 0xc0000633c8, 0xc0002e7090, 0xc000063398)
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/api/zapi_windows.go:138 +0xb3 fp=0xc000063358 sp=0xc0000632e0 pc=0x3077d3
github.com/alexbrainman/odbc.(*BufferLen).GetData(...)
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/column.go:24
github.com/alexbrainman/odbc.(*NonBindableColumn).Value(0xc00008e1c8, 0xc000290800, 0xc)
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/column.go:279 +0xea fp=0xc000063808 sp=0xc000063358 pc=0x309d6a
github.com/alexbrainman/odbc.(*Rows).Next(0xc00008e210, {0xc00012b380, 0x17, 0x0})
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/rows.go:35 +0xff fp=0xc000063848 sp=0xc000063808 pc=0x30d31f
database/sql.(*Rows).nextLocked(0xc00008c180)
C:/Program Files/Go/src/database/sql/sql.go:2967 +0x111 fp=0xc0000638a8 sp=0xc000063848 pc=0x2f4fb1
database/sql.(*Rows).Next.func1()
C:/Program Files/Go/src/database/sql/sql.go:2945 +0x2f fp=0xc0000638d0 sp=0xc0000638a8 pc=0x2f4e6f
database/sql.withLock({0x3659f0, 0xc00008c1b0}, 0xc000063930)
C:/Program Files/Go/src/database/sql/sql.go:3396 +0x8c fp=0xc000063910 sp=0xc0000638d0 pc=0x2f5c4c
database/sql.(*Rows).Next(0xc00008c180)
C:/Program Files/Go/src/database/sql/sql.go:2944 +0x6f fp=0xc000063960 sp=0xc000063910 pc=0x2f4def
main.scrapeContactsTable()
C:/code/alex.example/alex.example.go:133 +0x9c5 fp=0xc000063f68 sp=0xc000063960 pc=0x30f145
main.main()
C:/code/alex.example/alex.example.go:56 +0x25 fp=0xc000063f80 sp=0xc000063f68 pc=0x30e745
runtime.main()
C:/Program Files/Go/src/runtime/proc.go:255 +0x217 fp=0xc000063fe0 sp=0xc000063f80 pc=0x2774d7
runtime.goexit()
C:/Program Files/Go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000063fe8 sp=0xc000063fe0 pc=0x2a0fe1
goroutine 44 [select]:
database/sql.(*DB).connectionOpener(0xc00014c0d0, {0x365fb8, 0xc0005208c0})
C:/Program Files/Go/src/database/sql/sql.go:1196 +0x93
created by database/sql.OpenDB
C:/Program Files/Go/src/database/sql/sql.go:794 +0x188
rax 0x0
rbx 0x16
rcx 0x0
rdi 0x2873d8810b0
rsi 0xe808bff2e8
rbp 0x2873d881a94
rsp 0xe808bff240
r8 0x2873d881a82
r9 0x2873d95b000
r10 0x2873d8815ee
r11 0x2873d95b251
r12 0x2840
r13 0x3ff
r14 0x107
r15 0x7ff
rip 0x7ffe9d1d20de
rflags 0x10287
cs 0x33
fs 0x53
gs 0x2b
C:\code\alex.example>
If you need a system with everything installed on it, I think I can get a VPS and install a sample DB and then provide you access if that helps. Thank you :)
Yes, please see a small example here: https://f002.backblazeb2.com/file/shpublic/alex.example.go
Thank you. But this program
https://play.golang.org/p/qnGNfevTZZz
has bugs. For example, on line 83 you check if sql.Open returns error, but then you proceed with your program as if nothing happened. On line 90 you call db.Ping while db variable is not initialised. And so on and on.
And your program is too long, while I asked for a smallest program.
I don't have time to debug your buggy programs.
Alex
Thanks for looking into this Alex, and I have rewritten the program here: https://play.golang.org/p/8qDCDCV8S5h
The number of vars I can scanning makes the program look big - but otherwise it is a simple program. I've tried my best to remove any bugs and have asked for review from another person before I posted this link.
It runs a few loops and then it exits with the following error.
{ false}
{ false}
{ false}
Exception 0xc0000005 0x0 0x1b6c8e0f004 0x7ffe9d1d20de
PC=0x7ffe9d1d20de
runtime.cgocall(0xcc2720, 0xc00004aae0)
C:/Program Files/Go/src/runtime/cgocall.go:156 +0x4a fp=0xc00008f560 sp=0xc00008f528 pc=0xc63aea
syscall.Syscall6(0x7ffe78c12dd0, 0x6, 0x1b6a1ccb810, 0xd, 0x1, 0xc00008f6e8, 0x400, 0xc00008f6b8)
C:/Program Files/Go/src/runtime/syscall_windows.go:493 +0xfa fp=0xc00008f598 sp=0xc00008f560 pc=0xcbd79a
syscall.Syscall6(0xc00008f668, 0xca86f4, 0x400, 0x0, 0xc00001a000, 0x3ff, 0x400, 0x0)
<autogenerated>:1 +0x3a fp=0xc00008f600 sp=0xc00008f598 pc=0xcc363a
github.com/alexbrainman/odbc/api.SQLGetData(0xd4f76c, 0xd, 0x1, 0xc00008f6e8, 0xc0004a40a8, 0xc00008f6b8)
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/api/zapi_windows.go:138 +0xb3 fp=0xc00008f678 sp=0xc00008f600 pc=0xd20a13
github.com/alexbrainman/odbc.(*BufferLen).GetData(...)
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/column.go:24
github.com/alexbrainman/odbc.(*NonBindableColumn).Value(0xc000006050, 0xc00009aec0, 0xc)
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/column.go:279 +0xea fp=0xc00008fb28 sp=0xc00008f678 pc=0xd24f8a
github.com/alexbrainman/odbc.(*Rows).Next(0xc000006098, {0xc0002e2300, 0x17, 0x0})
C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/rows.go:35 +0xff fp=0xc00008fb68 sp=0xc00008fb28 pc=0xd2853f
database/sql.(*Rows).nextLocked(0xc00007e080)
C:/Program Files/Go/src/database/sql/sql.go:2967 +0x111 fp=0xc00008fbc8 sp=0xc00008fb68 pc=0xd130f1
database/sql.(*Rows).Next.func1()
C:/Program Files/Go/src/database/sql/sql.go:2945 +0x2f fp=0xc00008fbf0 sp=0xc00008fbc8 pc=0xd12faf
database/sql.withLock({0xd7d0d0, 0xc00007e0b0}, 0xc00008fc50)
C:/Program Files/Go/src/database/sql/sql.go:3396 +0x8c fp=0xc00008fc30 sp=0xc00008fbf0 pc=0xd13d8c
database/sql.(*Rows).Next(0xc00007e080)
C:/Program Files/Go/src/database/sql/sql.go:2944 +0x6f fp=0xc00008fc80 sp=0xc00008fc30 pc=0xd12f2f
main.scrapeContactsTable()
C:/code/alex.example/alex.example.2.go:60 +0x432 fp=0xc00008ff68 sp=0xc00008fc80 pc=0xd29dd2
main.main()
C:/code/alex.example/alex.example.2.go:12 +0x25 fp=0xc00008ff80 sp=0xc00008ff68 pc=0xd29965
runtime.main()
C:/Program Files/Go/src/runtime/proc.go:255 +0x217 fp=0xc00008ffe0 sp=0xc00008ff80 pc=0xc973d7
runtime.goexit()
C:/Program Files/Go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00008ffe8 sp=0xc00008ffe0 pc=0xcc0ea1
goroutine 5 [select]:
database/sql.(*DB).connectionOpener(0xc00001c1a0, {0xd7d698, 0xc00005a040})
C:/Program Files/Go/src/database/sql/sql.go:1196 +0x93
created by database/sql.OpenDB
C:/Program Files/Go/src/database/sql/sql.go:794 +0x188
rax 0x0
rbx 0xffffffe6
rcx 0x0
rdi 0x1b6a1af7b80
rsi 0x5fed1ff1c8
rbp 0x1b6a1af8564
rsp 0x5fed1ff120
r8 0x1b6a1af8544
r9 0x1b6c8e0f000
r10 0x1b6a1af8110
r11 0x1b6c8e0f221
r12 0x2840
r13 0x3ff
r14 0x107
r15 0x7ff
rip 0x7ffe9d1d20de
rflags 0x10297
cs 0x33
fs 0x53
gs 0x2b
Wanted to share a few things with the hopes that someone may be able to identify some clues to the problem.
I am connecting to a filemaker database using ODBC. I am closing all the connections and the rows but I randomly get this error and my program crashes. I am accessing a table and trying to extract all the data from it. I have created a loop to keep reading the table over and over again and it crashes randomly at different iterations of row.Next().
I'm running this on a Windows server 2019, golang version 1.17.2. The line 204 that the error originates is
for rows.Next() {
I would be grateful for any recommendations on how I can solve this.