(Translated by https://www.hiragana.jp/)
Side-effects - anatomy of a Second Life bug - Second Life Insider
The Wayback Machine - https://web.archive.org/web/20071023200118/http://www.secondlifeinsider.com:80/2007/10/23/side-effects-anatomy-of-a-second-life-bug/
Announcing Aisledash: a blissful blog about weddings | Add to My AOL, MyYahoo, Google, Bloglines

Side-effects - anatomy of a Second Life bug

Many of you who have used the latest release candidate, 1.18.4(0) have probably noticed that the tooltip popup on the map that shows you the number of people in a sim/region.. well, doesn't actually show you the number. Instead it relentlessly reports zero for every sim except the one you are in, where it reports one (that's you).

How did this happen? Well, when you modify or refactor code, there's two important requirements. First, you have to know how to code. Second, you have to understand what is going on. Lacking the first is less dangerous. You can go safely stick pencils up your nose. Lacking the second, however, means you risk sticking pencils up everyone else's nose. This bug was relatively harmless, if irritating.

Jacek Antonelli, who heroically dived in and fixed this bug up for me said that one of the causes was, "editing the code without understanding everything it does."

"It looks like they refactored the rendering code into its own function (good for them), but missed this crazy side-effect that was going on."

That side effect was, basically, that as it looped through each agent to draw them, it also incremented a counter, amassing a running total of agents in the sim. At the end of processing that sim, the resulting was stored.

In 1.18.4(0), the dot-rendering process in the loop was pulled into it's own function, and the running total was simply left at zero. Worse, when that zero is stored - it actually overwrites an existing correct number that is calculated elsewhere, presumably after this piece of code was originally written. So doing the counting and storing the result is just plain unnecessary.

Someone may have half figured that out that that counting everything up again was a waste of time and precious CPU cycles - the counting was removed - but apparently forgot to also remove the code that stored the running total, allowing it to essentially overwrite good data with bad.

All of this seems to result from a lack of knowledge of what each section of the code is responsible for, and how it (and it's intentional side-effects) mesh with other sections.

Some number of errors are, of course, inevitable. However without a map, how can you not get lost?

Related Headlines

Add your comments

Please keep your comments relevant to this blog entry. Email addresses are never displayed, but they are required to confirm your comments.

When you enter your name and email address, you'll be sent a link to confirm your comment, and a password. To leave another comment, just use that password.

To create a live link, simply type the URL (including http://) or email address and we will make it a live link for you. You can put up to 3 URLs in your comments. Line breaks and paragraphs are automatically converted — no need to use <p> or <br> tags.

New Users

Current Users

General
Arts and Culture (66)
Gridbugs (198)
Live Performance (16)
Machinima (70)
MMO Watch (31)
Op/Ed (43)
Podcasts (20)
SL Blogs (8)
Teaching (55)
Teen Grid (13)
Updates (151)
Events (340)
How-To (52)
News (740)
SL Insider Business (23)
Stories (264)
Comics (17)
Mixed Reality (426)
Linden Lab (353)
Odds and Ends (898)
Just Askin' (95)
Objects
Building (96)
Clothing (40)
Gadgets (70)
Graphic Design (28)
LSL (25)
Economics
Accounts (79)
Business (438)
Linden Dollars (307)
Making Money (78)
Residents
Resident Snapshot (56)
Interviews (126)
Newbies (46)
Places
Great Builds (82)
Educational (112)
Entertainment (110)
Exploration (111)
Shopping (111)

RSS NEWSFEEDS

RESOURCES

Powered by Blogsmith

Advertisement

Virtual Worlds 2007 Conference
Win an Ultimate Halo 3 setup from Xbox 360 Fanboy!!!
Play Wow? Get all the news about the latest expansion here.

Sponsored Links

Featured Galleries

Noelyci's Observatory
John August Speaks on His Movie The Nines
DanCoyote's Arts and Letters Installation
Mens fashions 2
Newbie Tourist
Natalia Zelmanov
Virtual Osaka
Silent Sparrow
Sculpties Exhibition June 2007

 

Most Commented On (14 days)

Recent Comments

SL Insider blogroll

Weblogs, Inc. Network

Other Weblogs Inc. Network blogs you might be interested in: