News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

CB svn rev 2338 !sanitychecked

Started by tiwag, April 12, 2006, 05:39:27 PM

Previous topic - Next topic

tiwag

thanks for removing all sanitychecks,
now the crash on exit is back  8)
when running under linux ...

thomas

You're welcome :)

Besides, I just found that it crashes under Windows, too, if you have a source file open, but no project. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

thomas

Quote from: thomas on April 12, 2006, 06:21:14 PMBesides, I just found that it crashes under Windows, too, if you have a source file open, but no project. :)
And this one is fixed.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

rickg22

 :shock:!!!!

What? You removed all the sanity checks!? :( Oh man - Do you realize that many functions assume that the sanity checks are there? And no, I don't remember them... now I got scared.

thomas

Sanity check does a null pointer check and keeps a copy of this as a member variable.
The purpose of the null pointer check is quite clear, but I tried to find out what a local copy of this could be good for this morning.
After experimenting for two hours (allocating, freeing, changing pointers, deriving classes, overwriting pointers), I found no real case in which having a copy of this as a member would be an advantage. It does catch overwriting a previously correctly assigned pointer (why on earth would anyone do that?), but it does not catch an uninitialised pointer or anything else.

Thus, since I was unable to figure what all this magic was good for (except a null pointer check), I asked Yiannis whether he knew. Yiannis said we actually did not need sanity checks any more, since they were remnants of old times.

I wondered whether it was generally a good idea to "hide" a programming error (such as a null pointer) rather than address the root of the problem. Yiannis agreed on that and said we should rather accept a crash, look at the backtrace, and then fix the error, instead of brushing the problem under the carpet.
He then suggested I should feel free to remove the sanity checks alltogether, and I was happy to do so.

So far, the results don't look too desasterous. Tiwag is witnessing the son of crash on close under Linux, and I have seen a crash on close under Windows if editors are open without a project (this no longer persists).
On the positive side, we now have quite noticeable reduction in code size :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

rickg22

#5
OK then! I'll trust you guys in this.

P.S. How long till all bugs get fixed? I'm anxious to test RC3  :wink:

Oh, yeah, I forgot. The reason for the sanity checks was the infamous wxApp::Yield(). IIRC, there was a part of the code that needed a rewriting to get rid of this and still be responsive. Was it the compiler?  :|  I can't remember...