Bug 376142

Summary: Segfaults on MIPS Cavium Octeon boards
Product: [Developer tools] valgrind Reporter: James Cowgill <james410>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: mips32r2, tom
Priority: NOR    
Version: 3.12.0   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: valgrind logs
valgrind logs v2

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.