tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] bounds checking bug?


From: kf
Subject: Re: [Tinycc-devel] bounds checking bug?
Date: Thu, 10 May 2007 21:28:58 +0300

On 5/10/07, Rob Landley <address@hidden> wrote:
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...

(Hmm, no barfing here, no matter which email client I use to copy paste 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.

So, no tcc's fault then?

Wouldn't you have to go ./a.out?

No, because . happens to be in my path...

> $ 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.

? I have never used windows.

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.

Thanks anyways...

kf


Rob






reply via email to

[Prev in Thread] Current Thread [Next in Thread]