Debugging woes: Small rollback

Announcements about major changes in Haven & Hearth.

Re: Debugging woes: Small rollback

Postby loftar » Sun Nov 30, 2025 11:40 pm

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: 9075
Joined: Fri Apr 03, 2009 7:05 am

Re: Debugging woes: Small rollback

Postby loftar » Sun Nov 30, 2025 11:47 pm

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
User avatar
loftar
 
Posts: 9075
Joined: Fri Apr 03, 2009 7:05 am

Re: Debugging woes: Small rollback

Postby Vladichka » Sun Nov 30, 2025 11:49 pm

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
Vladichka
 
Posts: 55
Joined: Tue Jul 18, 2023 8:26 pm

Re: Debugging woes: Small rollback

Postby loftar » Sun Nov 30, 2025 11:50 pm

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
User avatar
loftar
 
Posts: 9075
Joined: Fri Apr 03, 2009 7:05 am

Re: Debugging woes: Small rollback

Postby xyzzy57 » Sun Nov 30, 2025 11:56 pm

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.
xyzzy57
 
Posts: 174
Joined: Thu Aug 19, 2021 9:41 pm

Re: Debugging woes: Small rollback

Postby MightySheep » Mon Dec 01, 2025 12:39 am

Fixing bugs is boring why don't u add some new bugs to the game instead
User avatar
MightySheep
 
Posts: 2209
Joined: Fri Jul 22, 2011 1:18 pm

Re: Debugging woes: Small rollback

Postby Robben_DuMarsch » Mon Dec 01, 2025 2:49 am

Gigantic underground beetle that is like bear sized and very scary/stronk.
Tell Jorb we want bugs/beetles instead of birbs.
User avatar
Robben_DuMarsch
 
Posts: 2460
Joined: Wed Sep 28, 2011 2:58 am

Re: Debugging woes: Small rollback

Postby vatas » Mon Dec 01, 2025 7:41 am

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.)
User avatar
vatas
 
Posts: 4971
Joined: Fri Apr 05, 2013 8:34 am
Location: Suomi Finland Perkele

Re: Debugging woes: Small rollback

Postby xyzzy57 » Mon Dec 01, 2025 8:07 pm

So was this latest crash the one you'd been waiting for? Inquiring minds really want to know.
xyzzy57
 
Posts: 174
Joined: Thu Aug 19, 2021 9:41 pm

Re: Debugging woes: Small rollback

Postby loftar » Mon Dec 01, 2025 9:19 pm

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
User avatar
loftar
 
Posts: 9075
Joined: Fri Apr 03, 2009 7:05 am

PreviousNext

Return to Announcements

Who is online

Users browsing this forum: Claude [Bot], Fostik, Hammeri, Mamel, Python-Requests [Bot], Trendiction [Bot] and 15 guests