openmultiplayer / open.mp

Open Multiplayer, a multiplayer mod fully backwards compatible with SA-MP
https://open.mp
Mozilla Public License 2.0
453 stars 91 forks source link

The 64-bit server crashes when executing print or printf in the scripts #835

Open FranDevet opened 8 months ago

FranDevet commented 8 months ago

Describe the bug If you run the 'print' or 'printf' function in OnGamemodeInit/OnFilterScriptInit on an open.mp x64 server, the server will immediately shut down. It works correctly on the Win32 server.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'new filterscript'
    
    #define FILTERSCRIPT

include

public OnFilterScriptInit() { print(" "); print(" -----------------------------------"); print(" | My first open.mp filterscript! |"); print(" -----------------------------------"); print(" "); }

public OnFilterScriptExit() { return 1; }



3. Click on 'compile and run omp server x64'
5. See error

**Expected behavior**
The filter script should execute the print function, and the server should not close.

**Screenshots and/or logs**
If applicable, add screenshots and/or log output to help explain your problem.

**Commit hash in master**
[Link](https://github.com/openmultiplayer/open.mp/actions/runs/7483568633)
AmyrAhmady commented 8 months ago

Is your script compiled with a x64 pawn compiler?

FranDevet commented 8 months ago

yes compilerx64.zip

AmyrAhmady commented 7 months ago

Just use the commonly used compilers, aka 32bit versions of them, scripts compiled with 32bit compilers work with omp x64

NexiusTailer commented 7 months ago

Just of curiosity, I compiled my test gamemode with x64 pawn compiler exactly from the archive above, compiled .amx script works good on omp server x64/x32 and even samp server (so, as I understand, x64 compiler generates regular .amx file). My next step was to also add filterscript of the example above, the omp server crashed. Then I compiled the same filterscript with x32 compiler and tested again, it crashed again. Here are the two minidump files:

omp_minidump (x64 compiler).zip omp_minidump (x32 compiler).zip

I'm almost sure they are identical because the compiler (most likely) is not related to the issue itself, it's only about x64 omp server AND the fact that print function is called exactly from filterscript, not gamemode.

NexiusTailer commented 5 months ago

Can confirm the issue is still reproducible on the latest nightly build (6941fee)

omp_minidump.zip

Additional details which may be useful: Crashes on x64 server everytime it starts with a problematic filterscript, but if this filterscript will be loaded after the server started (with loadfs command), there is no crash and all is ok.