[Geany-Devel] [geany/geany-plugins] 4cc119: Scope: Fix mismatched allocator/deallocator

Lex Trotman elextr at xxxxx
Thu Mar 7 21:54:32 UTC 2013


On 8 March 2013 08:07, Dimitar Zhekov <dimitar.zhekov at gmail.com> wrote:
> On Thu, 07 Mar 2013 11:37:50 -0800
> Matthew Brush <mbrush at codebrainz.ca> wrote:
>
>> > Personally I prefer offensive programming: if something goes wrong, let
>> > it crash and burn, get a proper backtrace and fix it.
>>
>> Note to self: don't use Scope plugin until all files are saved :)
>
> You should save and compile the source files at least. Otherwise,
> debugging may be confusing. ;)
>
> On Fri, 8 Mar 2013 06:44:15 +1100
> Lex Trotman <elextr at gmail.com> wrote:
>
>> In which case this plugin must be removed from G-P until you have a
>> reasonable assurance it won't bring Geany down.  You may prefer crash
>> and burn, but you should not impose that on innocent G-P users.
>
> All sorts of invalid glib/gtk calls can bring Geany down without any
> messages, the g_return_*() checks in the libraries are by no means
> complete. So, it depends on the exact value of "reasonable".

I'm only complaining about the *deliberate* crash and burn policy you
seemed to be espousing.

We should all try not to crash and burn in most reasonable circumstances.

But running out of memory is a situation that is not "reasonable"
since you can't guarantee to get a message out or anything, so crash
in the allocator is the better solution.  Struggling on with a NULL is
probably going to be a waste of development time.


>
> The drawbacks of defensive programming are that bugs tend to stay
> unfixed, sunce they just emit a message in ~/.xsession-errors, and
> nobody notices/cares (I have several of those since forever); the
> clumsier way to get a proper stack trace; and the unpredictable caller
> behaviour when a function is not executed because of a g_return_*() -
> it may crash in some random place, and then you will receive an error
> report - but a wrong one (if the log messages are missing), or less
> helpful (with them included).

Our failure to notice messages and fix them isn't the users problem.

Making debugging easy by losing user files isn't a good tradeoff IMHO :)

Cheers
Lex


>
> --
> E-gards: Jimmy
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel


More information about the Devel mailing list