[Tinycc-devel] bounds checking does not work any more after last commit

2019-12-10 Thread Herman ten Brugge via Tinycc-devel
When doing on x86_64: cd tests; make btest I get a core dump: #0  tcc_add_bcheck (s1=0x46a2a0) at x86_64-gen.c:665 #1  0x004227aa in tcc_add_runtime (s1=0x46a2a0) at tccelf.c:1323 #2  0x00424d6e in elf_output_file (s1=0x46a2a0, filename=0x46b540 "a") at tccelf.c:2260 #3  0x0

Re: [Tinycc-devel] bounds checking

2019-12-10 Thread Christian Jullien
intf("ll: %lx %x\n", ll, guard); // truncated printf("ll: %llx %x\n", ll, guard); // OK } -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Edmund Grimley Evans Sent: Tuesday, December 10, 2019 23:15 To:

Re: [Tinycc-devel] bounds checking

2019-12-10 Thread Edmund Grimley Evans
> #define pv(m) printf(sizeof (s->m + 0) == 8 ? "%llx\n" : "%x\n", s->m) What's wrong with printf("%llx\n", (unsigned long long)s->m)? ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Re: [Tinycc-devel] bounds checking

2019-12-10 Thread grischka
Herman ten Brugge via Tinycc-devel wrote: I just committed a large patch that fix a lot of bounds checking problems. Hmm, is this supposed to find something, too? For example: { char a[10], b[10], c; b[15] = 16; (&c)[20] = 21; free(a); Seems to pass without any complain. Btw

Re: [Tinycc-devel] bounds checking

2019-12-10 Thread Christian Jullien
inycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Herman ten Brugge via Tinycc-devel Sent: Tuesday, December 10, 2019 09:09 To: jull...@eligis.com; tinycc-devel@nongnu.org Cc: Herman ten Brugge Subject: Re: [Tinycc-devel] bounds checking Oops. You reported 2 problem

Re: [Tinycc-devel] bounds checking

2019-12-10 Thread Herman ten Brugge via Tinycc-devel
https://sourceforge.net/projects/wintcc/ so feel free to modify wine directory I created for you. I can of course do it if you like. C. -Original Message- From: Herman ten Brugge [mailto:hermantenbru...@home.nl] Sent: Tuesday, December 10, 2019 08:48 To: jull...@eligis.com; tinycc-devel@n

Re: [Tinycc-devel] bounds checking

2019-12-10 Thread Herman ten Brugge via Tinycc-devel
inycc/lib' make: *** [Makefile:246: libtcc1.a] Error 2 -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Herman ten Brugge via Tinycc-devel Sent: Tuesday, December 10, 2019 08:26 To: Herman ten Brugge via Tinycc-devel Cc:

Re: [Tinycc-devel] bounds checking

2019-12-10 Thread Christian Jullien
rman ten Brugge [mailto:hermantenbru...@home.nl] Sent: Tuesday, December 10, 2019 08:48 To: jull...@eligis.com; tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] bounds checking I hope I fixed this now. I attached the wine Makefile I used. Could you update sourceforge? Regards, Herma

Re: [Tinycc-devel] bounds checking

