Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sat Dec 22, 2007 1:48 am   

[2.18] Problem with %dbkeys
 
#var tester %null
#addkey tester one 1
#addkey tester two 2
#addkey tester three 3
#delkey tester two
#say Keys: %dbkeys( @tester) Number: %numitems( %dbkeys( @tester))
#delkey tester one
#say Keys: %dbkeys( @tester) Number: %numitems( %dbkeys( @tester))

Result I get is:
Keys: one| Number: 2
Keys: Number: 0

Error: Where is "three" when %dbkeys prints the names of the keys after the first delete?
What is happening after the second delete? There should still be one item in the database record.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Dec 22, 2007 11:57 am   
 
Confirmed. How bizarre.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jan 07, 2008 11:23 pm   
 
Added to bug list.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Wed Jan 09, 2008 12:39 am   
 
Also, I was just curious - when the variable get corrupted in my example you can cause an AV by going to the variable in the editor and trying to delete all the lines manually. It will pop up an AV before you can delete all the lines.

This isn't the first time I've come across corrupted variables that behave strangely. What I'm curious about is what is actually happening to those variables and how can I fix them? I've had code problems where some random variable was corrupted and wasn't able to be updated and therefore I had an infinite loop executing because the counter wouldn't update. Does anyone know what is happening to these variables and how to detect and fix them? I hate finding them by spending an hour debugging a lock up back to a variable that isn't allowing itself to be updated.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jan 09, 2008 8:55 pm   
 
What is happening is that the internal hash table for the variable is getting screwed up. There really isn't any way to detect this without getting the AV that you mentioned. I haven't had a chance to look at the code yet to see what is causing this bug, so I can't really give any more info on it yet.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net