SQLite-lib - crash on exit

Everything else that doesn't fall into one of the other PB categories.
Piotr
New User
New User
Posts: 8
Joined: Tue Nov 25, 2003 12:37 pm
Location: Poland
Contact:

SQLite-lib - crash on exit

Post 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
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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).
El_Choni
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post 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 ;-)
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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,
El_Choni
MisterDr
User
User
Posts: 41
Joined: Mon Sep 29, 2003 4:14 pm

Post by MisterDr »

Sorry but I didn't found sqlite_133 library so can you tell me where to get it?
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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.
El_Choni
Piotr
New User
New User
Posts: 8
Joined: Tue Nov 25, 2003 12:37 pm
Location: Poland
Contact:

Post 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
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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:
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post 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.
El_Choni
Post Reply