bugTiny C Compiler - Bugs: bug #14958, Option `-b' doesn't work for...

 
 

bug #14958: Option `-b' doesn't work for compiled programs

Submitter:  None
Submitted:  Fri 11 Nov 2005 06:01:45 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 29 Mar 2015 09:13:11 AM UTC, comment #3: 

A patch is submitted to the mob: fix for the bcheck.o (bug #14958)
And a segmentation fault must be happend when v[10] = 0; This is desired behavior: we use an invalid pointer to catch a bug early. A debugger can show an error point in the program.

Sergey Korshunoff <seyko>
Fri 19 Oct 2012 03:17:19 PM UTC, comment #2: 

I believe the second issue posted was related to STT_GNU_IFUNC relocations missing in tcc. This has already been fixed.

Thomas Preud'homme <robotux>
Group Member
Tue 19 Oct 2010 10:15:11 AM UTC, comment #1: 

related  problem ?

linux 2.6.35-22-generic
tcc version 0.9.25

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[])
{
char *pollo= "ppooo";
printf("%s", pollo);
return 0;
}

calling tcc -b (mem/ptr bounds checker) fails :
tcc: undefined symbol 'memset'
tcc: undefined symbol 'memmove'
tcc: undefined symbol 'memcpy'

whitout -b, it works fine. why ?
Massimo
massimo.sala.71 / gmail.com

Massimo Sala <massimosala>
Fri 11 Nov 2005 06:01:45 PM UTC, original submission:  

Example (test.c):

#include <stdio.h>

int main ()
{
    int v[10];
    v[10] = 1; /* Enforcing a seg-fault here ... */
    printf ("v has %d elements.\n", sizeof(v) / sizeof(int));
    return 0;
}

When executing `tcc -b -run test.c' the the runtime error message is printed as expected (but the program still aborts with a seg-fault), but when compiling `test.c' (using `tcc -b test.c -o test') and then executing the program `test' (`./test'), the execution leads to the usual `segmentation fault' - much like if `-b' was never supplied to the compiler. (This problem occurs likewise on SuSE-9.x and Debian 3.x .)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by seyko (Posted a comment)
  • -email is unavailable- added by robotux (Posted a comment)
  • -email is unavailable- added by massimosala (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code