Flutterby™! : Having a weird crash that I can't track

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Having a weird crash that I can't track

2025-03-13 20:05:02.413709+01 by Dan Lyke 5 comments

Having a weird crash that I can't track down, so figured I'd let XCode do static analysis.

Wow is this... of questionable value.

comments in descending chronological order (reverse):

#Comment Re: Having a weird crash that I can't track made: 2025-03-14 00:08:00.774712+01 by: Dan Lyke

Yeah, it's weird because I believe that the way Objective-C does pointers is roughly the same as C++ weak and smart (non-intrusive) pointers, each pointer is part of a linked list, so that when the references from the strong pointers go to zero the weak pointers can be niled. So actual dangling pointers are hard to create.

It seems like the first undo record created by this particular path is the problem, but so far as I can tell, all of those undo records are created exactly the same. Maybe it's related to controls which might be undo targets going away...

#Comment Re: Having a weird crash that I can't track made: 2025-03-14 00:08:00.774712+01 by: markd

I'd double-check that what's passed in to the Dict<string, Number> is actually one of those (granted, the compiler should gripe if you tried to pass a Dict<string, Date> there...)

undo can be really fiddly. I don't know if it strongly captures everything - could be a case of nothing-but- weak causing the undoable object to vanish. Zombies would catch that case.

#Comment Re: Having a weird crash that I can't track made: 2025-03-14 00:08:00.774712+01 by: Dan Lyke

My particular crash is that when I add things to the undo stack from one path everything works fine, when I add what looks like the exact same thing to the undo stack from another path, the top thing on the undo stack crashes. Sometimes with different message send failures, sometimes with just EXC_BAD_ACCESS. Something's getting memory corrupted by the second path, but danged if I can find it.

So in the mean-time I figured I'd chase down some static analysis stuff, and there's the usual "didn't specify _Nullable in all the right places" bits, which whatever, but there's some things about typing and allegedly unused variables that dang, I am not seeing.

And why is it complaining that an argument declared as (NSMutableDictionary<nsstring *, NSNumber *> *)dict is a Conversion from value of type 'NSNumber *' to incompatible type 'NSDate *'" when I attempt to do dict[s] = @(0)? We'll never know...

#Comment Re: Having a weird crash that I can't track made: 2025-03-13 20:11:48.040152+01 by: markd

The three sanitizers (thread, address, and undefined behavior) can be useful. Not nearly as nice as Purify was back in the 90s, but can detect some classes of race conditions. zombies are good to catching unintentional object reuse. (less of a problem with ARC, but can still happen)

#Comment Re: Having a weird crash that I can't track made: 2025-03-13 20:11:48.040152+01 by: markd

static analysis used to be pretty good. It's probably bitrot the last decade.

Add your own comment:

(If anyone ever actually uses Webmention/indie-action to post here, please email me)




Format with:

(You should probably use "Text" mode: URLs will be mostly recognized and linked, _underscore quoted_ text is looked up in a glossary, _underscore quoted_ (http://xyz.pdq) becomes a link, without the link in the parenthesis it becomes a <cite> tag. All <cite>ed text will point to the Flutterby knowledge base. Two enters (ie: a blank line) gets you a new paragraph, special treatment for paragraphs that are manually indented or start with "#" (as in "#include" or "#!/usr/bin/perl"), "/* " or ">" (as in a quoted message) or look like lists, or within a paragraph you can use a number of HTML tags:

p, img, br, hr, a, sub, sup, tt, i, b, h1, h2, h3, h4, h5, h6, cite, em, strong, code, samp, kbd, pre, blockquote, address, ol, dl, ul, dt, dd, li, dir, menu, table, tr, td, th

Comment policy

We will not edit your comments. However, we may delete your comments, or cause them to be hidden behind another link, if we feel they detract from the conversation. Commercial plugs are fine, if they are relevant to the conversation, and if you don't try to pretend to be a consumer. Annoying endorsements will be deleted if you're lucky, if you're not a whole bunch of people smarter and more articulate than you will ridicule you, and we will leave such ridicule in place.


Flutterby™ is a trademark claimed by

Dan Lyke
for the web publications at www.flutterby.com and www.flutterby.net.