[#6134] Lots of compilation fail due to memory full when testing libstdc++ through jtag

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#6134] Lots of compilation fail due to memory full when testing libstdc++ through jtag

Submitted By: Vivi Li

Open Date

2010-07-20 05:58:30     Close Date

2013-05-24 05:49:33

Priority:

Medium High     Assignee:

Vivi Li

Stuart Henderson

Board:

N/A     Silicon Revision:

Resolution:

Fixed     Fixed In Release:

N/A

Processor:

ALL     

Host Operating System:

toolchain rev.:

    kernel rev.:

State:

Closed     Found In Release:

N/A

Is this bug repeatable?:

N/A     

Summary: Lots of compilation fail due to memory full when testing libstdc++ through jtag

Details:

 

Lots of compilation fail due to memory full when testing through jtag.

About a thousand cases fail due to this in libstdc++ test.

 

It can also be found in gcc/g++ test, but the case will be marked UNSUPPORTED when memory full in compilation.

Not a regression bug. It exists in previous release.

 

Bellow is an example:

--

bfin-elf-g++ -g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0 -DLOCALEDIR="." -I/home/test/work/cruise/checkouts/toolchain/gcc-4.3/libstdc++-v3/testsuite/util /home/test/work/cruise/checkouts/toolchain/gcc-4.3/libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc ./libtestc++.a -mcpu=bf537-0.2 -lm -o ./cons_virtual_derivation.exe

 

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(closer.o): In function `_close_r':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/closer.c:53: warning: _close is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(fstatr.o): In function `_fstat_r':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/fstatr.c:62: warning: _fstat is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(signalr.o): In function `_getpid_r':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/signalr.c:96: warning: _getpid is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(makebuf.o): In function `__smakebuf':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/stdio/makebuf.c:96: warning: isatty is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(signalr.o): In function `_kill_r':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/signalr.c:61: warning: _kill is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lseekr.o): In function `_lseek_r':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/lseekr.c:58: warning: _lseek is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(readr.o): In function `_read_r':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/readr.c:58: warning: _read is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(syswrite.o): In function `write':

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/syscalls/syswrite.c:15: warning: _write is not implemented and will always fail

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/bin/ld.real: region MEM_L1_CODE is full (./cons_virtual_derivation.exe section .text)

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/bin/ld.real: region MEM_L1_CODE is full (./cons_virtual_derivation.exe section .text)

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/bin/ld.real: section .init [ffa00000 -> ffa00011] overlaps section .text [ffa00000 -> ffa0e397]

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/bin/ld.real: ./cons_virtual_derivation.exe: section .text lma 0xffa00000 overlaps previous sections

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/bin/ld.real: ./cons_virtual_derivation.exe: section .fini lma 0xffa00012 overlaps previous sections

collect2: ld returned 1 exit status

compiler exited with status 1

 

FAIL: 19_diagnostics/logic_error/cons_virtual_derivation.cc (test for excess errors)

--

 

Follow-ups

 

--- Stuart Henderson                                         2010-08-10 11:30:22

Tests should no longer fail at build time, although it seems a few xfail at

runtime now.

 

--- Vivi Li                                                  2010-08-25 05:01:36

After revision 4788, unexpected failures reduced 150, while more than 800

failures remained.

Then, after r4830, old problem happen again, and now there are still nearly

1000 failures.

 

--- Stuart Henderson                                         2010-08-25 06:56:51

could you attach a log with these failures?

 

--- Vivi Li                                                  2010-08-25 07:06:13

Logs are attached.

 

--- Stuart Henderson                                         2010-08-27 06:29:49

the target triplet was wrong, so i've updated it.  we may move the change to the

boards files once i've got some feedback from Mike, but this change should stop

the failures for now.

 

--- Vivi Li                                                  2010-08-31 03:24:35

Now there are more than 800 failures with message "region MEM_L1_CODE is

full".

 

--- Vivi Li                                                  2010-08-31 06:39:30

Log is attached for bf537-stamp.

 

--- Stuart Henderson                                         2010-09-06 10:45:26

we don't have enough memory available for these tests with the default linker

scripts.  using -gc-sections has allowed many of them to now pass, but some are

still too big.

 

Options seem to be:

1-disable these tests when using bfin-elf on any hardware where it fails to

fit.

i can't see an obvious way of doing this, so may require a bit of expect file

hackery and checking/updating the 800 failing tests individually for each part.

 

2-implement some kind of external memory support in custom linker scripts.

this means making assumptions about the target board we're testing on and would

require a new custom linker script for each target board we want to test and

presumably other problems encountered along the way.

it also means we're not testing the default linker scripts.

 

3-a much nicer solution that i haven't thought of.  suggestions would be

appreciated as i'm not keen on 1 or 2.

 

--- Mike Frysinger                                           2010-09-06 11:08:26

simply changing the linker script to use external memory isnt sufficient.  you'd

actually need external memory initialized as well, and you'd have to deal with

it across multiple processors/boards.

 

--- Vivi Li                                                  2010-09-08 23:52:45

After fix part of this bug, bellow test fail because they can be execute now. So

I suppose to report a new bug about this.

--

bfin-elf: 21_strings/basic_string/append/char/3.cc execution test

bfin-elf: 21_strings/basic_string/capacity/char/18654.cc execution test

bfin-elf: 23_containers/deque/cons/assign/1.cc execution test

bfin-elf: 25_algorithms/sort/34095.cc execution test

bfin-elf: ext/mt_allocator/check_allocate_big_per_type.cc execution test

bfin-elf: ext/mt_allocator/tune-1.cc execution test

bfin-elf: ext/mt_allocator/tune-2.cc execution test

bfin-elf: ext/mt_allocator/tune-3.cc execution test

bfin-elf: ext/mt_allocator/tune-4.cc execution test

bfin-elf: tr1/6_containers/unordered_map/24064.cc execution test

--

 

--- Stuart Henderson                                         2010-09-09 06:46:53

that sounds good, thanks Vivi.

 

--- Stuart Henderson                                         2010-09-15 06:03:29

Option 3- we could check the compile output and xfail any tests that fail due to

a lack of memory at link time when testing libstdc++ on bfin-elf over jtag.

something along the lines of:

 

Index: gcc-4.3/libstdc++-v3/testsuite/lib/libstdc++.exp

===================================================================

--- gcc-4.3/libstdc++-v3/testsuite/lib/libstdc++.exp    (revision 4907)

+++ gcc-4.3/libstdc++-v3/testsuite/lib/libstdc++.exp    (working copy)

@@ -349,6 +349,12 @@

     set comp_output [$select_compile "$prog"

"$output_file" "$compile_type" $options];

     set comp_output [ prune_g++_output $comp_output ];

 

+    # xfail if testing bfin-elf on a target board and we've run out of memory

+    # at link time.

+    if { [is_remote target] != 0 && [regexp -nocase ".*region .*

is full.*" $comp_output] } {

+           setup_xfail "bfin-*-elf"

+    }

+

     return [list $comp_output $output_file]

}

 

 

again, not ideal, but it's my preferred option of the three so far.

 

--- Vivi Li                                                  2010-09-15 23:51:24

Some failures covered by this bug is reported to bug 6250. See Associations.

 

--- Stuart Henderson                                         2010-09-23 11:13:27

Vivi- since noone's objected, i've made a change so that any test in libstdc++

that fails due to a lack of memory at link time will XFAIL on bfin-elf (option

3).  it's not ideal, but will mean your log won't be filled with 800 out of

memory failures.  if we can think of a better solution i'm happy to take this

out.

 

--- Mingquan Pan                                             2013-05-24 06:59:55

the log says this case pass now:

 

Executing on host: bfin-elf-g++ -g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0

-Wl,--gc-sections  -DLOCALEDIR="."

-I/home/test/work/cruise/checkouts/toolchain/gcc-4.3/libstdc++-v3/testsuite/util

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc

    ./libtestc++.a  -mcpu=bf537-0.2     -lm  -mcpu=bf537-0.2  -o

./cons_virtual_derivation.exe    (timeout = 600)

spawn bfin-elf-g++ -g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0

-Wl,--gc-sections -DLOCALEDIR="."

-I/home/test/work/cruise/checkouts/toolchain/gcc-4.3/libstdc++-v3/testsuite/util

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/libstdc++-v3/testsuite/19_diagnostics/logic_error/cons_virtual_derivation.cc

./libtestc++.a -mcpu=bf537-0.2 -lm -mcpu=bf537-0.2 -o

./cons_virtual_derivation.exe^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-closer.o):

