From 85b7ac740b8d3722130498bfd7d1511c5285ad98 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 16 Aug 2005 23:09:55 +0000 Subject: [PATCH] Experimental JIT fixes for linux crashing (no more xchg of esp) --- amxmodx/JIT/amxjitsn.obj | Bin 26592 -> 41118 bytes amxmodx/amx.cpp | 2 +- amxmodx/amxjitsn.asm | 253 +++++++++++++++++++++++---------------- amxmodx/amxmodx.cpp | 17 +++ 4 files changed, 168 insertions(+), 104 deletions(-) diff --git a/amxmodx/JIT/amxjitsn.obj b/amxmodx/JIT/amxjitsn.obj index 53a7237feac0b94081e6cb8abd4759324b1df70b..c84c3006ce1baa34f9539152d941331f7be2c899 100755 GIT binary patch literal 41118 zcmeI5dwdkt{r)Fp2?4`JO(fK)pg{?j2oewqT0*iUf!sGhg20j+B$yl74F;tu29b3E z(W<3N1qCeLv4DV=H3$k`P%73hR;rPrA|j{r%#I-mzwe*lSMuU4?|II1 z&YUxIc4l_Y?tIciI%xK39g>RNn${Si>3{L=(t0fN?}3h*R)VD;@W1?Bg4A2fo)KSC z=q?0HzWn81uW28KX!eY}Ij(6B4C;p?-Ly~D)d&4?V3(c{Eg zuU=+)+-DwFkGQu-b(LbS7_Y61cYYUJ!}jooT{f>4ciNM3R^`|y!nw{E##+=Uqa@`hI_j;yk+xz;s1NX zya>%5<}Hu#*fqWCZ##J2%gOPU_wf8D?u;j+cY!y}=E;cmd?HJc9($f=Vtzr~yzqvd zu{TYd?%c686z%!;-L0MEzn!Dzgx_&;$JTIJ*dhyGH_WqX^N;P=Dm&=gwWAWlT_;B+ z+G;y39XMj-e`^o#7?l(5IyfpvSAGlS;~k#A4|(HH^_@C@=bn4&=N zQ`g%&$L8(jsf+eZi(Fa|?Z}?!pNOpxF}(m4b-(*9*u9C--kcb3uaKX1G%Fb*CGC+D z{rehrh8LjPhTo^7*nLtgP-e%p9B+oUv|>;A-EX_QjIy70cWn4B{NN7-p_OO-UvBM* zR_$mX$n699|HMGP5TjY%c468T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sBlS>H@phJGOrgSV$LS)=n}t}j2%7{qtL6?%OXjIA)Y9k;czovB8`y1!ODUfKLpXZO zM>Wjvi+^5|s%u>6gferc=4TX7$t^Hn;~eJlnA$7T`wYjt`kMNRsw#fc31OJ#PM*oW z;{GdyN4%dPe7(nQK#2Q;uiAMtjyuTeYTOuldTt}`BI6G4Q(IhnFLmPDdwCPr-ba7$-F-C`eN?YyqCAk!3t}uYy4H1eUP{m%JP@J=XHM}J}7XSF>fr)xUh@fx4F4B zE%_CTGI3*5!g+_dyGdBCYOHUH% zisresxW4oL-Y#>uc#Ec2-V5pYQx6~ZDdSs$(i|HejUOh}#?o9 - call ecx + call ebp return_to_caller: cmp dword retval,0 @@ -1906,15 +1952,17 @@ return_to_caller: jmp _return _return_popstack: - add esp,4 ; Correct ESP, because we just come from a - ; runtime error checking routine. + mov esp,ecx ; get our old stack pointer _return: ; store machine state - mov ecx,esp ; get STK into ECX + push ecx + push ecx mov ebp,amx ; get amx into EBP + mov ecx,esi ; get STK into ECX sub ecx,edi ; correct STK mov [ebp+_stk],ecx ; store values in AMX structure: STK, ... + pop ecx ; get orig value mov ecx,hea ; ... HEA, ... mov [ebp+_hea],ecx mov ecx,ebx ; ... and FRM @@ -1924,8 +1972,8 @@ _return: mov [ebp+_alt],edx ; ... and ALT ; return + pop ecx sub stp,edi ; make STP relative to DAT again - xchg esp,esi ; switch back to caller's stack add esp,4*9 ; remove temporary data @@ -1946,12 +1994,8 @@ err_stacklow: jmp _return_popstack _CHKMARGIN_STACK: ; some run-time check routines - cmp esp,stp - lea ebp,[esp-STACKRESERVE] + cmp esi,stp jg err_stacklow - sub ebp,edi - cmp hea,ebp - jg err_stack ret err_heaplow: @@ -1959,7 +2003,7 @@ err_heaplow: jmp _return_popstack _CHKMARGIN_HEAP: - cmp esp,stp + cmp esi,stp jg err_stacklow cmp dword hea,0 jl err_heaplow @@ -1975,7 +2019,7 @@ _VERIFYADDRESS_eax: ; used in load.i, store.i & lidx cmp eax,hea jb veax1 lea ebp,[eax+edi] - cmp ebp,esp + cmp ebp,esi jb err_memaccess veax1: ret @@ -1986,7 +2030,7 @@ _VERIFYADDRESS_edx: ; used in load.i, store.i & lidx cmp edx,hea jb vedx1 lea ebp,[edx+edi] - cmp ebp,esp + cmp ebp,esi jb err_memaccess vedx1: ret @@ -2018,15 +2062,15 @@ JIT_OP_SDIV: JIT_OP_RETN: _POP ebx ; pop frame - _POP ecx ; get return address + add esi,4 ; get rid of the extra parameter from call mov frm,ebx _POP ebp add ebx,edi - add esp,ebp ; remove data from stack + add esi,ebp ; remove data from stack - jmp ecx + ret JIT_OP_MOVS: ;length of block to copy is already in ECX @@ -2092,34 +2136,33 @@ err_divide: jmp _return_popstack JIT_OP_SYSREQ: - mov ecx,esp ; get STK into ECX + push ecx + push esi mov ebp,amx ; get amx into EBP - sub ecx,edi ; correct STK + sub esi,edi ; correct STK mov alt,edx ; save ALT - mov [ebp+_stk],ecx ; store values in AMX structure: STK, - mov ecx,hea ; HEA, + mov [ebp+_stk],esi ; store values in AMX structure: STK, + mov esi,hea ; HEA, mov ebx,frm ; and FRM - mov [ebp+_hea],ecx + mov [ebp+_hea],esi mov [ebp+_frm],ebx lea ebx,pri ; 3rd param: addr. of retval - lea ecx,[esp+4] ; 4th param: parameter array - xchg esp,esi ; switch to caller stack - - push ecx + ;Our original esi is still pushed! push ebx push eax ; 2nd param: function number push ebp ; 1st param: amx call [ebp+_callback] - _DROPARGS 16 ; remove args from stack - - xchg esp,esi ; switch back to AMX stack + _DROPARGS 12 ; remove args from stack + + pop esi + pop ecx cmp eax,AMX_ERR_NONE - jne _return_popstack; return error code, if any - + jne _return_popstack +.continue: mov eax,pri ; get retval into eax (PRI) mov edx,alt ; restore ALT mov ebx,frm ; restore FRM @@ -2128,25 +2171,25 @@ JIT_OP_SYSREQ: JIT_OP_SYSREQ_D: ; (TR) - mov ecx,esp ; get STK into ECX + push ecx + push esi mov ebp,amx ; get amx into EBP - sub ecx,edi ; correct STK + sub esi,edi ; correct STK mov alt,edx ; save ALT - mov [ebp+_stk],ecx ; store values in AMX structure: STK, - mov ecx,hea ; HEA, + mov [ebp+_stk],esi ; store values in AMX structure: STK, + mov esi,hea ; HEA, mov eax,frm ; and FRM - mov [ebp+_hea],ecx + mov [ebp+_hea],esi mov [ebp+_frm],eax ; eax & ecx are invalid by now - lea edx,[esp+4] ; 2nd param: parameter array - xchg esp,esi ; switch to caller stack - push edx + ;esi is still pushed! push ebp ; 1st param: amx call ebx ; direct call _DROPARGS 8 ; remove args from stack - xchg esp,esi ; switch back to AMX stack + + pop ecx mov ebp,amx ; get amx into EBP cmp dword [ebp+_error],AMX_ERR_NONE jne _return_popstack; return error code, if any @@ -2160,25 +2203,27 @@ JIT_OP_SYSREQ_D: ; (TR) JIT_OP_BREAK: %ifdef DEBUGSUPPORT - mov ecx,esp ; get STK into ECX + push ecx + push esi mov ebp,amx ; get amx into EBP - sub ecx,edi ; correct STK + sub esi,edi ; correct STK mov [ebp+_pri],eax ; store values in AMX structure: PRI, mov [ebp+_alt],edx ; ALT, - mov [ebp+_stk],ecx ; STK, - mov ecx,hea ; HEA, + mov [ebp+_stk],esi ; STK, + mov esi,hea ; HEA, mov ebx,frm ; and FRM - mov [ebp+_hea],ecx + mov [ebp+_hea],esi mov [ebp+_frm],ebx ; EBX & ECX are invalid by now ;??? storing CIP is not very useful, because the code changed (during JIT compile) - xchg esp,esi ; switch to caller stack push ebp ; 1st param: amx call [ebp+_debug] _DROPARGS 4 ; remove args from stack - xchg esp,esi ; switch back to AMX stack + + pop esi + pop ecx cmp eax,AMX_ERR_NONE jne _return_popstack; return error code, if any @@ -2194,6 +2239,7 @@ JIT_OP_BREAK: JIT_OP_SWITCH: pop ebp ; pop return address = table address + push ecx mov ecx,[ebp] ; ECX = number of records lea ebp,[ebp+ecx*8+8] ; set pointer _after_ LAST case ;if there are zero cases we should just skip this -- bail @@ -2205,6 +2251,7 @@ JIT_OP_SWITCH: sub ebp,8 ; position to preceding case loop op_switch_loop ; check next case, or fall through op_switch_jump: + pop ecx %ifndef FORCERELOCATABLE jmp [ebp-4] ; jump to the case instructions %else diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 451603b8..21cc7ef8 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -2895,6 +2895,22 @@ static cell AMX_NATIVE_CALL find_plugin_byfile(AMX *amx, cell *params) return -1; } +static cell AMX_NATIVE_CALL int3(AMX *amx, cell *params) +{ +#ifdef DEBUG +#if defined WIN32 + __asm + { + int 3; + }; +#else + asm("int $3"); +#endif //WIN32 +#endif //DEBUG + + return 0; +} + AMX_NATIVE_INFO amxmod_Natives[] = { { "client_cmd", client_cmd }, { "client_print", client_print }, @@ -3062,5 +3078,6 @@ AMX_NATIVE_INFO amxmod_Natives[] = { { "plugin_flags", plugin_flags}, { "lang_phrase", lang_phrase}, { "mkdir", amx_mkdir}, + { "int3", int3}, { NULL, NULL } };