Re: [Tinycc-devel] Tinycc for ARM help needed !

2014-04-03 Thread Domingo Alvarez Duarte
Thanks for the help !

Testing on my linux X86_64 give me this error:

-
~/dev/c/tinycc/tests$ ../tcc -B.. -I.. -I.. -I../include
-DCONFIG_LDDIR=\lib\ -DCONFIG_MULTIARCHDIR=\x86_64-linux-gnu\
-DTCC_TARGET_X86_64 -DONE_SOURCE -o tcc.tcc ../tcc.c -ldl

~/dev/c/tinycc/tests$ valgrind --tool=memcheck ./tcc.tcc
==5044== Memcheck, a memory error detector
==5044== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==5044== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==5044== Command: ./tcc.tcc
==5044==

valgrind: m_debuginfo/readelf.c:2352 (vgModuleLocal_read_elf_debug_info):
Assertion 'crc_offset + sizeof(UInt) = debuglink_escn.szB' failed.
==5044==at 0x3804F522: ??? (in
/home/mingo/local/lib/valgrind/memcheck-amd64-linux)

sched status:
  running_tid=0


Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what OS and version you are using.  Thanks.


On Thu, Apr 3, 2014 at 5:07 PM, Michael Matz matz@frakked.de wrote:

 Hi,

 On Wed, 2 Apr 2014, Domingo Alvarez Duarte wrote:

  1- Inconsistency detected by ld.so: rtld.c: 1292: dl_main: Assertion
  `_rtld_local._dl_rtld_map.l_libname' failed! for this one I found a
  workaround making a change on tccelf.c (it's on the mob but commented
  because it has a side effect of programs generated with debug information
  and stripped afterwards segfaults).

 I think I've fixed this one.  TCC was emitting ELF files that aren't liked
 by binutils strip, and creating a PT_PHDR exposed those problems.  mob
 since f2c8491 should work (at least valgrind before and after stripping
 executables for x86 and x86-64 do).


 Ciao,
 Michael.

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Tinycc for ARM help needed !

2014-04-03 Thread Domingo Alvarez Duarte
This error appear only when the program is compiled with tinycc without
debug info, with debug info valgrind runs fine without errors, and striping
the program then the program and valgrind also works fine.


On Thu, Apr 3, 2014 at 5:41 PM, Domingo Alvarez Duarte
mingo...@gmail.comwrote:

 Thanks for the help !

 Testing on my linux X86_64 give me this error:

 -
 ~/dev/c/tinycc/tests$ ../tcc -B.. -I.. -I.. -I../include
 -DCONFIG_LDDIR=\lib\ -DCONFIG_MULTIARCHDIR=\x86_64-linux-gnu\
 -DTCC_TARGET_X86_64 -DONE_SOURCE -o tcc.tcc ../tcc.c -ldl

 ~/dev/c/tinycc/tests$ valgrind --tool=memcheck ./tcc.tcc
 ==5044== Memcheck, a memory error detector
 ==5044== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
 ==5044== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
 ==5044== Command: ./tcc.tcc
 ==5044==

 valgrind: m_debuginfo/readelf.c:2352 (vgModuleLocal_read_elf_debug_info):
 Assertion 'crc_offset + sizeof(UInt) = debuglink_escn.szB' failed.
 ==5044==at 0x3804F522: ??? (in
 /home/mingo/local/lib/valgrind/memcheck-amd64-linux)

 sched status:
   running_tid=0


 Note: see also the FAQ in the source distribution.
 It contains workarounds to several common problems.
 In particular, if Valgrind aborted or crashed after
 identifying problems in your program, there's a good chance
 that fixing those problems will prevent Valgrind aborting or
 crashing, especially if it happened in m_mallocfree.c.

 If that doesn't help, please report this bug to: www.valgrind.org

 In the bug report, send all the above text, the valgrind
 version, and what OS and version you are using.  Thanks.


 On Thu, Apr 3, 2014 at 5:07 PM, Michael Matz matz@frakked.de wrote:

 Hi,

 On Wed, 2 Apr 2014, Domingo Alvarez Duarte wrote:

  1- Inconsistency detected by ld.so: rtld.c: 1292: dl_main: Assertion
  `_rtld_local._dl_rtld_map.l_libname' failed! for this one I found a
  workaround making a change on tccelf.c (it's on the mob but commented
  because it has a side effect of programs generated with debug
 information
  and stripped afterwards segfaults).

 I think I've fixed this one.  TCC was emitting ELF files that aren't liked
 by binutils strip, and creating a PT_PHDR exposed those problems.  mob
 since f2c8491 should work (at least valgrind before and after stripping
 executables for x86 and x86-64 do).


 Ciao,
 Michael.

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] tcc i386 test failures after commit ea2805f

2014-04-03 Thread Ramsay Jones
Hi Michael,

