Re: [sqlite] Help: Required help/guidance for the segmentation fault in sqlite3 library to proceed further...

2010-09-24 Thread Richard Hipp
On Fri, Sep 24, 2010 at 9:50 AM, Pavel Ivanov  wrote:

> Apparently you are calling sqlite3_free twice on the same statement
> pointer. Try to add assigning to NULL after freeing and checking for
> NULL before freeing.
>

The second step (checking for NULL before freeing) is unnecessary.  Calling
sqlite3_free() on a NULL pointer is defined to be a safe and harmless no-op.



>
>
> Pavel
>
> On Thu, Sep 23, 2010 at 10:57 AM, Borra, Kishore Babu
>  wrote:
> > Hi,
> >
> > I require some help in getting the fix for some memory corruption issues,
> occurring while using the sqlite3 library. It would be very helpful, if you
> can guide to fix the below issues or atleast provide some info on this, to
> minimize the memory corruption, occurring mostly while sqlite3_free or doing
>  some query.
> >
> > Thanks,
> > Kishore
> >
> > The below backtraces observed for crash are-
> >
> > 1. #0  0x0feb1a98 in raise () from /lib/libc.so.6
> > #1  0x0feb3418 in abort () from /lib/libc.so.6
> > #2  0x0fee847c in __libc_message () from /lib/libc.so.6
> > #3  0x0feef5ec in malloc_printerr () from /lib/libc.so.6
> > #4  0x0fef0244 in free () from /lib/libc.so.6
> > #5  0x0fc1f0d8 in dbi_result_free () from /usr/local/lib/libdbi.so.0
> > #6  0x0fc97d00 in FreeDBIResult (result=0x1037ec88) at dbInterface.c:1008
> > #7  0x1003ebc4 in FillDartInfo (nodeType=975170328, HmpDataLocalCopy=0x2)
> at configMgrPollDartGnrl.c:424
> > #8  0x10037820 in ConfigManagerPollerThread () at configManager.c:490
> > #9  0x0fd35d38 in start_thread () from /lib/libpthread.so.0
> > #10 0x0ff45f44 in clone () from /lib/libc.so.6
> > Backtrace stopped: previous frame inner to this frame (corrupt stack?)
> >
> >
> > 2. *** glibc detected *** agent/.libs/lt-snmpd: corrupted double-linked
> list: 0x08310c18 ***
> > === Backtrace: =
> > /lib/i686/cmov/libc.so.6[0xb7af9624]
> > /lib/i686/cmov/libc.so.6[0xb7afb557]
> > /lib/i686/cmov/libc.so.6(cfree+0x96)[0xb7afb826]
> > /usr/local/lib/libsqlite3.so.0[0xb788a330]
> > /usr/local/lib/libsqlite3.so.0(sqlite3_free+0x69)[0xb78547b9]
> > /usr/local/lib/libsqlite3.so.0[0xb785628a]
> > /usr/local/lib/libsqlite3.so.0[0xb7856539]
> > /usr/local/lib/libsqlite3.so.0[0xb785677c]
> > /usr/local/lib/libsqlite3.so.0[0xb7862613]
> > /usr/local/lib/libsqlite3.so.0[0xb7862648]
> > /usr/local/lib/libsqlite3.so.0[0xb7875a8a]
> > /usr/local/lib/libsqlite3.so.0[0xb7875d24]
> > /usr/local/lib/libsqlite3.so.0[0xb787a22a]
> > /usr/local/lib/libsqlite3.so.0[0xb789c3ba]
> > /usr/local/lib/libsqlite3.so.0(sqlite3_step+0x57)[0xb78907c7]
> > /usr/local/lib/libsqlite3.so.0(sqlite3_exec+0xf7)[0xb7890bd7]
> > /usr/local/lib/libsqlite3.so.0(sqlite3_get_table+0xd8)[0xb7890f68]
> > /usr/local/lib/dbd//libdbdsqlite3.so(dbd_query+0x45)[0xb792b215]
> > /usr/lib/libdbi.so.0(dbi_conn_query+0x4b)[0xb79123fb]
> >
> /home/kishore/prism_N5Dev7.0/Dev7.0/libs/dbInterface/installable/usr/local/lib/libdbInterface.so.1(ExcecuteSelectQuery+0x17f)[0xb793531f]
> > /home/kishore/prism_N5Dev7
> >
> >
> > Sqlite version details are as follows:-
> >
> > Sqlite3 Library using are Sqlite-3.6.23.1
> > Library - libsqlite3.so.0.8.6
> >
> > Using libdbi as wrappers-
> > libdbi drivers - 0.8.2.1 version. On top of sq1lite3.
> > Libdbi -0.8.3 version
> >
> >
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Help: Required help/guidance for the segmentation fault in sqlite3 library to proceed further...

