Segmentation fault hell in D
Chad J
chadjoan at __spam.is.bad__gmail.com
Sat Jun 9 21:49:37 PDT 2012
On 06/08/2012 02:00 PM, Justin Whear wrote:
> On Fri, 08 Jun 2012 19:30:57 +0200, Jarl André wrote:
>
>> Evry single time I encounter them I yawn. It means using the next
>> frickin hour to comment away code, add more log statements and try to
>> eleminate whats creating the hell of bugz, segmantation fault. Why can't
>> the compiler tell me anything else than the fact that i have referenced
>> data that does not exist? Thanks I knew that. Now, please tell me where
>> the error occured.... Jeezes.
>
> The compiler can't really help you (aside from maybe adding dereference
> checks everywhere) because you have a logic error, not something that can
> be statically determined. This is why debuggers exist. Whenever I get a
> segfault, I fire up GDB and recreate it. If you've compiled with -g, GDB
> can usually tell you the exact line the problem occurred on and a full
> backtrace to help you figure out how you got there.
I think what everyone who didn't come from a C/C++ background wants is
backtraces without having to drop into a debugger.
I just don't think the folks that haven't used modern JITed/interpreted
languages for a long period of time understand how inconvenient (and
sometimes completely impractical) it is to drop into a debugger every
time there is a segfault.
More information about the Digitalmars-d-learn
mailing list