Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Segfault with bind_param #59

Closed
brinchj opened this issue Nov 7, 2013 · 2 comments
Closed

Segfault with bind_param #59

brinchj opened this issue Nov 7, 2013 · 2 comments

Comments

@brinchj
Copy link

brinchj commented Nov 7, 2013

Hi!
First of all, cool project ;-)

I tried it out (am still new to Rust) and arrived at a segfault. Thought you'd like to know about it if you don't already.

I'm running the master version of both rustsqlite and Rust.

It may just be a transitioning thing (I know Rust is changing and breaking all the time), but it's a bit difficult for me to tell the difference.

Anyway, here's the code:
https://gist.github.com/brinchj/7363049

I tried running the code through valgrind, but it doesn't seem to give me anything useful. Except perhaps that it seems to be telling me that the segfault is in finalize:
==31159== by 0x713477E: sqlite3_finalize (in /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==31159== by 0x5D936C9: cursor::Drop$Cursor::drop::h96b05de1db21bd53ioao::v0.1

If I comment out the bind_param line, the program runs fine. And it only seems to happen with Text. Integer doesn't segfault.

@kud1ing
Copy link
Contributor

kud1ing commented Dec 7, 2013

LLDB says:

error: memory read failed for 0xfffffe00
(lldb) bt
* thread #2: tid = 0x19c84, 0x00000000ffffffff, stop reason = EXC_BAD_ACCESS (code=1, address=0xffffffff)
    frame #0: 0x00000000ffffffff
    frame #1: 0x00007fff97510008 libsqlite3.dylib`sqlite3VdbeDeleteObject + 184
    frame #2: 0x00007fff9750e8a3 libsqlite3.dylib`sqlite3_finalize + 243
    frame #3: 0x000000010000e61e sqlite`cursor::Drop$Cursor::drop::h9766b75c129babbfodaM::v0.1 + 286
    frame #4: 0x0000000100024efd sqlite`cursor..Cursor::glue_drop::h302b9e47dcf88bfeal + 77

kud1ing pushed a commit that referenced this issue Dec 7, 2013
@kud1ing
Copy link
Contributor

kud1ing commented Jan 19, 2014

This is fixed by #61

@kud1ing kud1ing closed this as completed Jan 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants