It is currently Wed Dec 11, 2019 6:17 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Tue Jul 17, 2007 6:11 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 01, 2004 2:51 am
Posts: 898
Location: Tacoma, WA
Karbon - it'd take me about an hour or two to fix up (read: update horribly old code) my autocomplete routines if you want me to do it.

<Xombie slowly sneaks out of freak's thread>


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jul 17, 2007 6:13 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Just heard back. 5 reports already of the crash with the new memory lib... I asked them to report the contents of the message requester (to see if the heap invalid message is displaying) but no one has said that they saw it. That shouldn't be taken to mean that no one did, people are pretty notorious for not reporting that stuff.

I'll send it to a few people specifically and see if they can tell me if the heap invalid message is shown.

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jul 17, 2007 6:14 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Hey Xombie -- I actually like the API's flexibility in the different styles it supports but I can't use it if it keeps crashing without explanation.

If I can't get this moving in the next couple of days I'll have to switch!

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jul 17, 2007 6:53 pm 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
It could also be that the actual AllocateMemory() is overwritten by some garbage.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jul 17, 2007 7:20 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Just heard back.. The crash happens and does *not* display the heap invalid error, so according to that code you sent it's valid..

Crazy, eh?

See... A few thousand users can break anything! :-)

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 19, 2007 2:00 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5783
Location: Germany
I just realized i made a mistake with the heap validation.
The AllocateMemory() command actually has its separate heap from the one used
by the other PB libraries (which makes sense). So we were testing the wrong one.

Here we go again:
This one tests the heap used for string storage, the one
from AllocateMemory(), and the one for the PB libraries

Code:
Procedure ValidatePBHeap(LineNumber)
  Protected StringHeap, MemoryHeap, InternalHeap
 
  !extrn _PB_Memory_Heap
  !extrn _PB_StringHeap
 
  !mov eax, dword [_PB_MemoryBase]
  !mov [p.v_InternalHeap], eax
  !mov eax, dword [_PB_StringHeap]
  !mov [p.v_StringHeap], eax
  !mov eax, dword [_PB_Memory_Heap]
  !mov [p.v_MemoryHeap], eax   
 
  If HeapValidate_(StringHeap, 0, 0) = 0
    MessageRequester("Error", "String Heap invalid at Line: "+Str(LineNumber))
  EndIf   
  If HeapValidate_(MemoryHeap, 0, 0) = 0
    MessageRequester("Error", "Memory Heap invalid at Line: "+Str(LineNumber))
  EndIf   
  If HeapValidate_(InternalHeap, 0, 0) = 0
    MessageRequester("Error", "Internal Memory Heap invalid at Line: "+Str(LineNumber))
  EndIf
EndProcedure

Macro _validate
  ValidatePBHeap(#PB_Compiler_Line)
EndMacro


Please test it again.

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 19, 2007 2:55 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Got it and just sent it out... I should hear something back in a few hours..

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 19, 2007 4:17 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Wow, sure enough, I can reproduce it on another Windows XP Pro computer here..

Code:
Procedure New_EnumString(StringArray$(1), StringCount)
  *THIS.EnumString = 0
 
  Size = 4 + StringCount * 4
  For i = 0 To StringCount-1
    Size + Len(StringArray$(i)) * 2 + 2
  Next i
 
  _validate ; THIS REPORTS INVALID HEAP AND CRASHES RIGHT AFTER
 
  *StringBuffer.EnumStringBuffer = AllocateMemory(Size)
  If *StringBuffer
    *StringBuffer\RefCount = 1
    *Pointer = *StringBuffer + 4 + StringCount * 4
   
    For i = 0 To StringCount - 1     
      *StringBuffer\Strings[i] = *Pointer
      PokeS(*Pointer, StringArray$(i), -1, #PB_Unicode)
      *Pointer + Len(StringArray$(i)) * 2 + 2
    Next i
   
    _validate
   
    *THIS = AllocateMemory(SizeOf(EnumString))
    If *THIS
      *THIS\Vtbl        = ?IEnumStringVtbl
      *THIS\RefCount    = 1
      *THIS\StringCount = StringCount
      *THIS\Enumerator  = 0
      *THIS\Buffer      = *StringBuffer
    Else
      FreeMemory(*StringBuffer)
    EndIf
  EndIf   
 
  ProcedureReturn *THIS
EndProcedure

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 19, 2007 4:46 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5783
Location: Germany
Atleast a step in the right direction... :)

Now the problem must be somewhere before this line is reached.
Some pointer stuff, PokeS() or other memory access must be going wrong.

You'll just have to throw some _validate lines around the code to find out where.

(I just hope its not in my code :))

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 19, 2007 7:10 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Found it.

Looks like this isn't very unicode friendly.. I'll give it a go at re-writing it.

Code:
Procedure.l AddODBCConnection(Driver$,Attributes$)
  While Right(Attributes$,2)<>";;"
    Attributes$+";"
  Wend
 
  _validate
 
  *LPAttribMem=AllocateMemory(Len(Attributes$)*SizeOf(CHARACTER))
 
  _validate
 
  PokeS(*LPAttribMem,Attributes$,Len(Attributes$))
 
  _validate ; < - INVALID HERE
 
  For l=1 To Len(Attributes$)
    CompilerIf #PB_Compiler_Unicode
    If PeekW(*LPAttribMem + (l-1) * SizeOf(CHARACTER))=Asc(";")
      PokeW(*LPAttribMem + (l-1) * SizeOf(CHARACTER),0)
    EndIf
    CompilerElse
    If PeekB(*LPAttribMem + l -1)=Asc(";")
      PokeB(*LPAttribMem + l -1,0)
    EndIf
    CompilerEndIf
  Next
 
  _validate
 
  result=SQLConfigDataSource_(0,#ODBC_ADD_DSN,Driver$,*LPAttribMem)
 
  FreeMemory(*LPAttribMem)
 
  ProcedureReturn result
 
EndProcedure

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 19, 2007 7:46 pm 
Offline
PureBasic Team
PureBasic Team
User avatar

Joined: Fri Apr 25, 2003 5:21 pm
Posts: 5783
Location: Germany
You are not allocating enough space for *LPAttribMem
PokeS() also writes the ending NULL, so you need (Len(Attributes$)+1)*SizeOf(CHARACTER) bytes of space.

_________________
quidquid Latine dictum sit altum videtur


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 19, 2007 8:52 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Wow! Forest for the trees on that one.

THANK YOU!

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 20, 2007 7:56 am 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
you did not use my latest version :twisted:

http://www.purebasic.fr/english/viewtopic.php?p=197128#197128


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 20, 2007 12:20 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
Yea, I never knew it was updated since you just hit "edit" instead of "reply" :-)

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 30, 2007 1:33 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Jul 14, 2006 8:53 pm
Posts: 654
Location: Malta
is it possible to have diff gadgets with different arrays with autocomplete at the same time?

And how do you add items to list while program is running?

_________________
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 71 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye