multitheftauto/amx

Runtime problem

Disinterpreter opened this issue · 8 comments

Describe the bug
I've got a runtime problem in

assert(fp!=NULL);

To reproduce
Build the king.dll and try to start 'amx' resource with it.
It is reproducing with 'debug' and 'release' presets.

Expected behaviour
Must work without error

Screenshots
image
P.S Sorry I don't have Paint right now.

Version
a develop branch

I guess it depends of 50d6dde

@theSpool

Is this when trying to load text files? I noticed that my log files no longer load.

Is this when trying to load text files? I noticed that my log files no longer load.

I'm getting an error when trying to make start amx with latest version of the module. All resources of amx-* is from this repo. I've tried to launch it.

Is this when trying to load text files? I noticed that my log files no longer load.

I'm getting an error when trying to make start amx with latest version of the module. All resources of amx-* is from this repo. I've tried to launch it.

Try this resource temporarily (just to confirm), I believe it's crashing when it executes the fopen native on your script
http://whileago.mov.re/nffiles/images/amx-grandlarc.zip

Is this when trying to load text files? I noticed that my log files no longer load.

I'm getting an error when trying to make start amx with latest version of the module. All resources of amx-* is from this repo. I've tried to launch it.

Try this resource temporarily (just to confirm), I believe it's crashing when it executes the fopen native on your script
http://whileago.mov.re/nffiles/images/amx-grandlarc.zip

It works! Thanks. I think We should update the default resource or edit/make a new issue :)

Check in your script for wrong fread or fgetchar usage (namely the File: parameter being 0):

chars=fgets_cell((FILE*)params[1],cptr,max,1);

iirc in SA-MP the assertion check is removed so it's just an instant crash unlike here.

Check in your script for wrong fread or fgetchar usage (namely the File: parameter being 0):

chars=fgets_cell((FILE*)params[1],cptr,max,1);

iirc in SA-MP the assertion check is removed so it's just an instant crash unlike here.

amx/amx-test/testgm.pwn

Lines 22 to 26 in dd50399

new File:f = fopen("file.txt", io_read);
new buffer[512];
fread(f, buffer, sizeof(buffer));
fclose(f);
printf("%s", buffer);

As I remember this fork https://github.com/Daniel-Cortez/pawn-3.2-plus can handle this crash. You should take a look it.

Look at ptrarray_* functions
https://github.com/Daniel-Cortez/pawn-3.2-plus/blob/master/source/amx/amxfile.c