Segmentation fault hell in D

Dejan Lekic dejan.lekic at gmail.com
Sat Jun 9 06:09:26 PDT 2012


On Fri, 08 Jun 2012 19:57:47 -0700, Andrew Wiley wrote:

> On Fri, Jun 8, 2012 at 11:29 AM, Jonathan M Davis
> <jmdavisProg at gmx.com>wrote:
> 
>> On Friday, June 08, 2012 19:30:57 Jarl André"
>> <jarl.andre at gmail.com>@puremagic.com 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.
>>
>> Turn on core dumps and use gdb. It'll give a backtrace and allow you to
>> look
>> at the state of the program when the segfault occured. That's pretty
>> much the
>> standard way to figure out what happened when a segfault occurs.
>>
>>
> And use GDC because DMD's debug symbols on Linux are broken enough to
> crash GDB at times. GDC is generally flawless. <div
> class="gmail_quote">On Fri, Jun 8, 2012 at 11:29 AM, Jonathan M Davis
> <span dir="ltr"><<a href="mailto:jmdavisProg at gmx.com"
> target="_blank">jmdavisProg at gmx.com</a>></span> wrote:<br><blockquote
> class="gmail_quote" style="margin:0px 0px 0px
> 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-
width:1px;border-left-style:solid">
> 
> 
> On Friday, June 08, 2012 19:30:57 Jarl André"<br> <div><div><<a
> href="mailto:jarl.andre at gmail.com"
> target="_blank">jarl.andre at gmail.com</a>>@<a
> href="http://puremagic.com" target="_blank">puremagic.com</a> wrote:<br>
> > Evry single time I encounter them I yawn. It means using the
> next<br> > frickin hour to comment away code, add more log statements
> and<br> > try to eleminate whats creating the hell of bugz,
> segmantation<br> > fault. Why can't the compiler tell me anything
> else than the fact<br> > that i have referenced data that does not
> exist? Thanks I knew<br> > that. Now, please tell me where the error
> occured.... Jeezes.<br> <br>
> </div></div>Turn on core dumps and use gdb. It'll give a backtrace
> and allow you to look<br> at the state of the program when the segfault
> occured. That's pretty much the<br> standard way to figure out what
> happened when a segfault occurs.<br> </blockquote><div> </div><div>And
> use GDC because DMD's debug symbols on Linux are broken enough to
> crash GDB at times. GDC is generally flawless. </div></div>

Ah noes, HTML code again...



-- 
Dejan Lekic
  mailto:dejan.lekic(a)gmail.com
  http://dejan.lekic.org 


More information about the Digitalmars-d-learn mailing list