Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 1998 15:10:20 -0700
From:      Mike Smith <mike@smith.net.au>
To:        Glenn Johnson <gjohnson@nola.srrc.usda.gov>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: debugging 
Message-ID:  <199804292210.PAA00789@dingo.cdrom.com>
In-Reply-To: Your message of "Wed, 29 Apr 1998 15:19:38 CDT." <199804292019.PAA03017@symbion.srrc.usda.gov> 

next in thread | previous in thread | raw e-mail | index | archive | help
> I have some Fortran programs that compile and run fine using f77 (f2c/cc). If 
> I compile the code with g77 I get significantly better performance but some of 
> the programs will give the following message upon completion:
> 
> 	free(): warning: modified (page-) pointer

This is indicative of misbehaviour on the part of the program in 
question.  Are you reasonably certain that your program doesn't suffer 
from any off-by-one errors in array indexing, etc.?

> I get the correct results from the programs but I am concerned. How serious of 
> a problem is this? Am I correct in assuming that g77 is optimizing the code in 
> a way that is exposing a bug in the program code? Since using gdb on g77 
> compiled code is less than ideal, does anyone have an idea on how to go about 
> finding info on the problem(s)?

The problem is moderately serious in that it indicates that at least 
part of the program is performing incorrectly.  It is difficult to know 
whether the true problem lies in the Fortran code and is merely being 
revealed by the different compiler, or whether it is intrinsic to g77.

> I am not a skilled programmer but I would like to be able to provide 
> information to the program developers. The malloc warning does not occur under 
> Linux/g77 and so they may not be aware of any underlying bug(s). Thanks in 
> advance for your help.

The warning comes from the FreeBSD user-space memory manager, which is 
much more observant of this sort of behaviour than the Linux equivalent.

You might want to try setting some of the extra-touchy malloc options 
(see the malloc(3) manpage) to see if you can force the program to 
coredump when the corruption happens.  This may in turn lead you closer 
to the source of the problem.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804292210.PAA00789>