PB 4.60 Invalid access memroy

Just starting out? Need help? Post your questions and find answers here.
Faildeath
User
User
Posts: 18
Joined: Mon Mar 19, 2012 7:49 pm

PB 4.60 Invalid access memroy

Post 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
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 4.60 Invalid access memroy

Post by Fred »

Try to enable the purifier to see if you don't have a memory buffer overflow
Faildeath
User
User
Posts: 18
Joined: Mon Mar 19, 2012 7:49 pm

Re: PB 4.60 Invalid access memroy

Post 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)
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: PB 4.60 Invalid access memroy

Post by Comtois »

Please correct my english
http://purebasic.developpez.com/
User avatar
kenmo
Addict
Addict
Posts: 2032
Joined: Tue Dec 23, 2003 3:54 am

Re: PB 4.60 Invalid access memroy

Post 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...)
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: PB 4.60 Invalid access memroy

Post 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
Please correct my english
http://purebasic.developpez.com/
Faildeath
User
User
Posts: 18
Joined: Mon Mar 19, 2012 7:49 pm

Re: PB 4.60 Invalid access memroy

Post 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
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 4.60 Invalid access memroy

Post 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.
Faildeath
User
User
Posts: 18
Joined: Mon Mar 19, 2012 7:49 pm

Re: PB 4.60 Invalid access memroy

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