2010-09-24 Thread Dan Kennedy

On Sep 23, 2010, at 9:57 PM, Borra, Kishore Babu wrote:

> Hi,
>
> I require some help in getting the fix for some memory corruption  
> issues, occurring while using the sqlite3 library. It would be very  
> helpful, if you can guide to fix the below issues or atleast provide  
> some info on this, to minimize the memory corruption, occurring  
> mostly while sqlite3_free or doing  some query.

Run your app under valgrind: http://www.valgrind.org/


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Help: Required help/guidance for the segmentation fault in sqlite3 library to proceed further...

2010-09-24 Thread Pavel Ivanov
Apparently you are calling sqlite3_free twice on the same statement
pointer. Try to add assigning to NULL after freeing and checking for
NULL before freeing.


Pavel

On Thu, Sep 23, 2010 at 10:57 AM, Borra, Kishore Babu
 wrote:
> Hi,
>
> I require some help in getting the fix for some memory corruption issues, 
> occurring while using the sqlite3 library. It would be very helpful, if you 
> can guide to fix the below issues or atleast provide some info on this, to 
> minimize the memory corruption, occurring mostly while sqlite3_free or doing  
> some query.
>
> Thanks,
> Kishore
>
> The below backtraces observed for crash are-
>
> 1. #0  0x0feb1a98 in raise () from /lib/libc.so.6
> #1  0x0feb3418 in abort () from /lib/libc.so.6
> #2  0x0fee847c in __libc_message () from /lib/libc.so.6
> #3  0x0feef5ec in malloc_printerr () from /lib/libc.so.6
> #4  0x0fef0244 in free () from /lib/libc.so.6
> #5  0x0fc1f0d8 in dbi_result_free () from /usr/local/lib/libdbi.so.0
> #6  0x0fc97d00 in FreeDBIResult (result=0x1037ec88) at dbInterface.c:1008
> #7  0x1003ebc4 in FillDartInfo (nodeType=975170328, HmpDataLocalCopy=0x2) at 
> configMgrPollDartGnrl.c:424
> #8  0x10037820 in ConfigManagerPollerThread () at configManager.c:490
> #9  0x0fd35d38 in start_thread () from /lib/libpthread.so.0
> #10 0x0ff45f44 in clone () from /lib/libc.so.6
> Backtrace stopped: previous frame inner to this frame (corrupt stack?)
>
>
> 2. *** glibc detected *** agent/.libs/lt-snmpd: corrupted double-linked list: 
> 0x08310c18 ***
> === Backtrace: =
> /lib/i686/cmov/libc.so.6[0xb7af9624]
> /lib/i686/cmov/libc.so.6[0xb7afb557]
> /lib/i686/cmov/libc.so.6(cfree+0x96)[0xb7afb826]
> /usr/local/lib/libsqlite3.so.0[0xb788a330]
> /usr/local/lib/libsqlite3.so.0(sqlite3_free+0x69)[0xb78547b9]
> /usr/local/lib/libsqlite3.so.0[0xb785628a]
> /usr/local/lib/libsqlite3.so.0[0xb7856539]
> /usr/local/lib/libsqlite3.so.0[0xb785677c]
> /usr/local/lib/libsqlite3.so.0[0xb7862613]
> /usr/local/lib/libsqlite3.so.0[0xb7862648]
> /usr/local/lib/libsqlite3.so.0[0xb7875a8a]
> /usr/local/lib/libsqlite3.so.0[0xb7875d24]
> /usr/local/lib/libsqlite3.so.0[0xb787a22a]
> /usr/local/lib/libsqlite3.so.0[0xb789c3ba]
> /usr/local/lib/libsqlite3.so.0(sqlite3_step+0x57)[0xb78907c7]
> /usr/local/lib/libsqlite3.so.0(sqlite3_exec+0xf7)[0xb7890bd7]
> /usr/local/lib/libsqlite3.so.0(sqlite3_get_table+0xd8)[0xb7890f68]
> /usr/local/lib/dbd//libdbdsqlite3.so(dbd_query+0x45)[0xb792b215]
> /usr/lib/libdbi.so.0(dbi_conn_query+0x4b)[0xb79123fb]
> /home/kishore/prism_N5Dev7.0/Dev7.0/libs/dbInterface/installable/usr/local/lib/libdbInterface.so.1(ExcecuteSelectQuery+0x17f)[0xb793531f]
> /home/kishore/prism_N5Dev7
>
>
> Sqlite version details are as follows:-
>
> Sqlite3 Library using are Sqlite-3.6.23.1
> Library - libsqlite3.so.0.8.6
>
> Using libdbi as wrappers-
> libdbi drivers - 0.8.2.1 version. On top of sq1lite3.
> Libdbi -0.8.3 version
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users