Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Bug Report
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 05-13-2010, 11:25 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
clearemptyvars() crashes npc server.

Graal Script Code:
function onCreated() {
  
clearemptyvars(); // doesn't crash when used here
  
  
this.test.var = "testing";
  echo( 
this.test.getDynamicVarNames() );
  
  
this.test.var = "";
  echo( 
this.test.getDynamicVarNames() );
  
  
//clearemptyvars();    // crash's when i swap it to here
  
echo( this.test.getDynamicVarNames() );
  

I'm not exactly sure what's going on here. It seems to crash when used alongside echo() Which is silly.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #2  
Old 05-13-2010, 11:37 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Just tested it and it crashed instantly when uncommenting the line you specified. Strange.
__________________
Reply With Quote
  #3  
Old 05-13-2010, 11:38 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Weird, version 5 right?

Shouldn't it be

HTML Code:
obj.clearemptyvars();
either way, strange how it didn't crash on the first instance
__________________
Reply With Quote
  #4  
Old 05-13-2010, 11:39 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by adam View Post
Graal Script Code:
function onCreated() {
  
clearemptyvars(); // doesn't crash when used here
  
  
this.test.var = "testing";
  echo( 
this.test.getDynamicVarNames() );
  
  
this.test.var = "";
  echo( 
this.test.getDynamicVarNames() );
  
  
//clearemptyvars();    // crash's when i swap it to here
  
echo( this.test.getDynamicVarNames() );
  

I'm not exactly sure what's going on here. It seems to crash when used alongside echo() Which is silly.
I can confirm that this crashes the NPC Server, however, it has nothing to do with the echo(). Try setting temp.somevar = this.test.getDynamicVarNames() instead of echoing it, and the server will still crash.
__________________
Reply With Quote
  #5  
Old 05-13-2010, 11:41 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by salesman View Post
I can confirm that this crashes the NPC Server, however, it has nothing to do with the echo(). Try setting temp.somevar = this.test.getDynamicVarNames() instead of echoing it, and the server will still crash.
It might be some issue in the engine with threading? Race conditions can be nasty. Might be that you're trying to access this.test while it's locked. Though, why that would be done on a separate thread would be beyond me.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 05-13-2010, 11:46 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Graal Script Code:
function onCreated() {
  
temp.output = {};
  
  
this.test.var = "testing";
  
temp.output.addthis.test.getDynamicVarNames() );
  
  
this.test.var = "";
  
temp.output.addthis.test.getDynamicVarNames() );
  
  
clearemptyvars(); 
  
temp.output.addthis.test.getDynamicVarNames() );
  echo(
temp.output);

This example does not crash. And it also demonstrates the use of clearemptyvars() I was trying to demonstrate. Very useful.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #7  
Old 05-13-2010, 11:53 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xAndrewx View Post
Weird, version 5 right?
The NPC-server, not the client .
__________________
Reply With Quote
  #8  
Old 05-14-2010, 12:04 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
I've actually never used this function clientside. So I dunno about that.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #9  
Old 05-14-2010, 12:16 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by cbk1994 View Post
The NPC-server, not the client .
Oh duh, *peeks at thread*


My guess is that it's being used on a global level.
__________________
Reply With Quote
  #10  
Old 05-14-2010, 12:55 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Well, my original speculation was that this.test was pointing to a memory address which didn't get cleaned up properly when you did clearemptyvars(), so accessing it would cause a seg fault.

But the fact that you can call getdynamicvars and add it to an array but not echo it seems a bit weird...


Maybe it has to do with casting the response of getdynamicvars to a string?
Reply With Quote
  #11  
Old 05-14-2010, 02:25 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Graal uses threading for scripts? News to me.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:58 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.