2019-12-09 Thread Herman ten Brugge via Tinycc-devel
[mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Herman ten Brugge via Tinycc-devel Sent: Tuesday, December 10, 2019 08:26 To: Herman ten Brugge via Tinycc-devel Cc: Herman ten Brugge Subject: [Tinycc-devel] bounds checking I just committed a large patch that fix a lot of b

Re: [Tinycc-devel] bounds checking

2019-12-09 Thread Christian Jullien
g directory '/home/jullien/tinycc/lib' make: *** [Makefile:246: libtcc1.a] Error 2 -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Herman ten Brugge via Tinycc-devel Sent: Tuesday, December 10, 2019 08:26 To: Herman ten Br

[Tinycc-devel] bounds checking

2019-12-09 Thread Herman ten Brugge via Tinycc-devel
I just committed a large patch that fix a lot of bounds checking problems. I tested the bounds checking code now works on x86_64 and i386 on linux and windows. The test/tests2 directory can now be tested with -b enabled. There are a lot of changes (not complete): - split up bcheck.c from libtc

Re: [Tinycc-devel] bounds checking with tcc

2019-12-05 Thread Michael Matz
Hello, On Wed, 4 Dec 2019, Herman ten Brugge wrote: > I think I have a working patch now. See attachment. > The code runs on i386 and x86_64 on linux for large projects I have. > > I found some bugs when updating the i386 code. > The bugs are in the testcases in the patch. > The test/boundtest.c

Re: [Tinycc-devel] bounds checking with tcc

2019-12-05 Thread ian
Hi. Wondering why you think a mailing-list is a review/tests review notepad. Not under-rating your work, it's very fine, but why not a private chat ? Or only when tested a simple comment on a fork ? Btw, I'd be glad to test it on x86 32 bits linux 5.0. Regards, ian Le 02/12/2019 à 22:46, Herman

Re: [Tinycc-devel] bounds checking with tcc

2019-12-04 Thread Herman ten Brugge via Tinycc-devel
I think I have a working patch now. See attachment. The code runs on i386 and x86_64 on linux for large projects I have. I found some bugs when updating the i386 code. The bugs are in the testcases in the patch. The test/boundtest.c code works for both targets. See below for the main changes. I

Re: [Tinycc-devel] bounds checking with tcc

2019-12-02 Thread Herman ten Brugge via Tinycc-devel
Little updated patch. Still needs more work. Regards,     Herman On 2019-12-02 18:24, Herman ten Brugge wrote: Hello, I did some debugging with bouds-checking and came up with attached patch. I seriously doubt any one did use bounds checking in a large project before. Currently I can use t

Re: [Tinycc-devel] bounds checking with tcc

2019-12-02 Thread Herman ten Brugge via Tinycc-devel
Hello, I did some debugging with bouds-checking and came up with attached patch. I seriously doubt any one did use bounds checking in a large project before. Currently I can use this now in a large multi threaded project. It still needs some more testing so do not apply the patch yet. I disab

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Herman ten Brugge via Tinycc-devel
Tinycc-devel Sent: Thursday, November 28, 2019 18:16 To: Michael Matz Cc: Herman ten Brugge; Herman ten Brugge via Tinycc-devel Subject: Re: [Tinycc-devel] bounds checking with tcc On 2019-11-28 17:41, Michael Matz wrote: Hello again, but to maybe be a bit more constructive: On Thu, 28 Nov 2019,

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Herman ten Brugge via Tinycc-devel
Hello, On 2019-11-28 17:08, Michael Matz wrote: Hello, On Wed, 27 Nov 2019, Herman ten Brugge wrote: Exactly. So we need to make a decision if we want that extension of the bounds-checking feature in TCC under these constraints. In my opinion we don't want to, but I won't stand in the way o

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Michael Matz
Hello again, but to maybe be a bit more constructive: On Thu, 28 Nov 2019, Michael Matz wrote: > > I fixed this with some push/pop trickery. I see, yeah, expanding calls during calls is broken as gfunc_call in the generators doesn't generally leave a trace in vtop[] which registers are curren

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Christian Jullien
; Herman ten Brugge via Tinycc-devel Subject: Re: [Tinycc-devel] bounds checking with tcc On 2019-11-28 17:41, Michael Matz wrote: > Hello again, > > but to maybe be a bit more constructive: > > On Thu, 28 Nov 2019, Michael Matz wrote: > >>> I fixed this with some push/

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Herman ten Brugge via Tinycc-devel
On 2019-11-28 17:41, Michael Matz wrote: Hello again, but to maybe be a bit more constructive: On Thu, 28 Nov 2019, Michael Matz wrote: I fixed this with some push/pop trickery. I see, yeah, expanding calls during calls is broken as gfunc_call in the generators doesn't generally leave a trac

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Michael Matz
Hello, On Wed, 27 Nov 2019, Herman ten Brugge wrote: > > Exactly. So we need to make a decision if we want that extension of the > > bounds-checking feature in TCC under these constraints. In my opinion we > > don't want to, but I won't stand in the way of extending it to locals (but > > then t

Re: [Tinycc-devel] bounds checking with tcc

2019-11-27 Thread Herman ten Brugge via Tinycc-devel
On 2019-11-27 18:17, Michael Matz wrote: Hello Herman, On Tue, 26 Nov 2019, Herman ten Brugge wrote: As TCC is single pass, at the declaration of locali you can't know that eventually the address is taken. So, as in your patch, you have to always generate code assuming that the address will b

Re: [Tinycc-devel] bounds checking with tcc

2019-11-27 Thread Michael Matz
Hello Herman, On Tue, 26 Nov 2019, Herman ten Brugge wrote: > > As TCC is single pass, at the declaration of locali you can't know that > > eventually the address is taken. So, as in your patch, you have to always > > generate code assuming that the address will be eventually taken, i.e. for > >

Re: [Tinycc-devel] bounds checking with tcc

2019-11-25 Thread Herman ten Brugge via Tinycc-devel
On 2019-10-31 15:11, Michael Matz wrote: Hi, On Tue, 29 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: I tried bound checking with tcc and found some problems. (See attached patch). The bound checking code is fairly incomplete, and some of it can't really be fixed without more aggressive

Re: [Tinycc-devel] bounds checking with tcc

2019-10-31 Thread Michael Matz
Hi, On Tue, 29 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: > I tried bound checking with tcc and found some problems. (See attached > patch). The bound checking code is fairly incomplete, and some of it can't really be fixed without more aggressive changes in TCC, my private opinion is

[Tinycc-devel] bounds checking with tcc

2019-10-28 Thread Herman ten Brugge via Tinycc-devel
I tried bound checking with tcc and found some problems. (See attached patch). First the bounds checking code is included in shared objects and in the application. This means that for example malloc and friends are redirected twice. I fixed this in tccelf.c Second problem is that only arrays

Re: [Tinycc-devel] Bounds checking not working?

2009-06-13 Thread Joshua Phillips
Hmm, interesting. Wouldn't raise(SIGSEGV) be a better action to take? On Saturday 13 June 2009 12:20:19 grischka wrote: > Arnold Meijster wrote: > > I will be teaching a course in C programming at the university > > and was looking for a C compiler/interpreter that does > > bound checking (for fir

Re: [Tinycc-devel] Bounds checking not working?

2009-06-13 Thread grischka
Arnold Meijster wrote: I will be teaching a course in C programming at the university and was looking for a C compiler/interpreter that does bound checking (for first year's students that seems to be a good idea). After some googling, I found tcc. It seems to be perfect for what I want, ... D

off-topic: was: Re: [Tinycc-devel] Bounds checking not working?

2009-06-13 Thread Jens Thiele
Arnold Meijster writes: > Hi, > > I will be teaching a course in C programming at the university > and was looking for a C compiler/interpreter that does > bound checking (for first year's students that seems to be a good idea). you might wish to try valgrind jens ___

Re: [Tinycc-devel] Bounds checking not working?

2009-06-12 Thread Joshua Phillips
I have a feeling bounds checking was broken a while ago, but don't quote me on that. On Friday 12 June 2009 15:06:26 Arnold Meijster wrote: > Hi, > > I just subscribed to the devel-list so don't flame me if > I write this to the wrong list, please. > > I will be teaching a course in C programming

[Tinycc-devel] Bounds checking not working?

2009-06-12 Thread Arnold Meijster
Hi, I just subscribed to the devel-list so don't flame me if I write this to the wrong list, please. I will be teaching a course in C programming at the university and was looking for a C compiler/interpreter that does bound checking (for first year's students that seems to be a good idea). Af

[Tinycc-devel] Bounds checking of for Windows version?

2008-01-17 Thread Elmar Vogt
Dear all, Is there a chance that the bounds checking of Tiny CC is not implemented in the Windows version? I tried to compile a few sample programs, but the compiler apparently doesn't recognize the "-b" option... Any hints? Thanks in advance. Cheers, Elmar, Tiny CC newbie -- GMX FreeM

Re: [Tinycc-devel] bounds checking bug?

2007-05-11 Thread Rob Landley
[ Apparently I left this message unsent when I suspended my laptop yesterday... Might now be stale, dunno. ] On Thursday 10 May 2007 2:28 pm, kf wrote: > > Worked fine for me when I just tried it. > > So, no tcc's fault then? Not solely our fault, but we may be partially responsible. All I kn

Re: [Tinycc-devel] bounds checking bug?

2007-05-11 Thread Rob Landley
On Friday 11 May 2007 6:25 am, kf wrote: > I forgot to mention that this test case runs ok sometimes, about once > in ten runs... Yeah, that would be an important thing to mention. > tcc was compiled with gcc 4.1.1, but the problem remains if I compile > it with itself. Good data point, thanks.

Re: [Tinycc-devel] bounds checking bug?

2007-05-11 Thread kf
I forgot to mention that this test case runs ok sometimes, about once in ten runs... I also tested this in another machine, also running FC5, with same results... tcc was compiled with gcc 4.1.1, but the problem remains if I compile it with itself. K On 5/10/07, Rob Landley <[EMAIL PROTECTED]> w

Re: [Tinycc-devel] bounds checking bug?

2007-05-10 Thread kf
On 5/10/07, Rob Landley <[EMAIL PROTECTED]> 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 i

Re: [Tinycc-devel] bounds checking bug?

2007-05-10 Thread Rob Landley
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

[Tinycc-devel] bounds checking bug?

2007-05-10 Thread kf
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: $ cat t.c #inc