Re: Help needed for migrating HPUX tool to Solaris



On Thu, 30 Nov 2006, arkutt@xxxxxxxxx wrote:

core dump while running the exe.

exe? You're not a Windoze programmer, are you? ;-)

t@1 (l@1) terminated by signal SEGV (no mapping at the fault address)
Current function is main
107 printf("Usage: %s Interface_ID [Message_ID]\n", argv[0]);
(dbx) where
current thread: t@1
=>[1] main(argc = 0, argv = (nil)), line 107 in "rcv_main.c"

My bet is that you're passing a null pointer to printf. ISTR that HPUX
thinks (or at least, thought) that it's a good idea to mask programmer
errors in this way (dereferncing a null pointer is always a programmer
error!). SOlaris doesn't, a core dump ensues.

To avoid, properly trap null pointers, so that you don't try to
dereference them.

HTH,

--
Rich Teer, SCSA, SCNA, SCSECA, OpenSolaris CAB member

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
.



Relevant Pages

  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... programmer is "free", o happy day, to use the stack copy, test itself, ... is the pointer that is being passed as the value ... static int matchhere(char *regexp, char *text) ...
    (comp.programming)
  • Re: Secure C library
    ... > mean that the programmer meant to do that. ... the attacker-supplied format string doesn't cause any of ... While array indices might not be transitory, ... > validate a pointer read in with %p in any meaningful way. ...
    (comp.std.c)
  • Re: Advice saught
    ... it's possible to divide a pointer by the sum of two chars. ... it's the C language standard the defines what is and isn't ... If a Forth programmer wants to gleefully do silly ... It's a powerful language ...
    (comp.lang.forth)
  • Re: gets() - dangerous?
    ... >> of your six month course spent learning about them. ... >> authoritative encyclopaedia article criticising formal methods. ... explicitly released by the programmer with free". ... As long as you have a pointer to it, ...
    (comp.lang.c)
  • Re: Fast and Safe C Strings: User friendly C macros to Declare and use C Strings.
    ... "good programmer" because of one mistake, ... It is also possible to err even with sscanf() though there is an added ... Subject: scanf question ... Your passing fscanfa pointer to a pointer to char. ...
    (comp.lang.c)