* [Edbrowse-dev] realloc null pointer
@ 2015-01-04 16:30 Karl Dahlke
2015-01-05 16:24 ` Adam Thompson
0 siblings, 1 reply; 3+ messages in thread
From: Karl Dahlke @ 2015-01-04 16:30 UTC (permalink / raw)
To: Edbrowse-dev
[-- Attachment #1: Type: text/plain, Size: 598 bytes --]
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.
Karl Dahlke
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Edbrowse-dev] realloc null pointer
2015-01-04 16:30 [Edbrowse-dev] realloc null pointer Karl Dahlke
@ 2015-01-05 16:24 ` Adam Thompson
0 siblings, 0 replies; 3+ messages in thread
From: Adam Thompson @ 2015-01-05 16:24 UTC (permalink / raw)
To: Karl Dahlke; +Cc: Edbrowse-dev
[-- 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 --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Edbrowse-dev] realloc null pointer
@ 2015-01-05 16:41 Karl Dahlke
0 siblings, 0 replies; 3+ messages in thread
From: Karl Dahlke @ 2015-01-05 16:41 UTC (permalink / raw)
To: Edbrowse-dev
> I've never come across a situation where forcing a segfault is good,
Right. I understand. Thanks.
Karl Dahlke
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-05 16:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-04 16:30 [Edbrowse-dev] realloc null pointer Karl Dahlke
2015-01-05 16:24 ` Adam Thompson
2015-01-05 16:41 Karl Dahlke
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).