In function `_close_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/closer.c:53:

warning: _close is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-fstatr.o):

In function `_fstat_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/fstatr.c:62:

warning: _fstat is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-signalr.o):

In function `_getpid_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/signalr.c:96:

warning: _getpid is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-isattyr.o):

In function `_isatty_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/isattyr.c:58:

warning: _isatty is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-signalr.o):

In function `_kill_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/signalr.c:61:

warning: _kill is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-lseekr.o):

In function `_lseek_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/lseekr.c:58:

warning: _lseek is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-readr.o):

In function `_read_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/readr.c:58:

warning: _read is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-writer.o):

In function `_write_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/writer.c:58:

warning: _write is not implemented and will always fail^M

output is:

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-closer.o):

In function `_close_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/closer.c:53:

warning: _close is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-fstatr.o):

In function `_fstat_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/fstatr.c:62:

warning: _fstat is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-signalr.o):

In function `_getpid_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/signalr.c:96:

warning: _getpid is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-isattyr.o):

In function `_isatty_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/isattyr.c:58:

warning: _isatty is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-signalr.o):

In function `_kill_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/signalr.c:61:

warning: _kill is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-lseekr.o):

In function `_lseek_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/lseekr.c:58:

warning: _lseek is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-readr.o):

In function `_read_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/readr.c:58:

warning: _read is not implemented and will always fail^M

/home/test/work/cruise/temp/bfin-elf/lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/lib/libc.a(lib_a-writer.o):

In function `_write_r':^M

/home/test/work/cruise/checkouts/toolchain/gcc-4.3/newlib/libc/reent/writer.c:58:

warning: _write is not implemented and will always fail^M

 

PASS: 19_diagnostics/logic_error/cons_virtual_derivation.cc (test for excess

errors)

delete breakpoints^M

Delete all breakpoints? (y or n) y^M

(gdb) info breakpoints^M

No breakpoints or watchpoints.^M

(gdb) file ./cons_virtual_derivation.exe^M

Load new symbol table from

"/home/test/work/cruise/temp/regtest_build4.3/libstdc++_build/testsuite/cons_virtual_derivation.exe"?

(y or n) y^M

Reading symbols from

/home/test/work/cruise/temp/regtest_build4.3/libstdc++_build/testsuite/cons_virtual_derivation.exe...done.^M

(gdb) target remote :2000^M

..

So close this.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

libstdc++-4.3.537.tar.gz    application/x-gzip    300507    Vivi Li

libstdc++-4.3.561.tar.gz    application/x-gzip    241249    Vivi Li

libstdc++-4.3.log.tar.bz2    application/x-bzip2    166441    Vivi Li

libstdc++.tar.gz    application/x-gzip    307803    Vivi Li

Outcomes