From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: GCC c-program execution problem Date: Tue, 01 Jul 1997 20:11:21 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 41 Message-ID: <33B96469.3133@cs.com> References: <33B8D043 DOT 6211 AT ship DOT samsung DOT co DOT kr> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp107.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk H. J. Son wrote: > > And compiling my program which already tested by another compiler, > > without errors, but frequently refuse to execute > > by printing to screen unusual message as follows: What is your program trying to do? The most common causes of segmentation violations when running DJGPP programs are the following: - NULL pointer dereference (only when running in DOS with cwsdpmi) - Attempting to directly access memory-mapped devices in conventional memory, such as the text-mode or graphics-mode video memory. If your problem is the former, you have buggy code and need to fix it. Try using the '-Wall' switch when compiling to catch common mistakes. If your problem is the latter, then you need to get the DJGPP Frequently Asked Questions list (v2/faq210b.zip from SimTel) and read chapters 10 and 18, which document how to access conventional memory from protected mode programs. If your problem is not listed here, please break your source code down to the smallest fragment necessary to generate the error, and post that fragment along with 1) a 'symified' copy of the crash traceback, 2) the exact command line you use to compile, and 3) the exact output of gcc if you got any warnings when compiling with '-Wall'. See chapter 6 of the FAQ for information on capturing the output of DJGPP programs. Thanks. -- John M. Aldrich, aka Fighteer I -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d- s+:- a-->? C++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---) O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++ e(*)>++++ h!() !r !y+() ------END GEEK CODE BLOCK------