Comments (6)
Are you using Y_Less's variant of GetAmxBase
or something similar? I once made a JIT-compatible version which reads the function address direcrly from code rather than the stack (I think you remember) but as far as I can see from YSI AMX_GetGlobal
uses the old method.
from samp-plugin-jit.
The only script actually reading/writing using GetAmxBase is SQLitei, which has your JIT compatible version.
I'm still trying to find the point where it stops working in the script.. So far I've found it executes OnScriptInit
in y_masteronce.inc`, but after that I'm unsure.
from samp-plugin-jit.
After rewriting AMX_GetGlobal
it crashed in another place (seems like a problem with return address) and this time I'm not sure where it happens as Visual Studio can't show me the stack trace so this becomes a bit tricky.
static AMX_DoNothing() {
return 0;
}
static AMX_GetGlobal()
{
new
addr = -1;
// Call dummy function and read its (absolute) address from code.
AMX_DoNothing();
#emit LCTRL 6
#emit CONST.alt 12
#emit SUB
#emit LOAD.alt AMX_HEADER_COD
#emit ADD
#emit STOR.S.pri addr
#emit LREF.S.pri addr
// Get difference between absolute and relative addresses.
#emit SUB
#emit CONST.alt AMX_DoNothing
#emit SUB
#emit MOVE.alt
#emit LCTRL 1
#emit XCHG
#emit SUB
// Return
#emit STACK 4
#emit RETN
return 0;
}
from samp-plugin-jit.
Well, y_hooks does alter the addresses in the publics table. Perhaps it could be related to that.
from samp-plugin-jit.
The return address at the time of a crash is 10c18 which is after instruction "call 0x100013CA" EDIT: That call is actually calling jit::JIT::doJump. These instructions are in "0xdeb8" procedure.
You can inspect crash and acquire info as follows, you first need IDA Pro Advanced(the newer -- the better), then you download PAWN-Boilerplate and compile it(of course, include jit plugin). Now you need to open IDA Pro Advanced and load up samp-server.exe into it. Then start samp-server.exe with debugger and wait for exception. When it happens, you have clear view at stack in the window "Stack view". You can know what address is where in generated code if you turn on generating .asm in jit settings(server.cfg).
EDIT 2: It crashes somewhere in YSI's OnScriptInit. It jumps to it successfully.
EDIT 3: It returns from OnScriptInit.
EDIT 4: Found it, 'eax' that was returned from OnScriptInit is invalid. Or it was changed in unpredictable ways. My conclusion is that 'eax' was needed after call but was saved across-function boundary ??? seems so though i am confused :O
EDIT 5: Null pointer dereference(crash) is at 10c1d. Scrap that. It seems that return address is getting overwritten, thus it returns in a section where Unicode text resides.
Suggestion: You better track it yourself the way i described above because you will have all the info you need :)
from samp-plugin-jit.
See #51 for why I think this is happening and my proposed solution (implemented in #52)
from samp-plugin-jit.
Related Issues (20)
- Inconsistency HOT 2
- Crashes HOT 2
- floatlog is slower with jit. HOT 2
- LCTRL 8 / SCTRL 8 - get/set ASM pointer HOT 3
- IsJITPresent returns false in OnJITCompile HOT 4
- `alt` not preserved across SYSREQ.C calls. HOT 3
- sampctl support HOT 3
- crashdetect must be loaded before jit, jit must be loaded before crashdetect HOT 3
- [error]ubuntu 14.04 HOT 7
- AMX_EXEC_CONT (and context switching) support HOT 38
- Centos 7 JIT Crash HOT 1
- JIT bug Debian 9
- JIT crashes with Extended Vehicle Info HOT 1
- JIT Sleep: ExecContHelper tries to jump to null address. HOT 2
- crashed palyers
- package ensure failure for sampctl
- [jit] Compilation was disabled with streamer.dll enabled with jit 2.4.1 and 2.4
- [jit] Compilation was disabled , Problem & .AMX Size problem. HOT 1
- JIT and Crashdetect togetherCrashdetect HOT 1
- Invalid or unsupported instruction HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samp-plugin-jit.