www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Proposal: User Code Bug Tracking

reply dsimcha <dsimcha yahoo.com> writes:
There's been a lot of discussion on this newsgroup about improvements that can
be made to D to prevent bugs.  The problem is that noone really has stepped
back and looked at what the biggest causes of bugs in D are.

I therefore propose that we create a website where people can post a few basic
details about non-trivial bugs they encountered and fixed in their D2 code.
(Non-trivial bugs are defined as bugs that took more than a few minutes worth
of effort to discover, diagnose and fix.)  The simplest version might just be
something like:

The root cause of my last D2 bug was closest to:

Integer overflow

Signed/unsigned comparison

Null pointers

Floating point precision issues

Unsafe casts

Memory corruption

Violation of implicit function preconditions

Violation of explicit (using contracts) function preconditions

Violation of implicit struct/class invariants

Violation of explicit (using contracts) struct/class invariants

Off-by-one errors

Misunderstanding of Phobos/druntime API

Misunderstanding of a third-party library API

Concurrency issues

Otherwise incorrect function calls (arguments in wrong order, wrong overload
called, etc.)

User input cases I hadn't considered

Other high-level logic errors not related to any of the above
Nov 24 2010
next sibling parent Michal Minich <michal.minich gmail.com> writes:
V Thu, 25 Nov 2010 01:32:36 +0000, dsimcha wrote:

 The root cause of my last D2 bug was closest to:
Signed/unsigned comparison and arithmetic see http://www.digitalmars.com/d/archives/digitalmars/D/learn/ Mixing_operations_with_signed_and_unsigned_types_20347.html to work around this bug, and get error at compile time you can create template for built in operators (< + - /): as 'lt' mentioned in the archived post, and use: lt(a, b) instead of a < b. If it were not possible to make such templates, I would be hunting bugs in my sometime wrong/sometime not calculations to this day. It is quite hard to avoid using unsigned types, especially when you are using auto.
Nov 25 2010
prev sibling next sibling parent Jason House <jason.james.house gmail.com> writes:
My last bug bug was closest to either memory corruption or misuse of druntime
API. Mix in that it only happened with concurrency, it involved a poorly
understood 3rd party API (C++ code), and awful gdb support, and you have a mix
that has soured me on D development to this day!

This was in a project that fully embraced shared. I did not add in the 3rd
party library until after it worked with 2 other API's already (one using D and
another using C++). It took me over a month to track down, and turned out that
the root cause was a bug I had filed months before I hit the issue!

dsimcha Wrote:

 There's been a lot of discussion on this newsgroup about improvements that can
 be made to D to prevent bugs.  The problem is that noone really has stepped
 back and looked at what the biggest causes of bugs in D are.
 
 I therefore propose that we create a website where people can post a few basic
 details about non-trivial bugs they encountered and fixed in their D2 code.
 (Non-trivial bugs are defined as bugs that took more than a few minutes worth
 of effort to discover, diagnose and fix.)  The simplest version might just be
 something like:
 
 The root cause of my last D2 bug was closest to:
 
 Integer overflow
 
 Signed/unsigned comparison
 
 Null pointers
 
 Floating point precision issues
 
 Unsafe casts
 
 Memory corruption
 
 Violation of implicit function preconditions
 
 Violation of explicit (using contracts) function preconditions
 
 Violation of implicit struct/class invariants
 
 Violation of explicit (using contracts) struct/class invariants
 
 Off-by-one errors
 
 Misunderstanding of Phobos/druntime API
 
 Misunderstanding of a third-party library API
 
 Concurrency issues
 
 Otherwise incorrect function calls (arguments in wrong order, wrong overload
 called, etc.)
 
 User input cases I hadn't considered
 
 Other high-level logic errors not related to any of the above
Nov 25 2010
prev sibling next sibling parent Kagamin <spam here.lot> writes:
dsimcha Wrote:

 Signed/unsigned comparison
integer promotion http://d.puremagic.com/issues/show_bug.cgi?id=2809
 Misunderstanding of a third-party library API
Nov 25 2010
prev sibling parent reply Kagamin <spam here.lot> writes:
dsimcha Wrote:

 There's been a lot of discussion on this newsgroup about improvements that can
 be made to D to prevent bugs.  The problem is that noone really has stepped
 back and looked at what the biggest causes of bugs in D are.
I notice, every time I write in D I end up filing bugs in bugzilla...
Nov 25 2010
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Thursday 25 November 2010 05:50:12 Kagamin wrote:
 dsimcha Wrote:
 There's been a lot of discussion on this newsgroup about improvements
 that can be made to D to prevent bugs.  The problem is that noone really
 has stepped back and looked at what the biggest causes of bugs in D are.
I notice, every time I write in D I end up filing bugs in bugzilla...
Too true. Perhaps not _every_ time, but it does happen quite often. - Jonathan M Davis
Nov 25 2010