GithubHelp home page GithubHelp logo

memory leak using rows.next() about odbc HOT 7 OPEN

zt9 avatar zt9 commented on August 15, 2024
memory leak using rows.next()

from odbc.

Comments (7)

alexbrainman avatar alexbrainman commented on August 15, 2024

I need a reproducible program to investigate this. That also includes all required environment, like database and db driver.

Alex

from odbc.

zt9 avatar zt9 commented on August 15, 2024

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.

from odbc.

alexbrainman avatar alexbrainman commented on August 15, 2024

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

from odbc.

zt9 avatar zt9 commented on August 15, 2024

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/[email protected]/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/[email protected]/column.go:24
github.com/alexbrainman/odbc.(*NonBindableColumn).Value(0xc00008e1c8, 0xc000290800, 0xc)
        C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/[email protected]/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/[email protected]/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 :)

from odbc.

alexbrainman avatar alexbrainman commented on August 15, 2024

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

from odbc.

zt9 avatar zt9 commented on August 15, 2024

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/[email protected]/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/[email protected]/column.go:24
github.com/alexbrainman/odbc.(*NonBindableColumn).Value(0xc000006050, 0xc00009aec0, 0xc)
        C:/Users/Administrator/go/pkg/mod/github.com/alexbrainman/[email protected]/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/[email protected]/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

from odbc.

zt9 avatar zt9 commented on August 15, 2024

Wanted to share a few things with the hopes that someone may be able to identify some clues to the problem.

  • I updated the FileMaker database and the odbc driver to the latest version (FileMaker 19.04) and got identical behavior.
  • It seems like this issue shows when when I query a lot of fields. A lot meaning > 30 fields (maybe). I am not sure if this has to do with a lot of data (ex text) in those fields. I reduced the number of fields I query to 5 or so and it runs without problems.

from odbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.