Your query string is ~ 61 characters (did not count precisely), not including
the key length not the value length. Are you sure the real tests you run do not
overflow the fixed buffer char query[200] which can hold no more than 199
characters? You would have huge problems as soon as
Thanks Olivier Mascia for the tips and suggestion I will definitely try out.
sorry for the code with the double pointer which has raised lot of
confusion I ensured this fault raised is not beacuse of any of my pointer
usage .
I am having a workaround with key/value memory allocation in heap and
o: sqlite-users@mailinglists.sqlite.org
>Subject: [sqlite] segmentation fault in sqlite api call
>
>Hi,
>
>I am a embedded engineer and new to sqlite,we want to use sqlite for
>our
>local storage instead of file i/o.
>
>I have created a table with key and value records of char type,now i
You're passing a char * to a routine that expects a char **, and then
immediately trying to indirect through it, which means it's taking the
text, treating it as a pointer, and passing the random data it's pointing
to as a string to sqlite.
On Sun., 21 Oct. 2018, 11:55 Ratheendran R, wrote:
>
The code you provided declares and defines a pointer, named ‘db’ in main(),
which is used with the SQLite API but never made to point to a valid object in
memory or even to allocated memory. Hence your segmentation fault.
___
sqlite-users mailing
Hi,
mydef_set probably overflows your 'query' variable of which you don't show
declaration but I guess it is 200 bytes seeing your memset(query,0,200);
strcpy(query, ...
This above and why this char** buffer in mydef_set prototype?
Think about what your intent was. Compare to what you did
Hi,
I am a embedded engineer and new to sqlite,we want to use sqlite for our
local storage instead of file i/o.
I have created a table with key and value records of char type,now if I try
store a value with string length more than 50 char I get segmentation
fault,please see the code below and
7 matches
Mail list logo