Reading .dmp files?

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Reading .dmp files?

Post by Snocks »

Hey. I am having trouble with crashes. How can I get the information about what script is causing this from the .dmp file created?
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Reading .dmp files?

Post by CWO »

You can't. Only POL developers can read .dmp files. The POL.log file will list where it was and in what script when it crashed. If you have ecompile generate listings (it'll create a .lst file for every script you compile), open the .lst file in a text editor. POL.log lists the location in your script as "PC: ###". Look for the line beginning with that number and it'll show you the source code it was on.

The biggest thing to get your problem fixed is to go to the bug reports forum and make a post attaching the .dmp file.
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

CWO wrote:You can't. Only POL developers can read .dmp files. The POL.log file will list where it was and in what script when it crashed. If you have ecompile generate listings (it'll create a .lst file for every script you compile), open the .lst file in a text editor. POL.log lists the location in your script as "PC: ###". Look for the line beginning with that number and it'll show you the source code it was on.

The biggest thing to get your problem fixed is to go to the bug reports forum and make a post attaching the .dmp file.

my pol.log shows this

Code: Select all

[03/16 21:21:48] Client#2022 (173.17.79.136): disconnected (account XXXX)
[03/16 21:22:00] Unhandled Exception! Writing Minidump file.
Could this be caused by faulty hardware? I know my hardware is faulty and I got a replacement server on its way.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Reading .dmp files?

Post by CWO »

Does it say anything after the lines you posted? The lines just after that are usually when it posts the info. Crashes can be from faulty hardware but they can still be things within POL itself too. Make a post on the bug reports forum and attach the dmp file. The POL developers can then see it and try to find out what happened.
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

CWO wrote:Does it say anything after the lines you posted? The lines just after that are usually when it posts the info. Crashes can be from faulty hardware but they can still be things within POL itself too. Make a post on the bug reports forum and attach the dmp file. The POL developers can then see it and try to find out what happened.

Code: Select all

[03/16 21:22:00] Unhandled Exception! Writing Minidump file. 
This file should be given to the development team.
Saved dump file to 'POL095-2003-07-05-20090315213136-0.dmp'
That is all it sais. I do hope it's a hardware error, because I know my hardware (most likely ram or motherboard) is faulty. The computer freezes if u bump into it, and I've had windows crashes when it goes over 512 mb ram usage.

And for the bug report, im using a really old core (095) so I doubt they would be interested.
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Re: Reading .dmp files?

Post by MuadDib »

over 512..... sounds like a bad memory stick in the pc. Might look at a new one from a old pc, or new from store, or from a flea market or some such (so as not to spend a lot on it)
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

MuadDib wrote:over 512..... sounds like a bad memory stick in the pc. Might look at a new one from a old pc, or new from store, or from a flea market or some such (so as not to spend a lot on it)

Yeah, but its not always over 512. So it seems its not a whole stick that is broken. If I stress test it I gone to 700 mb without problem. But it seems that when it has been running awhile and gets close to 512 mb it starts to crash.

Also got a runaway script, can that cause stuff like this? Last I checked it had 80000 cycles.

It is always the same error I posted above. And also, someone have always selected a character or logged off within 1 minute before that error occurs.

EDIT: One of my players found it out. Apparently it had crashed twice when a rockthrower threw a rock at him. And I could recreate it, so I fixed it :)
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Reading .dmp files?

Post by CWO »

when a script runs away it gives the script name and the PC. Using the same procedure I described above with looking at the .lst file, you'll find where the script it. It will not cause a crash but it means a script is running a lot of instructions without a rest which can cause lag. Generally its caused by a loop that doesn't have a sleep in it. A general rule in scripting is to have a script that runs a lot of instructions sleep at regular rate unless its truly time critical. Inserting a few sleepms(10); in there or if its within a loop, just one within the loop will stop that.
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

