Page 1 of 1

PB 4.60 Invalid access memroy

Posted: Wed Apr 11, 2012 9:57 pm
by Faildeath
I've been having more and more crash on the IDE with invalid acces memeory for
basic PB commands, I don't understnd where is the problem coming from.

the last 3 I had (within an hour) were on these commands :
- EndProcedure
- SetGadgetState(#ListIconDL, n) : Delay(150)
- If OpenWindow(#Window_Validity, DesktopWidth(0)*nb_bureau+DesktopWidth(0)*0.02, DesktopHeight(0)*0.15, ImageWidth(#Img_Valid), ImageHeight(#Img_Valid), "Validity", #PB_Window_Tool|#PB_Window_BorderLess|#PB_Window_Invisible)

Do I have to wipe PB and make a clean install again?
Can a lot of lib generate this kind of problems?

Also lately I've been having a few "not initialised" bugs generaly all with the same procedure :

Code: Select all

Procedure SetImageWin(*ipara.metre)
	nb_bureau = ExamineDesktops() - 1
	CatchImage(#Img_Valid, ?ValidID) : ValID = ImageID(#Img_Valid)
	CatchImage(#Img_Invalid, ?InvalidID) : InvalID = ImageID(#Img_Invalid)
	If OpenWindow(#Window_Validity, DesktopWidth(0)*nb_bureau+DesktopWidth(0)*0.02, DesktopHeight(0)*0.15, ImageWidth(#Img_Valid), ImageHeight(#Img_Valid), "Validity", #PB_Window_Tool|#PB_Window_BorderLess|#PB_Window_Invisible)
		If CountGadgetItems(#ListIconDL) = *ipara\index + 1

			If *ipara.metre\ValidID = 1 : SetImage(WindowID(#Window_Validity), ValID)
			ElseIf *ipara.metre\ValidID = 0 : SetImage(WindowID(#Window_Validity), InvalID)
			EndIf
			
			HideWindow(#Window_Validity, 0) : StickyWindow(#Window_Validity, 1)
			Delay(750)
			CloseWindow(#Window_Validity)
		EndIf
	EndIf
	ClearStructure(*ipara, metre)
	FreeMemory(*ipara)
EndProcedure
Any help would be greatly apreciated

Re: PB 4.60 Invalid access memroy

Posted: Wed Apr 11, 2012 11:30 pm
by Fred
Try to enable the purifier to see if you don't have a memory buffer overflow

Re: PB 4.60 Invalid access memroy

Posted: Thu Apr 12, 2012 7:55 pm
by Faildeath
How do I see if I have a memory overflow with the purifier? (Never used it and don't see anything more happening)

Re: PB 4.60 Invalid access memroy

Posted: Thu Apr 12, 2012 9:48 pm
by Comtois

Re: PB 4.60 Invalid access memroy

Posted: Fri Apr 13, 2012 12:13 am
by kenmo
An official blog post about the Purifier tool... http://www.purebasic.fr/blog/?p=237

(I thought there was another longer post about investigating IMA errors, either on that site or here, but I can't find it...)

Re: PB 4.60 Invalid access memroy

Posted: Fri Apr 13, 2012 6:00 am
by Comtois
kenmo wrote:An official blog post about the Purifier tool... http://www.purebasic.fr/blog/?p=237
Great, i didn't remember this one.

(I thought there was another longer post about investigating IMA errors, either on that site or here, but I can't find it...)

May be this ?
http://www.purebasic.fr/blog/?m=200810
http://www.purebasic.fr/blog/?m=200811

Re: PB 4.60 Invalid access memroy

Posted: Fri Apr 13, 2012 11:05 am
by Faildeath
Is it normal to have only this showing when I tested this code from the PB blog with
the purifier checked?
I don't see anything showing an error :?

ImageUploaded at ImageFra.me

Re: PB 4.60 Invalid access memroy

Posted: Fri Apr 13, 2012 1:43 pm
by Fred
Did you enabled the purifier in the 'compiler options' second tabs 'Execute/Run' ? Debugger has to be ON as well. Here it does raise an error.

Re: PB 4.60 Invalid access memroy

Posted: Fri Apr 13, 2012 2:47 pm
by Faildeath
Yeah, wasn't check in there, strange.
Anyway, now it works, thanks :)

Gonna check my app like that I'll see if there is a problem.