Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with gamemode/other plugins #1

Closed
AndreT opened this issue Feb 1, 2012 · 6 comments
Closed

Conflict with gamemode/other plugins #1

AndreT opened this issue Feb 1, 2012 · 6 comments

Comments

@AndreT
Copy link

AndreT commented Feb 1, 2012

Hi.

Thanks for your creation. However I'm having trouble getting the profiler to work for my gamemode, which is quite extensive when it comes to plugin usage and functionality. Then again, I'm sure I'm not the only one with such gamemode who has tried to use profiler plugin. (I am running it locally on Windows)

The plugins that I use are:

  • Streamer plugin 2.6 (doesn't use gdk for callback hooks)
  • MySQL plugin by BlueG R6-2
  • sscanf (not update 2.5, the one before, no gdk dependency?)
  • GVars 1.3
  • CTime library
  • CSTL

Here's what my server.cfg looks like:
echo Executing Server Config... lanmode 0 port 7777 hostname SFSE announce 1 query 1 weburl www.SF-SE.net maxnpc 10 onfoot_rate 40 incar_rate 40 weapon_rate 40 stream_distance 300.0 stream_rate 1000 maxplayers 24 rcon_password whatthefuckisthisshit gamemode0 SFSE plugins profiler streamer mysql sscanf gvar CTime cstl password testsvr profile_gamemode 1 profile_format html call_graph 1

There are 2 lines in the log associated to the profiler:
`[20:04:32] [profiler] Loaded debug info from 'gamemodes\SFSE.amx'
[20:04:32] [profiler] Attached profiler to 'gamemodes\SFSE.amx'``

It crashes instantly after:
[20:04:32] Number of vehicle models: 113

And here is what crashinfo tells me:


SA-MP Server: 0.3d

Exception At Address: 0x0046BB30

Registers:

EAX: 0x00000000 EBX: 0x0012FB18 ECX: 0x004E522D EDX: 0xFFFFFFFF

ESI: 0x03E7EFA0 EDI: 0x004E522D EBP: 0x00000000 ESP: 0x0012FA8C

EFLAGS: 0x00010286

Stack:

+0000: 0x004E522D 0x00000004 0x00000000 0x0046C0A6

+0010: 0x0012FB18 0x0012FAC0 0x03E7EFA0 0x00000000

+0020: 0xFFFFFFFF 0x004E6220 0x0131B270 0x0012FBD4

+0030: 0x004704F0 0x00000FF2 0x00000007 0xFFFFFFFF

+0040: 0x00000000 0x01856F68 0x0012FB64 0x0012FAF8

+0050: 0x727A0269 0x01930000 0x0365C374 0x036618F0

+0060: 0x01856F68 0x0012FB64 0x0012FB24 0x73004B74

+0070: 0x0012FB34 0x00000000 0x0365C328 0x0365C368

+0080: 0x03657990 0x01848D40 0x0046DCC2 0x004E522D

+0090: 0x00000FFF 0x02EA77DC 0x0131B270 0x02F15938

+00A0: 0x0012FB4C 0x0131B270 0x00028804 0x0131B270

+00B0: 0x02F15938 0x00470523 0x0131B270 0x02F15938

+00C0: 0x00000004 0x0012FB68 0x00000000 0x00000000

+00D0: 0x00000100 0x017BDC90 0x0131B270 0x00000000

+00E0: 0x004010B6 0x0131B270 0x02F15960 0x01848D40

+00F0: 0x73011BA2 0x0131B270 0x0000000A 0x0012FC44

+0100: 0x02F15938 0x6FDAE8D4 0x0131B270 0x02E7EFA0

+0110: 0x02D84684 0x0012FBE8 0x017BDCB0 0x6FDAE8E0

+0120: 0x0131B270 0x02E7EFA0 0x02D84684 0x0193F7B8

+0130: 0x02E7EFA0 0x0189FB08 0x004704F0 0x0012FC10

@Zeex
Copy link
Owner

Zeex commented Feb 2, 2012

From what I see in the crash log it is not related to profiler at all - the server crashed inside format(), perhaps due to wrong format specifier. Try running crashdetect to be sure.

@AndreT
Copy link
Author

AndreT commented Feb 2, 2012

Thanks for the feedback, I ran it with crashdetect enabled.

[debug] Backtrace (most recent call first): [debug] #0 native format() from samp-server.exe [debug] #1 Debug(DEBUG_TYPE=3, fstring[]=@0x00028618 "OnHousesLoad(%d, %d, %d)") at SFSE_functions.pwn:3346 [debug] #2 public OnHousesLoad(query_ex[]=@0x00000003 "", index=165400, extraid=619200, connectionHandle=619204) at SFSE_houses.pwn:79

This is the result of Y_Less' combination of yours and his format code using #emit. Nothing there has changed, and using the code without the profiler plugin works perfectly.

But I could get some cool information by disabling my custom debug function.

@Zeex
Copy link
Owner

Zeex commented Feb 3, 2012

Does this function crash in empty script? Or is it specific to OnHousesLoad? What happens when you comment it out?

@AndreT
Copy link
Author

AndreT commented Feb 3, 2012

I have edited the bare gamemode a little to replicate the crash. Here it is: http://pastebin.com/ML88WzB6

It happens when a string parameter is passed to the Debug function! I hope you can work out the problem :)

@Zeex
Copy link
Owner

Zeex commented Feb 4, 2012

Change

        #emit LOAD.I
        #emit PUSH.pri
        arg_end -= BYTES_PER_CELL;
        #emit LOAD.S.pri      arg_end

to

        #emit LREF.S.pri arg_end
        #emit PUSH.pri
        arg_end -= BYTES_PER_CELL;

in the do-while loop.

@AndreT
Copy link
Author

AndreT commented Feb 4, 2012

Thank you, this made it work perfectly! If you have the time, could you explain the difference to me a little. And does this mean that anyone using Y_Less' code would need to change that?

Also, another small question: Since my server crashes when being gmx-ed on linux (CentOS distro), I saw this in my error log:

    [12:00:44] [debug] Run time error 4: "Array index out of bounds"
    [12:00:44] [debug]   Accessing element at negative index -1
    [12:00:44] [debug] Backtrace (most recent call first):
    [12:00:44] [debug] #0  public Streamer_OnPlayerDisconnect(playerid=4, reason=1) at SFSE.pwn:822
    [12:00:44] [debug] #1  native CallLocalFunction() from samp-server.exe
    [12:00:44] [debug] #2  public Streamer_OnPlayerDisconnect(playerid=4, reason=1) at SFSE.pwn:822

I had a look around in Streamer_OnPlayerDisconnect and a few other sections, but cannot find anything related. Should I contact the plugin author about the issue or is there something simpler on my hands?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants