Bug 376142 - Segfaults on MIPS Cavium Octeon boards
Summary: Segfaults on MIPS Cavium Octeon boards
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.12.0
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-07 16:00 UTC by James Cowgill
Modified: 2017-03-14 17:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
valgrind logs (235.79 KB, text/plain)
2017-02-07 16:00 UTC, James Cowgill
Details
valgrind logs v2 (235.80 KB, text/plain)
2017-02-07 16:01 UTC, James Cowgill
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Cowgill 2017-02-07 16:00:13 UTC
Created attachment 103885 [details]
valgrind logs

Hi,

From https://bugs.debian.org/854194

Valgrind 3.12.0 segfaults when I try to run anything on a Cavium Octeon board. I've tried both Octeon II and Octeon III boards. It seems to be hardware specific, because valgrind does work on the CI20 and on Loongson boards (after hacking /proc/cpuinfo a bit).

The behavior changes when I modify the environment. Changing the environment changes where the segfault occurs (ie the last SB reported). If I run valgrind after the environment is cleared with env -i, it doesn't segfault and instead hangs, although I think this is Bug 344524. On Octeon II it completes.

I've attached two examples run on an Octeon III machine.

James
Comment 1 James Cowgill 2017-02-07 16:01:45 UTC
Created attachment 103886 [details]
valgrind logs v2
Comment 2 Petar Jovanovic 2017-03-08 16:33:54 UTC
James, can you try with the latest Valgrind code?
I believe this issue has been fixed with r16261.
Comment 3 James Cowgill 2017-03-08 17:39:16 UTC
Using valgrind from SVN has definitely improved the situation. Running valgrind normally no longer segfaults - everything now hangs but again I think that's Bug 344524. I did notice however that the segfaults do still occur if I run valgrind with gdb. I don't know what's happening there.
Comment 4 Petar Jovanovic 2017-03-13 19:00:13 UTC
I have submitted the patches (Valgrind r16269, VEX r3316) that should fix and close Bug 344524.
Can you try it now with the latest SVN code?

As of the failures you are seeing with GDB, that might be a regular case when debugging Valgrind.
Have you tried to 'continue' with running the code after you come across a segmentation fault?

Alternatively, can you pass "handle SIGSEGV noprint nostop pass" to GDB before you run the code?
Comment 5 James Cowgill 2017-03-14 11:51:35 UTC
Using the latest SVN does fix the hangs on Octeon. Also, I didn't know that valgrind raised SIGSEGV during normal execution - indeed running 'continue' in GDB does allow it to continue without error. Thanks!
Comment 6 Petar Jovanovic 2017-03-14 17:16:13 UTC
(In reply to James Cowgill from comment #5)
> Using the latest SVN does fix the hangs on Octeon. Also, I didn't know that
> valgrind raised SIGSEGV during normal execution - indeed running 'continue'
> in GDB does allow it to continue without error. Thanks!

Great.
We should close this issue now.