SA-MP Forums Archive
"Invalid memory access" 0.3d - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "Invalid memory access" 0.3d (/showthread.php?tid=300665)



"Invalid memory access" 0.3d - EleMenTalL - 01.12.2011

Hy, i just updated my server on 0.3d, re`compile my GM with the new pwno . no warns/errors

and after 4-5 minutes after server start i get this crash :

Quote:

[16:27:46]: --- Crashdetect v3.6.8 loaded
[16:37:34]: Script[gamemodes/eStar.amx]: During execution of OnPlayerCommandText():
[16:37:34]: Script[gamemodes/eStar.amx]: Run time error 5: "Invalid memory access"
[16:37:34]: Additional information:
[16:37:34]: No details available
[16:37:34]: Call stack (most recent call first):
[16:37:34]: The server has crashed due to an unknown error

Thanks.

p.s i`m using linux host (cent os 5)

plugins: crashdetect.so streamer.so sscanf.so
filterscripts: anti-flood antirconhack HospitalInterior me MidoStream R_Speedov2 DropGun savetuningcar eddress countdown


Re: "Invalid memory access" 0.3d - JernejL - 01.12.2011

can you compile amx file with full debug symbols, to get line of code where it crashed?


Re: "Invalid memory access" 0.3d - EleMenTalL - 01.12.2011

I don`t understand what do you want to say...


Re: "Invalid memory access" 0.3d - Calgon - 01.12.2011

Quote:

What is more interesting is to find how this managed to happen... And you can! Just compile that script with symbolic information (pass -d3 flag to the compiler), you will get this:

Quote:

Setting compiler options via pawno\settings.ini doesn't work for some reason, but you can create a file "pawn.cfg" in pawno directory and specify compiler options there, i.e like in this topic:

https://sampforum.blast.hk/showthread.php?tid=249897

Note that you need -d3

Read the second quote. You need to set your compiler to use the -d3 flag, so symbolic information is included with the AMX which will help trace your crashes.


Re: "Invalid memory access" 0.3d - EleMenTalL - 01.12.2011

New crash reasons :

Quote:

[19:28:50]: --- Crashdetect v3.6.8 loaded
[19:29:08]: Script[gamemodes/eStar.amx]: During execution of OnPlayerStateChange():
[19:29:08]: Script[gamemodes/eStar.amx]: Run time error 4: "Array index out of bounds"
[19:29:08]: Additional information:
[19:29:08]: Array max index is 301 but accessing an element at 307
[19:29:08]: Call stack (most recent call first):
[19:29:08]: public OnPlayerStateChange()
[19:29:31]: Script[gamemodes/eStar.amx]: During execution of OnPlayerDeath():
[19:29:31]: Script[gamemodes/eStar.amx]: Run time error 4: "Array index out of bounds"
[19:29:31]: Additional information:
[19:29:31]: Array max index is 499 but accessing an element at 65535
[19:29:31]: Call stack (most recent call first):
[19:29:31]: public OnPlayerDeath()
[19:29:58]: Script[gamemodes/eStar.amx]: During execution of OnPlayerCommandText():
[19:29:58]: Script[gamemodes/eStar.amx]: Run time error 5: "Invalid memory access"
[19:29:58]: Additional information:
[19:29:58]: No details available
[19:29:58]: Call stack (most recent call first):
[19:29:58]: The server has crashed due to an unknown error




Re: "Invalid memory access" 0.3d - EleMenTalL - 02.12.2011

xml file..


Re: "Invalid memory access" 0.3d - Caupo - 04.04.2014

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 related to that error. Maybe it helps some fellow scripters on the path.