public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [Fwd: Re: bounds checking a GCC program]
@ 2006-12-06 14:35 Stuart Cracraft
  2006-12-06 15:09 ` Tim Prince
  0 siblings, 1 reply; 8+ messages in thread
From: Stuart Cracraft @ 2006-12-06 14:35 UTC (permalink / raw)
  To: help-gcc

Hi - I have a complex C program that needs to be bounds-checked
according to others in the particular sub-field.

Is there a bounds checker for GCC? I run GCC 4.1.

Thanks ahead,

Stuart

-------- Original Message --------
Subject: 	Re: bounds checking a GCC program
Date: 	Wed, 06 Dec 2006 09:23:51 -0500
From: 	Richard Stallman <rms@gnu.org>
Reply-To: 	rms@gnu.org
To: 	Stuart Cracraft <smcracraft@gmail.com>
References: 	<4575841E.2080208@cox.net>



Try help-gcc@gnu.org.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Fwd: Re: bounds checking a GCC program]
  2006-12-06 14:35 [Fwd: Re: bounds checking a GCC program] Stuart Cracraft
@ 2006-12-06 15:09 ` Tim Prince
  2006-12-06 15:43   ` Paulo J. Matos
  0 siblings, 1 reply; 8+ messages in thread
From: Tim Prince @ 2006-12-06 15:09 UTC (permalink / raw)
  To: Stuart Cracraft; +Cc: help-gcc

Stuart Cracraft wrote:
> Hi - I have a complex C program that needs to be bounds-checked
> according to others in the particular sub-field.
> 
> Is there a bounds checker for GCC? I run GCC 4.1.
> 
> Thanks ahead,
> 

Read about -fbounds-check in 'info gcc'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Fwd: Re: bounds checking a GCC program]
  2006-12-06 15:09 ` Tim Prince
@ 2006-12-06 15:43   ` Paulo J. Matos
  0 siblings, 0 replies; 8+ messages in thread
From: Paulo J. Matos @ 2006-12-06 15:43 UTC (permalink / raw)
  To: tprince; +Cc: Stuart Cracraft, help-gcc

On 12/6/06, Tim Prince <timothyprince@sbcglobal.net> wrote:
> Stuart Cracraft wrote:
> > Hi - I have a complex C program that needs to be bounds-checked
> > according to others in the particular sub-field.
> >
> > Is there a bounds checker for GCC? I run GCC 4.1.
> >
> > Thanks ahead,
> >
>
> Read about -fbounds-check in 'info gcc'
>

It seems to support only Java and Fortran, right?
-fbounds-check
For front-ends that support it, generate additional code to check that
indices used to access arrays are within the declared range. This is
currently only supported by the Java and Fortran 77 front-ends, where
this option defaults to true and false respectively.


Which doesn't fit OP requirements.

-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Fwd: Re: bounds checking a GCC program]
@ 2006-12-06 21:40 Stuart Cracraft
  0 siblings, 0 replies; 8+ messages in thread
From: Stuart Cracraft @ 2006-12-06 21:40 UTC (permalink / raw)
  To: Artūras Moskvinas; +Cc: help-gcc

Thankyou. This is good stuff.

---- "Artūras Moskvinas" <arturas.moskvinas@gmail.com> wrote: 
> 
> > The issue that I had to solve by arduously single-stepping
> > through a complex program (took a week) turned out to
> > be a pointer stepping outside of pre-determined places
> > within a single-dimensional array; that is, the pointer
> > stayed within the overall array but stepped outside of
> > determined areas within the array and this resulted
> > in the clobbering of areas elsewhere.
> > 
> > Having bounds checking that tells me when it stepped
> > out of the overall array would not have helped.
> > 
> > What is needed is something that says has it stepped
> > out of a pre-defined area within a single array.
> > 
> > My application is written in C and maintains its own
> > stack which is what was clobbered.
> > 
> 
> 
> Try www.valgrind.org for program debugging...
> 
> 
> Arturas M.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Fwd: Re: bounds checking a GCC program]
  2006-12-06 17:17 ` Perry Smith
@ 2006-12-06 17:23   ` Perry Smith
  0 siblings, 0 replies; 8+ messages in thread
From: Perry Smith @ 2006-12-06 17:23 UTC (permalink / raw)
  To: Perry Smith; +Cc: cracraft, help-gcc, tprince, Paulo J. Matos

On Dec 6, 2006, at 11:17 AM, Perry Smith wrote:

> On Dec 6, 2006, at 11:05 AM, Stuart Cracraft wrote:
>
>> The issue that I had to solve by arduously single-stepping
>> through a complex program (took a week) turned out to
>> be a pointer stepping outside of pre-determined places
>> within a single-dimensional array; that is, the pointer
>> stayed within the overall array but stepped outside of
>> determined areas within the array and this resulted
>> in the clobbering of areas elsewhere.
>>
>> Having bounds checking that tells me when it stepped
>> out of the overall array would not have helped.
>>
>> What is needed is something that says has it stepped
>> out of a pre-defined area within a single array.
>>
>> My application is written in C and maintains its own
>> stack which is what was clobbered.
>
> boost.org has a C++ implementation of a "subrange".  I've never  
> used it
> and do not know much about it.  But it sounds like (as in Pascal), you
> want you array indexes to be a subrange that is checked.  I think the
> boost library can help you there.

As usual, I was slightly confused.  Its not on the boost site but  
uses the boost
license.  The path to what I was talking about is here:

http://www.russel.org.uk/subrange.html

Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Fwd: Re: bounds checking a GCC program]
  2006-12-06 17:05 Stuart Cracraft
  2006-12-06 17:17 ` Perry Smith
