Debugging woes: Small rollback

Announcements about major changes in Haven & Hearth.
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: Debugging woes: Small rollback

Post by loftar »

Well, this is frustrating. The last time I tried this server code, it crashed within hours on a double-free bug. Now I've been running for three days with ASan and it hasn't showed up.

I really doubt it, but perhaps some of the other fixes along the way permuted the bug away or something. I'm going to try to run it without ASan again and see what happens. I really doubt ASan could "mask" the real bug here, but I'm kind of running out of other ideas.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: Debugging woes: Small rollback

Post by loftar »

Lol, turns out there was a bug in the termination code also. Doesn't really matter since it just sends corrupted shutdown-timer information to clients the last thing that happens before they're disconnected, but still. :)
"Object-oriented design is the roman numerals of computing." -- Rob Pike
Vladichka
Posts: 116
Joined: Tue Jul 18, 2023 8:26 pm

Re: Debugging woes: Small rollback

Post by Vladichka »

loftar wrote:Well, this is frustrating. The last time I tried this server code, it crashed within hours on a double-free bug. Now I've been running for three days with ASan and it hasn't showed up.

I really doubt it, but perhaps some of the other fixes along the way permuted the bug away or something. I'm going to try to run it without ASan again and see what happens. I really doubt ASan could "mask" the real bug here, but I'm kind of running out of other ideas.
Well, looks like it didn't take long
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: Debugging woes: Small rollback

Post by loftar »

Vladichka wrote:Well, looks like it didn't take long
Nah, as I mentioned, that was a bug when shutting down the still ASan'd server.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
xyzzy57
Posts: 200
Joined: Thu Aug 19, 2021 9:41 pm

Re: Debugging woes: Small rollback

Post by xyzzy57 »

loftar wrote:Well, this is frustrating. The last time I tried this server code, it crashed within hours on a double-free bug. Now I've been running for three days with ASan and it hasn't showed up.

I really doubt it, but perhaps some of the other fixes along the way permuted the bug away or something. I'm going to try to run it without ASan again and see what happens. I really doubt ASan could "mask" the real bug here, but I'm kind of running out of other ideas.
Dynamic memory abuse bugs are a real b*tch. You have my sympathy. Good luck.
User avatar
MightySheep
Posts: 2534
Joined: Fri Jul 22, 2011 1:18 pm

Re: Debugging woes: Small rollback

Post by MightySheep »

Fixing bugs is boring why don't u add some new bugs to the game instead
User avatar
Robben_DuMarsch
Posts: 2646
Joined: Wed Sep 28, 2011 2:58 am

Re: Debugging woes: Small rollback

Post by Robben_DuMarsch »

Gigantic underground beetle that is like bear sized and very scary/stronk.
Tell Jorb we want bugs/beetles instead of birbs.
User avatar
vatas
Posts: 5255
Joined: Fri Apr 05, 2013 8:34 am
Location: Suomi Finland Perkele

Re: Debugging woes: Small rollback

Post by vatas »

Robben_DuMarsch wrote:Gigantic underground beetle that is like bear sized and very scary/stronk.
Tell Jorb we want bugs/beetles instead of birbs.
Image
Haven and Hearth Wiki (Maintained by volunteers - test/verify when practical. Forum thread

Basic Claim Safety (And what you’re doing wrong
TL:;DR: Build a Palisade with only Visitor gates.)

Combat Guide (Overview, PVE, PVP) (Includes how to escape/minimize risk of getting killed.)
xyzzy57
Posts: 200
Joined: Thu Aug 19, 2021 9:41 pm

Re: Debugging woes: Small rollback

Post by xyzzy57 »

So was this latest crash the one you'd been waiting for? Inquiring minds really want to know.
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: Debugging woes: Small rollback

Post by loftar »

It was indeed. I had been cleaning up parts of the connection code a while ago, and accidentally left a line that transmitted the error message for old clients twice, but using the same message buffer, leading to it getting freed twice. The first time it happened, I thought it looked like the double-free was a random dangling pointer getting freed in completely unrelated code (which is why I was running with ASan), but it turned out to be significantly simpler than that now that I got to examine it again.
"Object-oriented design is the roman numerals of computing." -- Rob Pike

Return to “Announcements”