[sqlite] [Sqlite3] segfault in sqlite3_step()

2015-12-02 Thread Hick Gunter
You give no indication of the schema you are using or the statement that went 
wrong.

If you can reproduce the error using the sqlite3 shell, then it is probably 
within sqlite3. If not, then it is most probably your own program which is 
causing the fault, maybe by passing incorrect (stale or dangling) pointers to 
the prepare, bind or step interfaces.

-Original Message-
From: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of ???
Sent: Dienstag, 01. Dezember 2015 01:29
To: sqlite-users at mailinglists.sqlite.org
Subject: [sqlite] [Sqlite3] segfault in sqlite3_step()

hi.

My program received signal SIGSEGV during performed to sqlite_step().

It was occurs only one time still.. but I should know cause. so I need help 
you. please.



*Code:*

*// Already prepared statement using sqlite3_prepare_v2(db, QUERY, -1, , 
NULL).*

*{*

*sqlite3  *db;*

*sqlite3_stmt *stmt;*

*...*

*RETRY:*

*   sqlite3_reset(stmt);*

*   sqlite3_bind_int(stmt, 1, dir);*

*   while((ret = sqlite3_step(stmt)) == SQLITE_ROW)*

*   {*

* id = sqlite3_column_int(stmt, 0);*

* name = (char*)sqlite3_column_text(stmt, 1);*

* ...*

*   }*


*   if(ret == SQLITE_BUSY)*

*   {*

* msleep(50);*

* goto RETRY;*

*   }*

*   else if( ret != SQLITE_DONE)*

*   {*

* sqlite3_errcode(db);*

* goto ERROR;*

*   }*


*   sqlite3_reset(stmt);*

*   return SUCCESS;*

*ERROR:*

*   sqlite3_reset(stmt);*

*   return FAILURE;*

*}*



It was debugging result..

line "while((ret = sqlite3_step(stmt)) == SQLITE_ROW)"



and sqlite3 library debugging result..

$ addr2line -e libsqlite3.so.0 0x5b81a

./sqlite3.c:64118

line " while( (rc = sqlite3Step(v))==SQLITE_SCHEMA

 && cnt++ < SQLITE_MAX_SCHEMA_RETRY

 && (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK )"



sqlite3 version is 3.7.13.



I think perhaps..

By some reason was error code returns in sqlite3_step()

and then sqlite3_reset() is returning an invalid pointer.

But I don't know why received signal SIGSEGV.



In any case I want to know what occurs segfault in sqlite3_step().

help me, please.



thank you.
___
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.




[sqlite] [Sqlite3] segfault in sqlite3_step()

2015-12-01 Thread 김수민
hi.

My program received signal SIGSEGV during performed to sqlite_step().

It was occurs only one time still.. but I should know cause. so I need help
you. please.



*Code:*

*// Already prepared statement using sqlite3_prepare_v2(db, QUERY, -1,
, NULL).*

*{*

*sqlite3  *db;*

*sqlite3_stmt *stmt;*

*...*

*RETRY:*

*   sqlite3_reset(stmt);*

*   sqlite3_bind_int(stmt, 1, dir);*

*   while((ret = sqlite3_step(stmt)) == SQLITE_ROW)*

*   {*

* id = sqlite3_column_int(stmt, 0);*

* name = (char*)sqlite3_column_text(stmt, 1);*

* ...*

*   }*


*   if(ret == SQLITE_BUSY)*

*   {*

* msleep(50);*

* goto RETRY;*

*   }*

*   else if( ret != SQLITE_DONE)*

*   {*

* sqlite3_errcode(db);*

* goto ERROR;*

*   }*


*   sqlite3_reset(stmt);*

*   return SUCCESS;*

*ERROR:*

*   sqlite3_reset(stmt);*

*   return FAILURE;*

*}*



It was debugging result..

line "while((ret = sqlite3_step(stmt)) == SQLITE_ROW)"



and sqlite3 library debugging result..

$ addr2line -e libsqlite3.so.0 0x5b81a

./sqlite3.c:64118

line " while( (rc = sqlite3Step(v))==SQLITE_SCHEMA

 && cnt++ < SQLITE_MAX_SCHEMA_RETRY

 && (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK )"



sqlite3 version is 3.7.13.



I think perhaps..

By some reason was error code returns in sqlite3_step()

and then sqlite3_reset() is returning an invalid pointer.

But I don't know why received signal SIGSEGV.



In any case I want to know what occurs segfault in sqlite3_step().

help me, please.



thank you.


[sqlite] [Sqlite3] segfault in sqlite3_step()

2015-11-25 Thread 김수민
hi.

My program received signal SIGSEGV during performed to sqlite_step().

It was occurs only one time still.. but I should know cause. so I need help
you. please.



*Code:*

*// Already prepared statement using sqlite3_prepare_v2(db, QUERY, -1,
, NULL).*

*{*

*sqlite3  *db;*

*sqlite3_stmt *stmt;*

*...*

*RETRY:*

*   sqlite3_reset(stmt);*

*   sqlite3_bind_int(stmt, 1, dir);*

*   while((ret = sqlite3_step(stmt)) == SQLITE_ROW)*

*   {*

* id = sqlite3_column_int(stmt, 0);*

* name = (char*)sqlite3_column_text(stmt, 1);*

* ...*

* found++;*

*   }*

*   if(ret == SQLITE_BUSY && !found)*

*   {*

* msleep(50);*

* goto RETRY;*

*   }*

*   else if( ret != SQLITE_DONE && ret != SQLITE_ROW)*

*   {*

* sqlite3_errcode(db);*

* goto ERROR;*

*   }*

*   sqlite3_reset(stmt);*

*   return SUCCESS;*

*ERROR:*

*   sqlite3_reset(stmt);*

*   return FAILURE;*

*}*



It was debugging result..

line "while((ret = sqlite3_step(stmt)) == SQLITE_ROW)"



and sqlite3 library debugging result..

$ addr2line -e libsqlite3.so.0 0x5b81a

./sqlite3.c:64118

line " while( (rc = sqlite3Step(v))==SQLITE_SCHEMA

 && cnt++ < SQLITE_MAX_SCHEMA_RETRY

 && (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK )"



sqlite3 version is 3.7.13.



I think perhaps..

By some reason was error code returns in sqlite3_step()

and then sqlite3_reset() is returning an invalid pointer.

But I don't know why received signal SIGSEGV.



In any case I want to know what occurs segfault in sqlite3_step().

help me, please.



thank you.


[sqlite] [Sqlite3] segfault in sqlite3_step()

2015-11-25 Thread Igor Tandetnik
On 11/25/2015 4:26 AM, ??? wrote:
> My program received signal SIGSEGV during performed to sqlite_step().

The most likely cause is, your application corrupts the heap elsewhere 
(possibly much earlier and in a seemingly unrelated part), and 
sqlite_step just happens to be the first to hit the corrupted data 
structures when it tries to allocate memory. Heap corruption is nasty 
this way.
-- 
Igor Tandetnik