Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360225 - Fatal error message from valgrind process is not properly reported in Eclipse tooling
Summary: Fatal error message from valgrind process is not properly reported in Eclipse...
Status: RESOLVED FIXED
Alias: None
Product: Linux Tools
Classification: Tools
Component: Valgrind (show other bugs)
Version: 0.8.1   Edit
Hardware: PC Linux-GTK
: P3 blocker (vote)
Target Milestone: 0.9.0   Edit
Assignee: Roland Grunberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 08:40 EDT by Martin Oberhuber CLA
Modified: 2011-10-18 16:14 EDT (History)
1 user (show)

See Also:


Attachments
test project ZIP (41.12 KB, application/octet-stream)
2011-10-07 08:40 EDT, Martin Oberhuber CLA
no flags Details
.log from my workspace showing Linuxtools exception (502 bytes, application/x-zip)
2011-10-07 08:41 EDT, Martin Oberhuber CLA
no flags Details
Patch (2.76 KB, patch)
2011-10-07 13:34 EDT, Roland Grunberg CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2011-10-07 08:40:04 EDT
Build ID: Linuxtools-0.8.1 on RHEL5.3 x86_64 host
CQ:WIND00309298

When running the Massif tool from Eclipse, and the underlying valgrind process runs into a fatal error (such as out-of-memory), that fatal error is not properly reported in Eclipse. The valgrind commandline tool prints a nice and very verbose message when running out of memory, but the Eclipse tooling runs into an "EmptyStackError" instead.

This is confusing for end users and especially problematic when running valgrind on remote embedded targets, where main memory is often scarce - Valgrind does need an awful lot of main memory, so this use-case is relatively common. Not reporting the error is a major loss of functionality since as a user I can't understand what's the problem and how to address it so my original goal (valgrind profiling) can't be performed.

Expected behavior:
When the valgrind commandline process exits with a non-zero exitcode, logfile parsing should not be performed and the process output (stderr) should be shown to the end user such that they can understand the problem.

Steps to reproduce:
1. Limit maximum available virtual memory, e.g. by running this command in bash:
      ulimit -v 1024000
2. Launch Eclipse and import attached project
3. Build if not on x86_64 (binary is in the ZIP but rebuild may be needed)
4. Profile > Profile configurations.. and run the Massif Launch that's stored in
   the Project
   --> EmptyStackError is shown.
5. For reference / comparison, you can run the "mass.sh" shellscript on
   commandline, to see the commandline output. Or, in the Debug View show
   Properties of the Valgrind launch and copy-and-paste the commandline.
Comment 1 Martin Oberhuber CLA 2011-10-07 08:40:40 EDT
Created attachment 204743 [details]
test project ZIP
Comment 2 Martin Oberhuber CLA 2011-10-07 08:41:49 EDT
Created attachment 204744 [details]
.log from my workspace showing Linuxtools exception

The log I see in Eclipse:

!ENTRY org.eclipse.core.jobs 4 2 2011-10-07 13:14:27.553
!MESSAGE An internal error occurred during: "Launching thruput-test Debug".
!STACK 0
java.util.EmptyStackException
	at java.util.Stack.peek(Stack.java:85)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindCoreParser.<init>(ValgrindCoreParser.java:74)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchConfigurationDelegate.parseLogs(ValgrindLaunchConfigurationDelegate.java:202)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchConfigurationDelegate.launch(ValgrindLaunchConfigurationDelegate.java:164)
Comment 3 Andrew Overholt CLA 2011-10-07 09:35:10 EDT
Let's try to get this fixed for 0.9.0.
Comment 4 Roland Grunberg CLA 2011-10-07 11:22:24 EDT
I've confirmed and found a fix for this. I'll post a patch here to be reviewed.
Comment 5 Roland Grunberg CLA 2011-10-07 13:34:13 EDT
Created attachment 204768 [details]
Patch

The output from running valgrind during this error is in a parseable format, and so can be displayed in the valgrind view as an error/problem.
Comment 6 Martin Oberhuber CLA 2011-10-14 06:38:23 EDT
What's the plan for getting the patch into master ?

I've heard that today (friday) is 0.9.0 cutoff for IP disclosures, so in case Roland is not a Linuxtools committer ... could you add a legal message here on bugzilla please, similar to what I put on bug 360085 comment 7 (see "Legal Message:")
Comment 7 Roland Grunberg CLA 2011-10-14 09:19:03 EDT
I am a committer so this won't be an issue. I've tested this patch and it solves the behaviour in question, so assuming there are no objections I will commit this to master.
Comment 8 Roland Grunberg CLA 2011-10-14 09:32:07 EDT
Commited as 2fb0fc0bdb11b596a319d049a228b115a7566dbb.
Comment 9 Roland Grunberg CLA 2011-10-18 16:14:51 EDT
Fixed.