@ 2006-12-06 17:23 ` Artūras Moskvinas
  1 sibling, 0 replies; 8+ messages in thread
From: Artūras Moskvinas @ 2006-12-06 17:23 UTC (permalink / raw)
  To: cracraft; +Cc: help-gcc


> The issue that I had to solve by arduously single-stepping
> through a complex program (took a week) turned out to
> be a pointer stepping outside of pre-determined places
> within a single-dimensional array; that is, the pointer
> stayed within the overall array but stepped outside of
> determined areas within the array and this resulted
> in the clobbering of areas elsewhere.
> 
> Having bounds checking that tells me when it stepped
> out of the overall array would not have helped.
> 
> What is needed is something that says has it stepped
> out of a pre-defined area within a single array.
> 
> My application is written in C and maintains its own
> stack which is what was clobbered.
> 


Try www.valgrind.org for program debugging...


Arturas M.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Fwd: Re: bounds checking a GCC program]
  2006-12-06 17:05 Stuart Cracraft
@ 2006-12-06 17:17 ` Perry Smith
  2006-12-06 17:23   ` Perry Smith
  2006-12-06 17:23 ` Artūras Moskvinas
  1 sibling, 1 reply; 8+ messages in thread
From: Perry Smith @ 2006-12-06 17:17 UTC (permalink / raw)
  To: cracraft; +Cc: help-gcc, tprince, Paulo J. Matos


On Dec 6, 2006, at 11:05 AM, Stuart Cracraft wrote:

> The issue that I had to solve by arduously single-stepping
> through a complex program (took a week) turned out to
> be a pointer stepping outside of pre-determined places
> within a single-dimensional array; that is, the pointer
> stayed within the overall array but stepped outside of
> determined areas within the array and this resulted
> in the clobbering of areas elsewhere.
>
> Having bounds checking that tells me when it stepped
> out of the overall array would not have helped.
>
> What is needed is something that says has it stepped
> out of a pre-defined area within a single array.
>
> My application is written in C and maintains its own
> stack which is what was clobbered.

boost.org has a C++ implementation of a "subrange".  I've never used it
and do not know much about it.  But it sounds like (as in Pascal), you
want you array indexes to be a subrange that is checked.  I think the
boost library can help you there.

Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Fwd: Re: bounds checking a GCC program]
@ 2006-12-06 17:05 Stuart Cracraft
  2006-12-06 17:17 ` Perry Smith
  2006-12-06 17:23 ` Artūras Moskvinas
  0 siblings, 2 replies; 8+ messages in thread
From: Stuart Cracraft @ 2006-12-06 17:05 UTC (permalink / raw)
  To: help-gcc, tprince, Paulo J. Matos

The issue that I had to solve by arduously single-stepping
through a complex program (took a week) turned out to
be a pointer stepping outside of pre-determined places
within a single-dimensional array; that is, the pointer
stayed within the overall array but stepped outside of
determined areas within the array and this resulted
in the clobbering of areas elsewhere.

Having bounds checking that tells me when it stepped
out of the overall array would not have helped.

What is needed is something that says has it stepped
out of a pre-defined area within a single array.

My application is written in C and maintains its own
stack which is what was clobbered.

Stuart


---- "Paulo J. Matos" <pocm@soton.ac.uk> wrote: 
> On 12/6/06, Tim Prince <timothyprince@sbcglobal.net> wrote:
> > Stuart Cracraft wrote:
> > > Hi - I have a complex C program that needs to be bounds-checked
> > > according to others in the particular sub-field.
> > >
> > > Is there a bounds checker for GCC? I run GCC 4.1.
> > >
> > > Thanks ahead,
> > >
> >
> > Read about -fbounds-check in 'info gcc'
> >
> 
> It seems to support only Java and Fortran, right?
> -fbounds-check
> For front-ends that support it, generate additional code to check that
> indices used to access arrays are within the declared range. This is
> currently only supported by the Java and Fortran 77 front-ends, where
> this option defaults to true and false respectively.
> 
> 
> Which doesn't fit OP requirements.
> 
> -- 
> Paulo Jorge Matos - pocm at soton.ac.uk
> http://www.personal.soton.ac.uk/pocm
> PhD Student @ ECS
> University of Southampton, UK

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-12-06 21:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06 14:35 [Fwd: Re: bounds checking a GCC program] Stuart Cracraft
2006-12-06 15:09 ` Tim Prince
2006-12-06 15:43   ` Paulo J. Matos
2006-12-06 17:05 Stuart Cracraft
2006-12-06 17:17 ` Perry Smith
2006-12-06 17:23   ` Perry Smith
2006-12-06 17:23 ` Artūras Moskvinas
2006-12-06 21:40 Stuart Cracraft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).