Bug 334649 - [Cavium Octeon 2 MIPS64] valgrind is up but ld.so assert "rtld.c: 1257: dl_main: Assertion `_rtld_local._dl_rtld_map.l_relocated' failed" and exits
Summary: [Cavium Octeon 2 MIPS64] valgrind is up but ld.so assert "rtld.c: 1257: dl_ma...
Status: RESOLVED INTENTIONAL
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-12 10:59 UTC by Vien
Modified: 2017-04-13 19:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vien 2014-05-12 10:59:58 UTC
I have downloaded latest Valgrind 3.10.0.SVN and cross compiled it for MIPS64.
After put Valgrind on the board and try valgrind ls (and even with valgrind --tool=callgrind ls), I got below assertion from ld.so then valgrind exit without continue execute the program (ls in this case):

==32644== Memcheck, a memory error detector
==32644== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==32644== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==32644== Command: ls
==32644==
Inconsistency detected by ld.so: rtld.c: 1257: dl_main: Assertion `_rtld_local._dl_rtld_map.l_relocated' failed!
==32644==
==32644== HEAP SUMMARY:
==32644==     in use at exit: 0 bytes in 0 blocks
==32644==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==32644==
==32644== All heap blocks were freed -- no leaks are possible
==32644==
==32644== For counts of detected and suppressed errors, rerun with: -v
==32644== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

There's one special point when cross compiling Valgrind is that I have changed Optimize level of drd from O2 to O0 (since compilation hangs in middle for drd with O2). I think that is not a problem since there's one bug report and resolve for that already.

I have searched through the bug list but currently there's no entry for this kind of behavior.
May you please help to have a look and give your idea?
Please feedback if you need more information.

Regards,
Vien Mai.


Reproducible: Always

Steps to Reproduce:
1. Put valgrind on mips64 board
2. valgrind ls
3. valgrind --tool=callgrind ls
Actual Results:  
Valgrind shows Inconsistency detected by ld.so: rtld.c: 1257: dl_main: Assertion `_rtld_local._dl_rtld_map.l_relocated' failed! when loading tool(s)

Expected Results:  
Valgrind should not show Inconsistency detected by ld.so: rtld.c: 1257: dl_main: Assertion `_rtld_local._dl_rtld_map.l_relocated' failed! and execute the program normally.
Comment 1 Julian Seward 2014-05-12 14:07:19 UTC
I wonder if this some variant of the SHMBLA problem.  Petar, any
idea?
Comment 2 Petar Jovanovic 2014-05-12 18:07:57 UTC
@Vien Mai

Can you share the command line that you use to configure Valgrind?
What's the pagesize value on the Cavium board?
What's the system you use to run Valgrind on? What board/CPU are you running it on?
Comment 3 Vien 2014-05-13 06:10:34 UTC
Hi Petar,

1. Belows are commands I have used:
export PATH=<path_to_mips64_gcc>:$PATH
export CC=mips64-gcc
export LD=mips64-ld
export AR=mips64-ar
export RANLIB=mips64-ranlib
export CXX=mips64-g++
export STRIP=mips64-strip

On the first try, I configure:
./configure --prefix=/ --host=mips64-linux-gnu --with-pagesize=4
The issue comes, so I try with:
./configure --host=mips64-target-linux-gnu --build=x86_64-crosscompile-linux-gnu --prefix=/
Issue comes also.

2. I have written one executable to invoke getpagesize() function. The value comes out as 4096 (4kb). Hence, I think the configuration is correct.

3. I'm running valgrind on a Calvium Octeaon ii mips64 with Linux kernel 2.6. This is a big-endian mips64.

Please check if provided information is useful from your site.

Regards,
Vien Mai.
Comment 4 Petar Jovanovic 2014-08-08 13:42:04 UTC
(In reply to Vien from comment #3)

Are you using c-lib compatible toolchain for Valgrind (i.e. compatible
with the system libraries on the board)?
What C-library do you have on the system?
Can you give more details on the toolchain you are using?
Does Valgrind executable work if you do not pass any parameter to it?
Is the rootfs built with Cavium specific toolchain or a regular MIPS64
toolchain?
Comment 5 Petar Jovanovic 2014-09-04 01:49:29 UTC
Any update here?
Comment 6 Petar Jovanovic 2017-04-12 12:24:01 UTC
Any update here, Vien?
Comment 7 Petar Jovanovic 2017-04-13 17:54:57 UTC
As there have been no updates to this issue for years now, I think we should close it.