SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/02/2020, 08:42 PM   #1
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 915
Reputation: 89
Default exception 0XC0000005 (ACCESS_VIOLATION)

Hello, i have an urgent problem and i don't know where to put my head in, i looked in every piece of code without finding anything useful that would lead me to the resolution of this problem.

Basically this is happens:

I open samp-server.exe, everything gets loaded correctly, after some time, the console automatically closes and this is what error.log file prints:

Quote:
exception 0XC0000005 (ACCESS_VIOLATION)
This is the server log file:

Quote:
[22:41:20] [debug] Server crashed due to an unknown error
[22:41:53] [debug] Native backtrace:
[22:41:53] [debug] #0 004016eb in ?? () in samp-server.exe
[22:41:53] [debug] #1 5f4f65b3 in ?? () in plugins\mysql.DLL
[22:41:53] [debug] #2 5f4dc487 in ?? () in plugins\mysql.DLL
[22:41:53] [debug] #3 5f4de3d3 in ?? () in plugins\mysql.DLL
[22:41:53] [debug] #4 00469a66 in ?? () in samp-server.exe
[22:41:53] [debug] #5 0048d4db in ?? () in samp-server.exe
[22:41:53] [debug] #6 0049b4a1 in ?? () in samp-server.exe
[22:41:53] [debug] #7 0049b4b1 in ?? () in samp-server.exe
Using MySQL R41-4. This started almost 2 weeks ago, first it was doing it randomly, now it does EVERY TIME i open the console.
Symon is offline   Reply With Quote
Old 27/02/2020, 01:15 PM   #2
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,735
Reputation: 1686
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

EDIT: Any MySQL logs?

Compile with -d3 (or -d2 if you want to keep optimisation (-O1) enabled). That should give more information on what's going on and where precisely. Atleast doesn't seem you have that option enabled right now (seems more like -d1). Howto:
Add this to your script:
Code:
#pragma option -d3
And then recompile.
Or, if you use command line or something similar, run pawncc with option -d3 added to the parameters.

After re-compiling with option d3 (or d2), run the server again. It should now give more detailed information.
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is offline   Reply With Quote
Old 27/02/2020, 04:36 PM   #3
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 915
Reputation: 89
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

MySQL log is clean, no errors. If i try to add that pragram option to the gamemode this is what i get:

Quote:
warning 207: unknown #pragma
error 038: extra characters on line
I'm using sublime text, tried even with pawno.

I also tried adding -d3 to settings.ini but got no extra log.
Symon is offline   Reply With Quote
Old 27/02/2020, 05:05 PM   #4
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,735
Reputation: 1686
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

Try using Zeex's compiler (I thought default pawncc supported it too. Assuming you are using default compiler?)
It doesn't matter what editor you are using, it is pawncc that gives that output.
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is offline   Reply With Quote
Old 27/02/2020, 10:11 PM   #5
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 915
Reputation: 89
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

Ok switched to Zeex's compiler, but i can't find any additional log or info.
Symon is offline   Reply With Quote
Old 28/02/2020, 02:12 AM   #6
SiaReyes
Gangsta
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 618
Reputation: 57
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

Maybe Try using Crashdetect
SiaReyes is offline   Reply With Quote
Old 28/02/2020, 01:04 PM   #7
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 915
Reputation: 89
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

Quote:
Originally Posted by SiaReyes View Post
Maybe Try using Crashdetect
The debug i posted comes from Crash Detect.
Symon is offline   Reply With Quote
Old 28/02/2020, 02:14 PM   #8
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,735
Reputation: 1686
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

Then sorry, I have no clue at all what might be up.
After some searching I saw more people having this issue (and funny enough, me too, but under OnPlayerDisconnect [SSCANF related, the GM itself doesn't have a OnPlayerDisconnect callback yet]) with MySQL.
It might be a pain in the arse but you might want to add console messages after every query or even cache function. Maybe that'll give you something interresting - Are there threaded queries that can take some time (lots of data), causing a crash áfter gamemode initialisation? Does it happen when nobody is online or after someone connected?

Since you're not getting information that is understandable (perhaps for some, but not for most of us) the only way to backtrace it is by debugging basically everything. Good luck D:
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is offline   Reply With Quote
Old 28/02/2020, 03:46 PM   #9
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 915
Reputation: 89
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

Ok, i made this gamemode from scratch and now has more than 33k lines, i'll NOT debug every single query to find the problem becuase it will take months, better to start from 0 again then.

So i made a test:

I started the server with a new nick, registered and got no crash whatsover.

Re-entered with the same nick, server crashed after logging.

So i made a test again, this time using the original nick (Symon). So i closed the server, started (no crash, everything was ok), logged and...crash. So problem 99% should be the login code.

Hard part comes now, since i got ZERO errors while loading player data whatsover and always 0 problems since months (never touched the login code, apart from adding some new things).

So my question is, should i post the login code, starting from login dialog to the load player data function?

EDIT: Found the problem:

pawn Code:
mysql_tquery(g_SQL, selColQuery, "OnLoadCollectibles", "d", playerid);

I was calling OnLoadCollectibles using a threaded query but....OnLoadCollectibles did not exist.

Ok, imma go insult myself, bye.
Symon is offline   Reply With Quote
Old 28/02/2020, 05:00 PM   #10
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,735
Reputation: 1686
Default Re: exception 0XC0000005 (ACCESS_VIOLATION)

Glad to hear you found out what was going on
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde 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
Crash ( Exception 0xC0000005 at 0x4D196D ) GospodinX Scripting Help 1 26/08/2018 03:12 PM
Warning (s007):Exception 0xC0000005 at 0x593C6F dud Client Support 3 28/10/2013 06:15 AM
Help, Exception 0xC0000005 at 0x74DA75 andrew2695 Scripting Help 7 28/10/2012 03:13 PM
Exception 0xC0000005 at 0x4CA013 Hanger Client Support 4 03/05/2012 12:22 AM


All times are GMT. The time now is 02:13 AM.


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