From owner-freebsd-questions Tue May 5 00:37:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA13279 for freebsd-questions-outgoing; Tue, 5 May 1998 00:37:46 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gwdu60.gwdg.de (gwdu60.gwdg.de [134.76.10.60]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA13256 for ; Tue, 5 May 1998 00:37:35 -0700 (PDT) (envelope-from kheuer@gwdu60.gwdg.de) Received: from localhost (kheuer@localhost) by gwdu60.gwdg.de (8.8.5/8.8.5) with SMTP id JAA28586; Tue, 5 May 1998 09:35:31 +0200 (CEST) Date: Tue, 5 May 1998 09:35:31 +0200 (CEST) From: Konrad Heuer To: Doug Lo cc: freebsd-questions@FreeBSD.ORG Subject: Re: What does 'segment fault' mean? In-Reply-To: <354EA035.75EE752@ms11.hinet.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 5 May 1998, Doug Lo wrote: > I'd be glad if anyone could explain one aspect of unix is puzzling me: > When I run some programs, it got an error: "Segment fault". > I don't know how/why it happened, would anyone tell me the 'Segment > fault' mean? A program running as a UNIX process uses different logical segments of the virtual address space. Under FreeBSD with the traditional a.out binaries there are following segments: - code segment (program code) - data segment (initialized data) - bss segment (uninitialized static data) - stack and heap segment (dynamic data) If a program calculates a bad data address and tries to use it this may cause a segemntation fault since the system protects segments against invalid access. For example, the code segement is read-only - it can't be modified by accidently storing data there. If the address is completely outside the process address space no access will be allowed to protect one process against the other. Konrad Heuer // Gesellschaft fuer wissenschaftliche Datenverarbeitung mbH // Goettingen (GWDG), Am Fassberg, D-37077 Goettingen, Germany // // kheuer@gwdu60.gwdg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message