SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 20/02/2012, 06:33 PM   #1
Julian12345
Big Clucker
 
Join Date: Mar 2009
Posts: 107
Reputation: 5
Default Invalid memory access

Good evening.

Does somebody know how to fix this annoying run time error? The server crashes twice a day because of this.

Code:
[17:40:53] Incoming connection: *IP*
[17:40:53] [join] *nick* has joined the server (*IP*)
[17:40:53] Script[gamemodes/MyGameMode.amx]: During execution of Itter_OnPlayerConnect():
[17:40:53] Script[gamemodes/MyGameMode.amx]: Run time error 5: "Invalid memory access"
[17:40:53] Error information:
[17:40:53]   No details available
[17:40:53] Call stack (most recent call first):
[17:40:53]   0x0002EEA0 => native CallLocalFunction() from ...
[17:40:53] The server has crashed executing 'gamemodes/MyGameMode.amx'
[17:40:53] Call stack (most recent call first):
[17:40:53]   0x0002EEA0 => native CallLocalFunction() from ...
__________________
Julian12345 is offline   Reply With Quote
Old 21/02/2012, 06:40 PM   #2
Jay.
High-roller
 
Join Date: Nov 2009
Location: UK
Posts: 1,121
Reputation: 44
Default Re: Invalid memory access

Strange, I have had this problem before
but could not fix it.. sorry, I don't know.
Jay. is offline   Reply With Quote
Old 22/02/2012, 12:31 PM   #3
Julian12345
Big Clucker
 
Join Date: Mar 2009
Posts: 107
Reputation: 5
Default AW: Re: Invalid memory access

Quote:
Originally Posted by Jay. View Post
Strange, I have had this problem before
but could not fix it.. sorry, I don't know.


It seems as if nobody knows how to fix this
__________________
Julian12345 is offline   Reply With Quote
Old 22/02/2012, 12:40 PM   #4
Markô
High-roller
 
Markô's Avatar
 
Join Date: Apr 2011
Location: dXJtb20=
Posts: 1,836
Reputation: 512
Default Re: Invalid memory access

http://forum.sa-mp.com/showthread.php?t=300665 <==== this might help you, debug the code if neccessary
Markô is offline   Reply With Quote
Old 22/02/2012, 08:36 PM   #5
Julian12345
Big Clucker
 
Join Date: Mar 2009
Posts: 107
Reputation: 5
Default AW: Re: Invalid memory access

Quote:
Originally Posted by Xtreme_playa View Post
http://forum.sa-mp.com/showthread.php?t=300665 <==== this might help you, debug the code if neccessary
Well thats wasnt really solved there... how to debug? :S
__________________
Julian12345 is offline   Reply With Quote
Old 22/02/2012, 10:06 PM   #6
Guest9328472398472
Guest
 
Posts: n/a
Default Re: Invalid memory access

(1)http://www.******.com/url?sa=t&rct=j...JjsT4dnOn6bDug
(2)http://www.******.com/url?sa=t&rct=j...hsHMExVQ1rdvBg
(3)[OPTIONAL]http://forum.sa-mp.com/showthread.php?t=2751
  Reply With Quote
Old 26/02/2012, 06:01 PM   #7
Julian12345
Big Clucker
 
Join Date: Mar 2009
Posts: 107
Reputation: 5
Default AW: Re: Invalid memory access

Thanks, I added the debug messages.

That didn't help me though, the server still crashes twice a day.

In the OnPlayerConnect callback every debug message was shown in the server log, so everything works fine in OnPlayerConnect, but the server still crashes. >.<
__________________
Julian12345 is offline   Reply With Quote
Old 26/02/2012, 06:05 PM   #8
Guest9328472398472
Guest
 
Posts: n/a
Default Re: AW: Re: Invalid memory access

Quote:
Originally Posted by Julian12345 View Post
Thanks, I added the debug messages.

That didn't help me though, the server still crashes twice a day.

In the OnPlayerConnect callback every debug message was shown in the server log, so everything works fine in OnPlayerConnect, but the server still crashes. >.<
It's probably something with your GM, I can't be too sure.
  Reply With Quote
Old 04/04/2014, 10:29 PM   #9
Caupo
Little Clucker
 
Join Date: Mar 2010
Posts: 35
Reputation: 8
Default Re: Invalid memory access

If anyone still might look into this thread, then I just encountered that error on me and I debugged like a hour or so. Cause I had lots of functions which depended on each other nested in each other and so. And I finally catched the reason why it gives that error.
I had one function where I wanted to return string from one of my functions which also returned string from function. So yeah, returning string from function can cause an issue like this. So yeah to fix this, before you return string, you have to get your string which you want to return, formatted in some string variable, and then you have to return the string variable. (It also might be my own incompetent by not knowing maybe it's written in PAWNs refenrece that you can't do that like this but yeah...)

So yeah maybe it helps someone in the future. Im going to copy and paste that case to other topics too. Maybe it helps some fellow scripters on the path.
Caupo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Invalid memory access" 0.3d EleMenTalL Scripting Help 6 04/04/2014 10:31 PM
"Invalid memory access" 0.3d EleMenTalL Server Support 2 03/12/2011 11:37 PM
Invalid memory access Littl3j0hNy Scripting Help 5 03/12/2011 04:51 PM
Invalid memory access wouter0100 Scripting Help 4 18/09/2011 12:28 AM
Invalid memory access BeCometA Help Archive 2 21/02/2010 08:54 AM


All times are GMT. The time now is 08:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.