On Thursday 10 May 2007 7:36 am, kf wrote:
> Hi,
>
> I'm having a strange problem with free() with bounds checking turned
> on. Below is a small program that reproduces the problem. The program
> runs just fine if I don't use -b flag. My system is FC5. I'm using Rob
> Landley's tinycc-rl-1.0.0.tar.bz2 release.
>
> Here is the transcript:
I don't know why some mailers insert invisible whitespace (0xc2) into emails.
It's really annoying to cut and paste and then have to delete and recreate
all the whitespace because the compiler barfs trying to build it...
> $ cat t.c
> #include <stdlib.h>
>
> int main (int argc, char **argv)
> {
> char * s;
> size_t n = 1000000;
>
> s = malloc (n);
> if (!s) { printf("Failed\n"); exit (1); }
> free (s);
>
> return 0;
> }
> $ tcc -b t.c; a.out
> Segmentation fault
Worked fine for me when I just tried it.
Wouldn't you have to go ./a.out?
> $ gdb a.out
> GNU gdb Red Hat Linux (6.3.0.0-1.122rh)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain
conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i386-redhat-linux-gnu"...Using host
> libthread_db library "/lib/libthread_db.so.1".
*shrug* I haven't used windows in ages.
Can somebody else out there reproduce this?
> What's going on? Is it me, my system or tcc -b goofing up something?
Dunno. I can't reproduce it on Ubuntu 6.06.
Rob