Nick Guenther wrote:
On 6/3/06, Kroty <[EMAIL PROTECTED]> wrote:
Hi folks,

I'm running OpenBSD 3.9 and I have a program that is giving
some unexpected output.
But, if I run it with MALLOC_OPTIONS="G", I works fine.

What does it mean? I've read the malloc(3) manpage, but
I don't quite understand what the G option does.

Could you please give me some more details on what it does
or what would it be useful for?


First, it's always helpful to provide details of problems. What
program is it? Did you write it yourself? Show us some sample input &
output (and any other relevant input, like `ls -l`).

Second, know that a 'page' is a certain unit of RAM with some special
properties (like that you can lock down an entire page at once). Like
you've read, malloc puts "guard" pages around any allocated memory
larger than a page size when given the G option; these pages are not
for using, they are for detecting if the program reads out.

I'm guessing there's a bug in the program, but I'm at a loss to figure
out what it could be that's only triggered when the guards are _on_.
The only difference guard pages should make is that the program
crashes if it reads too far.

-Nick


Hi,

thanks for your reply.

I've run the program with MALLOC_OPTIONS="AFPG" and it doesn't
crash at all.
In fact, it works fine if I run it with the "G", but if I run it
with "g", it gives some unexpected output, but it doesn't crash
neither.

I did write the program myself. It's obvious there's a bug,
but I cannot find it. :(

Thanks

Reply via email to