edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] realloc null pointer
Date: Mon, 5 Jan 2015 16:24:00 +0000	[thread overview]
Message-ID: <20150105162400.GA14385@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <20150004113025.eklhad@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

On Sun, Jan 04, 2015 at 11:30:25AM -0500, Karl Dahlke wrote:
> This horrible long url
> 
> https://maps.google.com/maps?hl=en&gbv=1&ie=UTF-8&fb=1&gl=us&ftid=0x8824960112ae4ca1:0xe09071020c10f93d&q=2660+Dixie+Hwy,+Waterford+Township,+MI+48328&ei=vGGpVOrBBoqsyQSt0oGoAw&ved=0CBQQ8gEoADAA&output=classic&dg=brw
> 
> Produces a realloc null pointer fatal error on my system.
> I ran it with db5, even db7, but still not clrear what is going on.
> 
> I check for this null pointer and exit gracefully, but maybe I shouldn't.
> Maybe I should check and print the error, then deliberately set *s = 55,
> to get the null pointer dereference and the stack trace.

No you shouldn't, unless you only ever do it for debugging purposes and never submit it.
I've never come across a situation where forcing a segfault is good,
particularly as stack traces don't always result in any cace,
it depends on the environment.
For example, sometimes it'll just say there's been a segmentation fault,
sometimes it'll do a core dump, sometimes it'll print a stack trace and in some
cases you get the stack trace and memory map.
It really depends on libraries used, environment variable settings and resource limits.
Tbh I'd never do this, I'd use gdb and a build with debug symbols.

Cheers,
Adam.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-01-05 16:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04 16:30 Karl Dahlke
2015-01-05 16:24 ` Adam Thompson [this message]
2015-01-05 16:41 Karl Dahlke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150105162400.GA14385@toaster.adamthompson.me.uk \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).