Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!phri!dasys1!manes From: manes@dasys1.UUCP Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: C Programs and sdb Message-ID: <2143@dasys1.UUCP> Date: Fri, 4-Dec-87 00:49:56 EST Article-I.D.: dasys1.2143 Posted: Fri Dec 4 00:49:56 1987 Date-Received: Mon, 7-Dec-87 04:37:57 EST References: <161@mccc.UUCP> Reply-To: manes@dasys1.UUCP (Steve Manes) Organization: Datamerica Systems, NYC Lines: 32 Keywords: debug C Xref: utgpu comp.lang.c:5410 comp.unix.questions:4643 In article <161@mccc.UUCP> pjh@mccc.UUCP (Peter J. Holsberg) writes: > >I wrote and compiled a large program and when it executes, I get a core >dump. (SysVr3 on a 3B2/400) When I try to use sdb, it refers me to a >nonexistent 'strncmp.c' file, and says: > > 0x80802d0b in strncpy:No lines in file > *Memory Fault (11) (sig 11) > at > 0x80802d0b in strncpy:No lines in file > >What could be wrong??? Don't forget that C libraries also reference themselves and that a core dump on something like 'strncpy' or 'strcmp' may not be one that you put in your source file but called from something like printf(). The only thing you can really do is single-step through your code until the program dumps and see what library function caused the problem (after acertaining that your code is beyond criticism :^) Then check your arguments VERY closely and make sure that the function is getting all the arguments that it expects and of the proper type. Since you're getting a segmentation violation (sig 11) also check to make sure that you're linking withthe correct model (the linker SHOULD catch this). This wouldn't be Microport V/386 you're using, would it? -- +----------------------------------------------------------------------- + Steve Manes Roxy Recorders, Inc. NYC + decvax!philabs!cmcl2!hombre!magpie!manes Magpie BBS: 212-420-0527 + uunet!iuvax!bsu-cs!zoo-hq!magpie!manes 300/1200/2400