YSI-Includes icon indicating copy to clipboard operation
YSI-Includes copied to clipboard

Crash

Open FilPix opened this issue 7 years ago • 12 comments

Hello. Faced a problem:

[02:49:44] [debug] Run time error 5: "Invalid memory access"
[02:49:44] [debug] AMX backtrace:
[02:49:44] [debug] #0 0000ef1c in ?? (... <1073741823 arguments>) at c:\server\pawno\include\YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[02:49:44] [debug] #1 0000f714 in public OnPlayerClickPlayerTextDraw (... <2 arguments>) at c:\server\pawno\include\YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:31

What is the problem? (Sorry for my English)

FilPix avatar Jan 02 '18 13:01 FilPix

Hi!

Do you have OnPlayerClickPlayerTextDraw in your code? Or you don't have it at all and crash happens either way?

Misiur avatar Jan 02 '18 14:01 Misiur

Of course.

After updating the library, the compiler began to generate errors, which is longer name public than 31 characters. In all the files I did this: OnPRClickPlayerTextDraw(playerid, PlayerText:playertextid) And above is registered DEFINE_HOOK_REPLACEMENT(Player, PR);

FilPix avatar Jan 02 '18 14:01 FilPix

The default shortening for textdraw functions is TD, try using OnPlayerClickPlayerTD

Southclaws avatar Jan 02 '18 14:01 Southclaws

I registered the replacement of TextDraw with TD, but I got an error that "@_yHTextDraw" already defined

Sorry, never worked with YSI :)

UPD: Compiled, wait please.

FilPix avatar Jan 02 '18 15:01 FilPix

No worries. Registered as in added your own DEFINE_HOOK_REPLACEMENT(TextDraw, TD);? You don't have to register the replacement, it's one of ours "built-in" replacements: https://github.com/Misiur/YSI-Includes/blob/e9cf7a1e4154517f2b06cbd36efd0742c2cc3408/YSI_Coding/y_hooks/impl.inc#L117-L125

Misiur avatar Jan 02 '18 15:01 Misiur

Thank you, I understand you.

Now there was another crash

[00:52:03] [debug] AMX backtrace:
[00:52:03] [debug] #0 00000005 in OnPlayerConnect (playerid=6, ... <1073741822 arguments>) at <unknown file>:0
[00:52:03] [debug] #1 00016294 in public OnPlayerConnect () at c:\server\pawno\include\YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:115

FilPix avatar Jan 02 '18 16:01 FilPix

Hm, I've got check this as there's a new report in #264 similar to yours. Does this crash happen on a linux host as well? If so, does it work normally on a windows host?

Misiur avatar Jan 04 '18 18:01 Misiur

Yes, most likely

UPD: This crash appears during a large influx of people on the server...

FilPix avatar Jan 05 '18 18:01 FilPix

I'm testing this on Ubuntu VM, and could not reproduce so far (but my code is a sterile load test sample, not a normal complex gamemode). I have to ask you some more info:

  1. Are you running the code on CentOS? If so, which version?
  2. How did you obtain YSI? From releases, via sampctl, or via git?
  3. How did you obtain amx_assembly? Methods as above
  4. Which compiler are you using? Standard bundled with samp server, russian one, or latest Zeex's?
  5. Do you use some nonstandard flags, such as -d3 or -O2?
  6. Do you use JIT plugin?

I really want to find what can cause this, and this will help me to do so. Thank you

Misiur avatar Jan 07 '18 15:01 Misiur

  1. Ubuntu 16.04
  2. Download from your github.
  3. Download from github.
  4. Zeex, not the last because the mod does not perceive the last not last.
  5. -d3.
  6. No.

FilPix avatar Jan 08 '18 20:01 FilPix

Sorry for ambiguity: By github you mean downloaded .tar.gz/.zip from releases page, or pulled directly using git? That is important as I haven't updated the release package and there were some major updates since then.

Misiur avatar Jan 08 '18 20:01 Misiur

I came here: https://github.com/Misiur/YSI-Includes Clicked on Clone or download

FilPix avatar Jan 08 '18 21:01 FilPix