tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Segmentation Faults and test failures on ARM (Raspbia


From: Jerry Reed
Subject: Re: [Tinycc-devel] Segmentation Faults and test failures on ARM (Raspbian/Raspberry Pi)
Date: Wed, 23 Jan 2013 15:06:14 -0500

Hi Thomas:

I will try that commit soon, maybe tonight EST.

In the meantime, I have uncovered a few more parameters of the problem.

Now tried it on a BeagleBone (TI OMAP Arm processor) instead of a Raspberry Pi.

address@hidden:/var/log/tinycc# uname -a
Linux beaglebone 3.2.5+ #1 Mon Feb 13 19:22:44 CET 2012 armv7l GNU/Linux

No Segmentation Faults so far, unlike the Pi, where tests under #40 would fail intermittently, perhaps every 3 to 5 times. 
Still getting the problem with stdio, however.  EOF is never detected apparently.  So I rewrote a version of the 40_stdio.c test as follows:

<snip>
   fprintf ( stderr, "Staring fgetc test..." ) ;

   char InChar;
   char ShowChar;
   f = fopen("fred.txt", "r");
   InChar = fgetc ( f ) ;
   while (  ! feof ( f ) )
   {
      ShowChar = InChar;
      if (ShowChar < ' ')
         ShowChar = '.';

      printf("ch: %d '%c'\n", InChar, ShowChar);
      InChar = fgetc ( f ) ;
   }
   fclose(f);

   fprintf ( stderr, "fgetc test done\n" ) ;
<snip>

In other words, I replaced the original test like:

while ( InChar = fgetc ( f ) != EOF )

with:

InChar = fgetc ( f ) ;
while ( ! feof ( f ) )

and doing this for both getc and fgetc loops enables the test to pass, along wth all subsequent tests up through 55.  There is a failure after that, but it looks like this:
gcc -o libtcc_test libtcc_test.c ../libtcc.a -I. -I/var/log/tinycc -Wall -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -DTCC_TARGET_ARM -DWITHOUT_LIBTCC -DTCC_ARM_EABI  -DTCC_ARM_VFP -lm -ldl 
------------ libtest ------------
./libtcc_test lib_path=..
Hello World!
fib(32) = 2178309
add(32, 64) = 96
cp ../include/tcclib.h .
gcc -o tcctest.gcc tcctest.c -I. -I. -I/var/log/tinycc -w -Wall -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -DTCC_TARGET_ARM -DWITHOUT_LIBTCC -DTCC_ARM_EABI  -DTCC_ARM_VFP -std=gnu99 -O0 -fno-omit-frame-pointer
./tcctest.gcc > test.ref
/bin/sh: line 1:  7477 Segmentation fault      ./tcctest.gcc > test.ref
make[1]: *** [test.ref] Error 139
make[1]: Leaving directory `/var/log/tinycc/tests'
make: *** [test] Error 2

which is obviously much farther along (benchmark vs. gcc?)

Hope this helps. I will try the commit you suggest.  Thanks.

Jerry


On Wed, Jan 23, 2013 at 2:41 PM, Thomas Preud'homme <address@hidden> wrote:
Le lundi 21 janvier 2013 03:53:04, Jerry Reed a écrit :
>
> Any further suggestions for how I might obtain more information here.

Can you try from a checkout of the tree as of commit
bfb00494eb2ffaf4fbf68a8ecabe9e503f4cdf65 ?

The change to introduce hardfloat calling convention also changed a bit the
softfloat calling convention (I tried to factorize the code). I want to make
sure wether it is the cause of this bug or not.

>
> Again, thanks.

Thanks for the report.



--
Interested in bats?  Check out my blog at: http://www.karaokebats.com/
reply via email to

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