Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #26309

Re: Failing Malloc

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: Failing Malloc
Date 2012-09-13 16:05 -0400
Organization A noiseless patient Spider
Message-ID <50523C84.5060204@verizon.net> (permalink)
References (4 earlier) <abcgjrF1taiU4@mid.individual.net> <50511364.5030408@verizon.net> <abcmddF1taiU5@mid.individual.net> <5052155F.5090302@verizon.net> <abeqv3F1taiU7@mid.individual.net>

Show all headers | View raw


On 09/13/2012 03:37 PM, Ian Collins wrote:
...
> I think most of this stuff is OS specific and there's a big whole in 

"hole"?

> POSIX where it should be.
> 
> I mainly use Solaris which has a family of stack reading functions:
> 
> http://docs.oracle.com/cd/E23824_01/html/821-1465/walkcontext-3c.html#scrolltoc
> 
> Googling for "solaris walkcontext" will find the Linux near equivalents.

Those functions seem to be missing something, that I expected to be
missing, that would be necessary in order to produce output containing
information comparable to that produced by my current error messages. I
compared that information to an "annotated stack trace". The "annotated"
is important: it refers to the fact that for every function in the call
stack, the error messages include the values of all scalar non-pointer
parameters, and the text of any strings pointed at by character pointer
input parameters.

Less consistently, if an input pointer parameter points at a struct
containing a single member that identifies what the struct contents
represent, the message will sometimes include the value of that member
(or of the string it points at). Example: one of the packages I use
provides a file handle structure that allows me to print out
file_handle->filename.

gdb can provide similar information when debugging a program compiled
with -g, but when I followed that URL, it was not clear to me that the
walkcontext routines have any features that would enable such annotation.

Another aspect of the "annotation" is that the error messages also
contain the value of the loop index for any loop containing the code
that generates the error message (or, more usefully, a string associated
with that index value, if one is available), but that's functionality I
could not reasonably expect a stack-walking routine to provide.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Failing Malloc Eric <nospam@nospam.com> - 2012-09-12 20:07 +0000
  Re: Failing Malloc Xavier Roche <xroche@free.fr.NOSPAM.invalid> - 2012-09-12 22:12 +0200
    Re: Failing Malloc William Ahern <william@wilbur.25thandClement.com> - 2012-09-12 14:25 -0700
  Re: Failing Malloc Andrew Cooper <andrew@nospam.example.com> - 2012-09-12 21:21 +0100
    Re: Failing Malloc Eric <nospam@nospam.com> - 2012-09-12 20:34 +0000
      Re: Failing Malloc Paul N <gw7rib@aol.com> - 2012-09-12 13:46 -0700
        Re: Failing Malloc Eric <nospam@nospam.com> - 2012-09-13 20:21 +0000
          Re: Failing Malloc Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-13 17:31 -0400
          Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-13 17:57 -0400
      Re: Failing Malloc John Gordon <gordon@panix.com> - 2012-09-12 20:55 +0000
        Re: Failing Malloc William Ahern <william@wilbur.25thandClement.com> - 2012-09-12 14:33 -0700
        Re: Failing Malloc falk@rahul.net (Edward A. Falk) - 2012-09-13 22:43 +0000
      Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-12 17:37 -0400
      Re: Failing Malloc Johann Klammer <klammerj@NOSPAM.a1.net> - 2012-09-13 08:57 +0200
  Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-12 17:20 -0400
    Re: Failing Malloc Ian Collins <ian-news@hotmail.com> - 2012-09-13 09:27 +1200
      Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-12 17:56 -0400
        Re: Failing Malloc Ian Collins <ian-news@hotmail.com> - 2012-09-13 10:28 +1200
          Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-12 18:57 -0400
            Re: Failing Malloc William Ahern <william@wilbur.25thandClement.com> - 2012-09-12 16:21 -0700
            Re: Failing Malloc Ian Collins <ian-news@hotmail.com> - 2012-09-13 12:07 +1200
              Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-13 13:18 -0400
                Re: Failing Malloc Ian Collins <ian-news@hotmail.com> - 2012-09-14 07:37 +1200
                Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-13 16:05 -0400
                Re: Failing Malloc William Ahern <william@wilbur.25thandClement.com> - 2012-09-13 14:21 -0700
                Re: Failing Malloc James Kuyper <jameskuyper@verizon.net> - 2012-09-13 17:38 -0400
                Re: Failing Malloc William Ahern <william@wilbur.25thandClement.com> - 2012-09-13 14:03 -0700
                Re: Failing Malloc Ian Collins <ian-news@hotmail.com> - 2012-09-15 10:01 +1200
            Re: Failing Malloc Philip Lantz <prl@canterey.us> - 2012-09-14 02:50 -0700
  Re: Failing Malloc Kaz Kylheku <kaz@kylheku.com> - 2012-09-12 21:36 +0000
  Re: Failing Malloc Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-12 17:41 -0400
  Re: Failing Malloc Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-09-12 16:07 -0600
    Re: Failing Malloc "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-09-12 16:03 -0700
  Re: Failing Malloc Kenneth Brody <kenbrody@spamcop.net> - 2012-09-12 19:24 -0400
  Re: Failing Malloc The Great Firewall of China Blue <chine.bleu@yahoo.com> - 2012-09-12 16:34 -0700
  Re: Failing Malloc Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-09-13 00:14 -0700

csiph-web