CWO wrote:when a script runs away it gives the script name and the PC. Using the same procedure I described above with looking at the .lst file, you'll find where the script it. It will not cause a crash but it means a script is running a lot of instructions without a rest which can cause lag. Generally its caused by a loop that doesn't have a sleep in it. A general rule in scripting is to have a script that runs a lot of instructions sleep at regular rate unless its truly time critical. Inserting a few sleepms(10); in there or if its within a loop, just one within the loop will stop that.
Yeah, it is my online script. And with 110+ players online, every time anyone does .online it will go thru all online characters and get their location and such. Might be why ? Since people access that like all the time. Since I do not really have much more loops in there.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Reading .dmp files?

Post by CWO »

What I would do in that type of list is put in a SendSysMessage(who, "Creating list..."); as the first line to tell them that the command has worked (then they won't be tempted to do it again while waiting) then put sleepms(10); inside the foreach loop. With 110 players it will take about 1 second longer for it to load because of the sleeps. But its not a time critical script so it doesn't matter if it takes a little longer. The benefit is that your server will be able to load it much easier because you're controlling the pace.
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm

Re: Reading .dmp files?

Post by *Edwards »

Second option:

Add these lines at the beginning of your command

Code: Select all

if( GetObjProperty( mobile, ''#TimerName'' ) ­> ReadGameClock() )
      SendSysMessage( mobile, ''You must wait before using this command again.'' );
      SendSysMessage( mobile, ''Cancelled.'' );
      return 0;
else
      SetObjProperty( mobile, ''#TimerName'', ReadGameClock() + 10 );
endif

http://docs.polserver.com/pol098/guides ... criptguide
If your scripts go runaway like this, it means something is wrong. If you have to perform very long loops, you should add some sleeps. Let me repeat, there is never a good reason to let scripts go runaway. Ever. And increasing the runaway treshold is just ignoring the problem, not fixing it ;)
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

CWO wrote:What I would do in that type of list is put in a SendSysMessage(who, "Creating list..."); as the first line to tell them that the command has worked (then they won't be tempted to do it again while waiting) then put sleepms(10); inside the foreach loop. With 110 players it will take about 1 second longer for it to load because of the sleeps. But its not a time critical script so it doesn't matter if it takes a little longer. The benefit is that your server will be able to load it much easier because you're controlling the pace.
Well, I kinda want it instant :p Will the server crash or become unstable due to this? :p

*Edwards wrote:Second option:

Add these lines at the beginning of your command

Code: Select all

if( GetObjProperty( mobile, ''#TimerName'' ) ­> ReadGameClock() )
      SendSysMessage( mobile, ''You must wait before using this command again.'' );
      SendSysMessage( mobile, ''Cancelled.'' );
      return 0;
else
      SetObjProperty( mobile, ''#TimerName'', ReadGameClock() + 10 );
endif

http://docs.polserver.com/pol098/guides ... criptguide
If your scripts go runaway like this, it means something is wrong. If you have to perform very long loops, you should add some sleeps. Let me repeat, there is never a good reason to let scripts go runaway. Ever. And increasing the runaway treshold is just ignoring the problem, not fixing it ;)
The problem isn't people spamming the cmd, it's that the loop itself is running alot I guess.
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm

Re: Reading .dmp files?

Post by *Edwards »

If you want you can share the command here and we would tell you what could be optimized if the command is the problem. You can PM me also.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Reading .dmp files?

Post by CWO »

Having no sleeps won't cause crashes but with 100+ people online, if you're running something that would be hard on your server like a monster bash or some other event with a lot of people and a lot of action and suddenly maybe a few decide to use the command for their own reasons, that can generate a noticeable lag spike.

Runaways are reported because there's no such thing as infinite computer resources. Efficiency and picking and choosing what should be done immediately and what can take a second more is essential to keeping script generated lag at a minimum. You can't have everything run and be done immediately. So you have to choose to slow some things down to make sure all scripts get their turn. Its especially dangerous if you keep a runaway script that can be used by players since its like inviting them to lag the server.
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

CWO wrote:Having no sleeps won't cause crashes but with 100+ people online, if you're running something that would be hard on your server like a monster bash or some other event with a lot of people and a lot of action and suddenly maybe a few decide to use the command for their own reasons, that can generate a noticeable lag spike.

Runaways are reported because there's no such thing as infinite computer resources. Efficiency and picking and choosing what should be done immediately and what can take a second more is essential to keeping script generated lag at a minimum. You can't have everything run and be done immediately. So you have to choose to slow some things down to make sure all scripts get their turn. Its especially dangerous if you keep a runaway script that can be used by players since its like inviting them to lag the server.
Okay, this is just a command to see who are online and whatnot. Since we just started many people use it, currently have 120-130 players online and I am barely using 15% of my computer reasources, also just recieved a more powerfull server so that should drop to like 5%.

I understand the whole concept of why the are reported, and thats all good. Just that since it is a command to see who is online I dont want it to delay :) I'll post the code here so you can see what im talking about.

Code: Select all

program textcmd_online( who )

FillInArrays();

SendDialogGump( who, layout, data );

endprogram

function FillInArrays()
	var city;

    // Variables designed to Store The full array of players, the number of players, and the current player
    local players := EnumerateOnlineCharacters();
    local numplayer := len(players);
    local player;

    // Counter.
    local i := 0, online := 0, locationscount := 5, rowcount :=80, pagecount :=2, playercount :=0;

    layout.append("page 1");

    // Cycle through all the players in the game and add them to the goto list.
    for (i := 1; i <= numplayer; i := i + 1)
	player := players[i];
    
    If (player.cmdlevel==0)
	online := online +1;
	
      playercount := playercount +1;
	
      if (playercount>13)
      playercount :=1;
      rowcount :=80;
      // add forward button
        layout.append("button 350 361 5540 5541 0 " + pagecount);
      // add backward button
	if (pagecount>2)
		layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
	endif
      layout.append("page " + pagecount);
      pagecount := pagecount +1;
      endif

      layout.append("text 80 " + rowcount + " 0 " + locationscount);

      fixname(player);

      data.append(data[5]);

      locationscount := locationscount + 1;

      layout.append("text 360 " + rowcount + " 0 " + locationscount);
      city := IsInACity(player);
      if(!city OR city == "Blackthorn Castle")
      	city := "Zulu Territory";
      elseif ( city == "British Castle")
	city := "Britain";
      endif
      If( city == "Zulu Territory")
	data.append(city);
      else
     	 data.append(city+" Territory");
      endif
	//data.append("Zulu Territory");
      locationscount := locationscount + 1;

      data.append(player.name);
      locationscount := locationscount + 1;
      rowcount := rowcount +20;
      endif
      
    endfor

data[1] := online + " players online";

if (pagecount>2)
layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
endif

endfunction
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm

Re: Reading .dmp files?

Post by *Edwards »

Code: Select all

program textcmd_online( who )

SendSysMessage( who, "Creating list... It may take a moment" );
FillInArrays();

SendDialogGump( who, layout, data );

endprogram

function FillInArrays()
   var city;

    // Variables designed to Store The full array of players, the number of players, and the current player
    local players := EnumerateOnlineCharacters();
    local numplayer := len(players);
    local player;

    // Counter.
    local i := 0, online := 0, locationscount := 5, rowcount :=80, pagecount :=2, playercount :=0;

    layout.append("page 1");

    // Cycle through all the players in the game and add them to the goto list.
    for (i := 1; i <= numplayer; i := i + 1)
   player := players[i];
   
    If (player.cmdlevel==0)
   online := online +1;
   
      playercount := playercount +1;
   
      if (playercount>13)
      playercount :=1;
      rowcount :=80;
      // add forward button
        layout.append("button 350 361 5540 5541 0 " + pagecount);
      // add backward button
   if (pagecount>2)
      layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
   endif
      layout.append("page " + pagecount);
      pagecount := pagecount +1;
      endif

      layout.append("text 80 " + rowcount + " 0 " + locationscount);

      fixname(player);

      data.append(data[5]);

      locationscount := locationscount + 1;

      layout.append("text 360 " + rowcount + " 0 " + locationscount);
      city := IsInACity(player);
      if(!city OR city == "Blackthorn Castle")
         city := "Zulu Territory";
      elseif ( city == "British Castle")
   city := "Britain";
      endif
      If( city == "Zulu Territory")
   data.append(city);
      else
         data.append(city+" Territory");
      endif
   //data.append("Zulu Territory");
      locationscount := locationscount + 1;

      data.append(player.name);
      locationscount := locationscount + 1;
      rowcount := rowcount +20;
      endif
     
                   SleepMS(10); //This is the most important and it will not affect a lot the timedelay before it opens. Test it and gives us a feedback.
    endfor

data[1] := online + " players online";

if (pagecount>2)
layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
endif

endfunction
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

*Edwards wrote:

Code: Select all

program textcmd_online( who )

SendSysMessage( who, "Creating list... It may take a moment" );
FillInArrays();

SendDialogGump( who, layout, data );

endprogram

function FillInArrays()
   var city;

    // Variables designed to Store The full array of players, the number of players, and the current player
    local players := EnumerateOnlineCharacters();
    local numplayer := len(players);
    local player;

    // Counter.
    local i := 0, online := 0, locationscount := 5, rowcount :=80, pagecount :=2, playercount :=0;

    layout.append("page 1");

    // Cycle through all the players in the game and add them to the goto list.
    for (i := 1; i <= numplayer; i := i + 1)
   player := players[i];
   
    If (player.cmdlevel==0)
   online := online +1;
   
      playercount := playercount +1;
   
      if (playercount>13)
      playercount :=1;
      rowcount :=80;
      // add forward button
        layout.append("button 350 361 5540 5541 0 " + pagecount);
      // add backward button
   if (pagecount>2)
      layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
   endif
      layout.append("page " + pagecount);
      pagecount := pagecount +1;
      endif

      layout.append("text 80 " + rowcount + " 0 " + locationscount);

      fixname(player);

      data.append(data[5]);

      locationscount := locationscount + 1;

      layout.append("text 360 " + rowcount + " 0 " + locationscount);
      city := IsInACity(player);
      if(!city OR city == "Blackthorn Castle")
         city := "Zulu Territory";
      elseif ( city == "British Castle")
   city := "Britain";
      endif
      If( city == "Zulu Territory")
   data.append(city);
      else
         data.append(city+" Territory");
      endif
   //data.append("Zulu Territory");
      locationscount := locationscount + 1;

      data.append(player.name);
      locationscount := locationscount + 1;
      rowcount := rowcount +20;
      endif
     
                   SleepMS(10); //This is the most important and it will not affect a lot the timedelay before it opens. Test it and gives us a feedback.
    endfor

data[1] := online + " players online";

if (pagecount>2)
layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
endif

endfunction
Thanks :) But still, with 130 players online that would equal to a delay of 1.3 seconds. Which I think is too much, this is one CMD which I'd like to have instant.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Reading .dmp files?

Post by CWO »

I took your code Snocks and put the sleep in where it switches the page. This way, it will only sleep when going to a new page. With 130 players, it should be .1 second. And CPU load at 15 is getting on the higher end... but then again, I'm the nut that runs POL on his gaming computer so it almost never takes 1% load due to rescripting.

Code: Select all

program textcmd_online( who )

FillInArrays();

SendDialogGump( who, layout, data );

endprogram

function FillInArrays()
   var city;

    // Variables designed to Store The full array of players, the number of players, and the current player
    local players := EnumerateOnlineCharacters();
    local numplayer := len(players);
    local player;

    // Counter.
    local i := 0, online := 0, locationscount := 5, rowcount :=80, pagecount :=2, playercount :=0;

    layout.append("page 1");

    // Cycle through all the players in the game and add them to the goto list.
    for (i := 1; i <= numplayer; i := i + 1)
   player := players[i];
   
    If (player.cmdlevel==0)
   online := online +1;
   
      playercount := playercount +1;
   
      if (playercount>13)
      	sleepms(10);                   // Sleep when flipping the page.
      playercount :=1;
      rowcount :=80;
      // add forward button
        layout.append("button 350 361 5540 5541 0 " + pagecount);
      // add backward button
   if (pagecount>2)
      layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
   endif
      layout.append("page " + pagecount);
      pagecount := pagecount +1;
      endif

      layout.append("text 80 " + rowcount + " 0 " + locationscount);

      fixname(player);

      data.append(data[5]);

      locationscount := locationscount + 1;

      layout.append("text 360 " + rowcount + " 0 " + locationscount);
      city := IsInACity(player);
      if(!city OR city == "Blackthorn Castle")
         city := "Zulu Territory";
      elseif ( city == "British Castle")
   city := "Britain";
      endif
      If( city == "Zulu Territory")
   data.append(city);
      else
         data.append(city+" Territory");
      endif
   //data.append("Zulu Territory");
      locationscount := locationscount + 1;

      data.append(player.name);
      locationscount := locationscount + 1;
      rowcount := rowcount +20;
      endif
     
    endfor

data[1] := online + " players online";

if (pagecount>2)
layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
endif

endfunction
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

CWO wrote:I took your code Snocks and put the sleep in where it switches the page. This way, it will only sleep when going to a new page. With 130 players, it should be .1 second. And CPU load at 15 is getting on the higher end... but then again, I'm the nut that runs POL on his gaming computer so it almost never takes 1% load due to rescripting.

Code: Select all

program textcmd_online( who )

FillInArrays();

SendDialogGump( who, layout, data );

endprogram

function FillInArrays()
   var city;

    // Variables designed to Store The full array of players, the number of players, and the current player
    local players := EnumerateOnlineCharacters();
    local numplayer := len(players);
    local player;

    // Counter.
    local i := 0, online := 0, locationscount := 5, rowcount :=80, pagecount :=2, playercount :=0;

    layout.append("page 1");

    // Cycle through all the players in the game and add them to the goto list.
    for (i := 1; i <= numplayer; i := i + 1)
   player := players[i];
   
    If (player.cmdlevel==0)
   online := online +1;
   
      playercount := playercount +1;
   
      if (playercount>13)
      	sleepms(10);                   // Sleep when flipping the page.
      playercount :=1;
      rowcount :=80;
      // add forward button
        layout.append("button 350 361 5540 5541 0 " + pagecount);
      // add backward button
   if (pagecount>2)
      layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
   endif
      layout.append("page " + pagecount);
      pagecount := pagecount +1;
      endif

      layout.append("text 80 " + rowcount + " 0 " + locationscount);

      fixname(player);

      data.append(data[5]);

      locationscount := locationscount + 1;

      layout.append("text 360 " + rowcount + " 0 " + locationscount);
      city := IsInACity(player);
      if(!city OR city == "Blackthorn Castle")
         city := "Zulu Territory";
      elseif ( city == "British Castle")
   city := "Britain";
      endif
      If( city == "Zulu Territory")
   data.append(city);
      else
         data.append(city+" Territory");
      endif
   //data.append("Zulu Territory");
      locationscount := locationscount + 1;

      data.append(player.name);
      locationscount := locationscount + 1;
      rowcount := rowcount +20;
      endif
     
    endfor

data[1] := online + " players online";

if (pagecount>2)
layout.append("button 260 361 5537 5538 0 " + (pagecount-2));
endif

endfunction

Yeah, thanks :) Didn't even occur to me that having a sleep at pageswitch would achieve the goal but not delay it. Sometimes you just cant think of the right stuff :) Many thanks though.

And yeah, I got my new rig today and with 130 players online im at 1% CPU load ;) New rig really helped that one.

And for another problem, I cannot seem to get a script to freeze a player. It works fine with .freeze where you klick the player. But I am trying to add the freeze to my auctioner, but it just wont stick. Any thoughts?

I tried these codes to freeze him:

Code: Select all

        who.mobile.frozen := 1;
	SetObjProperty(who.mobile,"frozen",1);

Code: Select all

        who.frozen := 1;
	SetObjProperty(who,"frozen",1);
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Reading .dmp files?

Post by CWO »

who.frozen := 1; should set it as long as who is a valid character/NPC...
Snocks
New User
Posts: 19
Joined: Sat Mar 07, 2009 8:36 am

Re: Reading .dmp files?

Post by Snocks »

CWO wrote:who.frozen := 1; should set it as long as who is a valid character/NPC...
Yeah, but it don't for some reason.
aktor
New User
Posts: 7
Joined: Sun Mar 08, 2009 6:46 am

Re: Reading .dmp files?

Post by aktor »

Is that particular "who" a character reference or a name?
Post Reply