From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 2845178E8F for ; Mon, 5 Jan 2015 08:26:35 -0800 (PST) Received: by mail-wi0-f176.google.com with SMTP id ex7so3628778wid.15 for ; Mon, 05 Jan 2015 08:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wHAd/X9Ec/QOEyB/aimx4YFOPBwjt1PrjCO6qd64nx0=; b=B2dVghxfxmjMqgU2qCv5RJBLk4/UTmAGIQduebQ6Ars9htd/3lEoCbf604OlBZqflL pbdvbHs+sj67cBhMYPjxRYIPGoInPTgOqYkBXYrCBykgrpAqeRMZS6Q//Wib6yeHRpp6 6+VIIyvJfuc/6BXGdAA1RLSQnLOnx/rz3r1mq4RBzf/OuGhEEZVkQpoxq8rsWOmsSn4b BCCBg8KXV1L5FN2PNndA3EJOyZ4wCYQBv9qBxTIPLcUrGatvyyorgp44W2aipFEXEJwJ 6kWZ/cKrgIvFtlgjUwZGdE42a469hLF91L4koulHdNmtFmsapY2uw9mIv0QrR10jzTsB 1EBA== X-Received: by 10.194.192.167 with SMTP id hh7mr141324709wjc.111.1420475049100; Mon, 05 Jan 2015 08:24:09 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id ej10sm10525321wib.2.2015.01.05.08.24.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jan 2015 08:24:08 -0800 (PST) Date: Mon, 5 Jan 2015 16:24:00 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20150105162400.GA14385@toaster.adamthompson.me.uk> References: <20150004113025.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <20150004113025.eklhad@comcast.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] realloc null pointer X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2015 16:26:35 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 04, 2015 at 11:30:25AM -0500, Karl Dahlke wrote: > This horrible long url >=20 > https://maps.google.com/maps?hl=3Den&gbv=3D1&ie=3DUTF-8&fb=3D1&gl=3Dus&ft= id=3D0x8824960112ae4ca1:0xe09071020c10f93d&q=3D2660+Dixie+Hwy,+Waterford+To= wnship,+MI+48328&ei=3DvGGpVOrBBoqsyQSt0oGoAw&ved=3D0CBQQ8gEoADAA&output=3Dc= lassic&dg=3Dbrw >=20 > 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. >=20 > 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 =3D 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 nev= er 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 reso= urce limits. Tbh I'd never do this, I'd use gdb and a build with debug symbols. Cheers, Adam. --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUqrqgAAoJELZ22lNQBzHOyagIAIyqGXMUfpBGm+aNQi0OI/+4 SHxDf8YOCErCqJP2Sli8+j+sxtxgz7S17UR46vBPCD8BQVScaiFKnvzcAdUzE7hu 1SWXudnYYt8wb/qQP76r7lYqO6mjX/cZKurKc6zeeEvGbLqk6SqOXM6oEuX6s6xd nlWGaC9Bk2U+H9AmULOaeDk8/glkxq2fNypcILkBlHIlDLMPtTK7SR/n4DjrWIC+ oSdpVkLLzLojMWQQdizNZTXsdUVlxugQMA1o8XJxypzmMAQY49oJTKTRBpGxx5Pr zeKI5XwPPDWxtzuDbIlFfRAMn6G+pTPLB0UPkhK6TQBE2U7UVOulqpt6itqp7U0= =yfZb -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--