[Webkit-unassigned] [Bug 36527] Need an ASSERT that's enabled in release builds

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 24 11:43:46 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36527





--- Comment #12 from Jeremy Orlow <jorlow at chromium.org>  2010-03-24 11:43:46 PST ---
(In reply to comment #11)
> (In reply to comment #10)
> > To be honest, I wonder if a code comment above CRASH is the right thing to do
> > here.
> 
> We can start with that.

Sounds good.  Jeremy are you willing to do this?

> > I don't think CRASH/FATAL_ERROR suffer from this problem.
> 
> I think we need a guide for when to use assertions and when to use CRASH. Not
> just a comment in the code, but a background about rationale for the project.

I can try taking a stab at this if you'd like, but I can't think of much more
than a paragraph or so to say on the subject.

I guess the gist is that you should ASSERT on stuff that should never happen
that will cause incorrect results but shouldn't result in a crash or memory
corruption.  CRASH should be used when we're reasonably sure something should
never happen but it happening would be _really_ bad.  It can also be used when
there's no way to recover (like OOM).  The ideal is to handle errors properly,
possibly after ASSERTing on them if they should never happen, but this is
sometimes not practical.

Is there more to say on the subject (beyond maybe a few examples and more clear
language)?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list