tcc on i386 has been failing a couple of tests for a while.
For example, commit 3e56584 (Allow local redefinition of enumerator,
31-03-2014), fails like so:

  $ make test
  ...
   test1b 
  ../tcc -B.. -I.. -I.. -I../include -b -run tcctest.c  test.out1
  --- test.ref  2014-04-03 20:09:19.207429405 +0100
  +++ test.out1 2014-04-03 20:09:19.879432730 +0100
  @@ -538,7 +538,7 @@
   Test C99 VLA 2 (ptrs substract): PASSED
   Test C99 VLA 3 (ptr add): PASSED
   Test C99 VLA 4 (ptr access): PASSED
  -Test C99 VLA 5 (bounds checking (might be disabled)): PASSED PASSED PASSED 
PASSED PASSED PASSED PASSED PASSED 
  +Test C99 VLA 5 (bounds checking (might be disabled)): FAILED PASSED FAILED 
PASSED FAILED PASSED FAILED PASSED 
   sizeof(int) = 4
   sizeof(unsigned int) = 4
   sizeof(long) = 4
  make[1]: *** [test1b] Error 1
  make[1]: Leaving directory `/home/ramsay/tinycc/tests'
  make: *** [test] Error 2
  $ 

After commit ea2805f (shared libs: Build libtcc1.a with -fPIC, 02-04-2014),
this now fails like so:

  $ make test
  ...
   test1b 
  ../tcc -B.. -I.. -I.. -I../include -b -run tcctest.c  test.out1
  Runtime error: dereferencing invalid pointer
  at 0x9a6dc23 __bound_init()
  Segmentation fault
  make[1]: *** [test1b] Error 139
  make[1]: Leaving directory `/home/ramsay/tinycc/tests'
  make: *** [test] Error 2
  $ 

Also, running 'make -k test', show other (bounds) tests failing in
a similar fashion (test3b and btest).

I don't have time to investigate this myself (sorry!).

HTH

ATB,
Ramsay Jones




___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] tcc i386 test failures after commit ea2805f

2014-04-03 Thread Domingo Alvarez Duarte
Indeed I did so on my repository
https://github.com/mingodad/tinycc/commit/74840e25b5d2bde099dbd3e7088cfef49bb172ce


On Thu, Apr 3, 2014 at 8:55 PM, Domingo Alvarez Duarte
mingo...@gmail.comwrote:

 I propose to remove bounds check from tests/build till we have a good
 solution/implementation to it.


 On Thu, Apr 3, 2014 at 8:34 PM, Ramsay Jones 
 ram...@ramsay1.demon.co.ukwrote:

 Hi Michael,

 tcc on i386 has been failing a couple of tests for a while.
 For example, commit 3e56584 (Allow local redefinition of enumerator,
 31-03-2014), fails like so:

   $ make test
   ...
    test1b 
   ../tcc -B.. -I.. -I.. -I../include -b -run tcctest.c  test.out1
   --- test.ref  2014-04-03 20:09:19.207429405 +0100
   +++ test.out1 2014-04-03 20:09:19.879432730 +0100
   @@ -538,7 +538,7 @@
Test C99 VLA 2 (ptrs substract): PASSED
Test C99 VLA 3 (ptr add): PASSED
Test C99 VLA 4 (ptr access): PASSED
   -Test C99 VLA 5 (bounds checking (might be disabled)): PASSED PASSED
 PASSED PASSED PASSED PASSED PASSED PASSED
   +Test C99 VLA 5 (bounds checking (might be disabled)): FAILED PASSED
 FAILED PASSED FAILED PASSED FAILED PASSED
sizeof(int) = 4
sizeof(unsigned int) = 4
sizeof(long) = 4
   make[1]: *** [test1b] Error 1
   make[1]: Leaving directory `/home/ramsay/tinycc/tests'
   make: *** [test] Error 2
   $

 After commit ea2805f (shared libs: Build libtcc1.a with -fPIC,
 02-04-2014),
 this now fails like so:

   $ make test
   ...
    test1b 
   ../tcc -B.. -I.. -I.. -I../include -b -run tcctest.c  test.out1
   Runtime error: dereferencing invalid pointer
   at 0x9a6dc23 __bound_init()
   Segmentation fault
   make[1]: *** [test1b] Error 139
   make[1]: Leaving directory `/home/ramsay/tinycc/tests'
   make: *** [test] Error 2
   $

 Also, running 'make -k test', show other (bounds) tests failing in
 a similar fashion (test3b and btest).

 I don't have time to investigate this myself (sorry!).

 HTH

 ATB,
 Ramsay Jones




 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] tcc i386 test failures after commit ea2805f

2014-04-03 Thread Michael Matz

Hi,

On Thu, 3 Apr 2014, Domingo Alvarez Duarte wrote:


I propose to remove bounds check from tests/build till we have a good
solution/implementation to it.


Why should we?  The checks are for features that are supposed to work.
They did work once.  They don't anymore.  That's a regression.  And the 
regression didn't happen because the testcase is invalid.  So, I've 
probably broken something.


Testcases can be disabled if there are known reasons why they 
currently can't possbily work.  This is not one of the situations, the 
fails needs to be investigated first.


Ramsay, thanks for the report, if nobody beats me, I'll look at details 
later the week.  Probably something with how calls to internal functions 
are emitted.



Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel