Page 1 of 1

SQLite-lib - crash on exit

Posted: Sat Apr 17, 2004 1:02 pm
by Piotr
This code (SQLite-lib 1.33, SQLite 2.8.13, PB 3.90):

Code: Select all

Result.l
Handle.l
DbIndex.l
i.l
Max.l

OpenConsole()

Print("Number of iterations: ")
ile$ = Input()
Max = Val(ile$)
PrintN("")

If InitSQLite("sqlite.dll")
  ; ok
Else
  PrintN("SQLite Error: Can't open sqlite.dll")       
EndIf

For i = 1 To Max
  PrintN("Test " + Str(i))
  DbIndex = DbIndex + 1
  Handle = SQLiteOpen(DbIndex, "mpia.db")
  If Handle  
    Result = SQLiteGetTable(DbIndex,"SELECT ID_ARTICLE, AUTHOR, TITLE, JOURNAL, YEAR FROM ARTICLE ORDER BY AUTHOR_S")
    SQLiteRemoveData() 
    Result = SQLiteClose(DbIndex) 
  Else
    PrintN("SQLiteOpen Error") 
  EndIf   
Next

CloseConsole()

End
crash if Max > 3 (Windows 98 SE, I try it on Win XP - it's ok):
TEST spowodowa? b??d: nieprawid?owa strona w
module SQLITE.DLL przy 017f:673d4194.
Rejestry:
EAX=00869980 CS=017f EIP=673d4194 EFLGS=00010212
EBX=004044f4 SS=0187 ESP=0063fd80 EBP=0063fda8
ECX=c98af350 DS=0187 ESI=81656028 FS=223f
EDX=00c60080 ES=0187 EDI=8164d309 GS=0000
Bajtów w CS:EIP:
c6 80 de 00 00 00 01 83 c4 f4 50 e8 44 09 01 00
Stos:
004044f4 81656028 8164d309 00000000 004044f4 81656028 8164d309 00530000 00401bd5 00000002 0063fdec 00401bf4 00869980 00530000 c98af350 004015e8
Could anybody give me some help, please?

Piotr

Posted: Sat Apr 17, 2004 1:20 pm
by El_Choni
I'm currently working in the next SQLite lib version. Thanks for reporting this, it'll be fixed too (I hope ;))

Regards,

EDIT: funny, works here. Anyway, I hope this will be fixed since I'm rewriting the lib from scratch (it'll use the same syntax).

Posted: Sat Apr 17, 2004 3:59 pm
by freedimension
Ever thought about writing a stand-alone version (without the dll)? The C-Code lies open and the author allows you to do everything you want with it.
I tried but failed since I'm missing some .h-files (ever heard of winbase.h?). But still I think it's a great idea.

Good luck for the next version though. Need a Beta-Tester? Just call ;-)

Posted: Sat Apr 17, 2004 4:44 pm
by El_Choni
Yes, I guess you can code a lib with the sqlite.dll source and adapt it to PB. If you have the time and the skills, it maybe easy to do it.

Thanks for your offer, I'll need betatesters when I finish it ;)

Regards,

Posted: Sun Apr 18, 2004 2:38 pm
by MisterDr
Sorry but I didn't found sqlite_133 library so can you tell me where to get it?

Posted: Sun Apr 18, 2004 2:58 pm
by El_Choni
You can find it in http://www.purearea.net, in the User libs section. You will also need the sqlite dll, available from http://www.sqlite.org. Just put it in your system directory.

Posted: Mon Apr 19, 2004 7:33 pm
by Piotr
El_Choni wrote: EDIT: funny, works here. Anyway, I hope this will be fixed since I'm rewriting the lib from scratch (it'll use the same syntax).
It's surprising 8O Probably problem depends on data from SQL query. In case of my database query returns all records (580). I've tested it with simple SELECT COUNT(*) FROM ARTICLE and in this case program crashed after 18 iterations. But I am not sure what the problem is, maybe there is something wrong only with Polish Win 98? On Win XP I've run test with Max = 25000 without crash. Anyway, I've recently placed test.exe and data (it's simple bibliographic database) on my private site http://eskimo73.republika.pl/download/test.zip if you want to test it.
El_Choni wrote: I'm currently working in the next SQLite lib version. Thanks for reporting this, it'll be fixed too (I hope ;))
Thanks a lot!

Piotr

Posted: Mon Apr 19, 2004 8:12 pm
by Num3
El_Choni wrote:I'm currently working in the next SQLite lib version. Thanks for reporting this, it'll be fixed too (I hope ;))

Regards,

EDIT: funny, works here. Anyway, I hope this will be fixed since I'm rewriting the lib from scratch (it'll use the same syntax).

Linux support !?!? :twisted:

Posted: Mon Apr 19, 2004 8:26 pm
by El_Choni
I don't have linux, so i can hardly port the lib. Anyway, it only uses HeapAlloc and friends of the Windows API, so it would be probably easy to port.