Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347547 - Valgrind error markers not cleared in referenced projects for non-active build configuration
Summary: Valgrind error markers not cleared in referenced projects for non-active buil...
Status: RESOLVED DUPLICATE of bug 360085
Alias: None
Product: Linux Tools
Classification: Tools
Component: Valgrind (show other bugs)
Version: 0.7.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Elliott Baron CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 360085
Blocks:
  Show dependency tree
 
Reported: 2011-05-28 12:08 EDT by Ladar Levison CLA
Modified: 2011-10-07 09:33 EDT (History)
2 users (show)

See Also:


Attachments
Screencap of error (236.75 KB, image/png)
2011-05-28 12:42 EDT, Ladar Levison CLA
no flags Details
versions... (6.43 KB, text/plain)
2011-06-02 12:25 EDT, Ladar Levison CLA
no flags Details
Managed to capture a video with the bug. (71.95 MB, video/avi)
2011-06-08 04:25 EDT, Ladar Levison CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ladar Levison CLA 2011-05-28 12:08:30 EDT
A new issue appears to have surfaced with Indigo RC2. When I profile my app using valgrind, and it finds an error those issues are decorated, and problem entries generated.

But even after I fix the code and recompile the problem entries remain. And with this latest release those problems are treatedd as errors capable of preventing a relaunch.
Comment 1 Ladar Levison CLA 2011-05-28 12:42:18 EDT
Created attachment 196831 [details]
Screencap of error
Comment 2 Ladar Levison CLA 2011-05-28 12:44:09 EDT
After restarting Eclipse the error went away... until I realized what the trigger was. I believe its when I activate the Problems view that it picks up the Valgrind error. If I don't activate that view, I can rebuild and relaunch without issue.
Comment 3 Andrew Overholt CLA 2011-05-30 08:46:29 EDT
I'm pretty sure the problem markers don't go away until re-launch under Valgrind.  Elliott?
Comment 4 Elliott Baron CLA 2011-05-31 11:04:37 EDT
I seem to recall error markers going away after a rebuild. The functionality should be the same as the CDT does. The Valgrind marker simply extends the CDT's problem marker. I'll have to look into if the CDT does anything special to clear them on rebuild.
Comment 5 Elliott Baron CLA 2011-05-31 19:58:45 EDT
I'm not seeing this issue with Indigo RC2 and CDT 8.0. I have a test project, which mallocs some memory, without freeing it. I profile it with Valgrind, the error is reported and marked in the editor. If I clean or rebuild, the marker disappears. I am able to run the program without being prompted that there are errors.
Comment 6 Andrew Overholt CLA 2011-06-02 11:30:51 EDT
Ladar, can you explain what you installed and steps we can use to reproduce the bug?  Thanks!
Comment 7 Ladar Levison CLA 2011-06-02 12:25:36 EDT
Created attachment 197244 [details]
versions...
Comment 8 Ladar Levison CLA 2011-06-02 12:26:16 EDT
When I tried making a home movie of the bug it got spooked and went into hiding. Like I mentioned above, it only seems to happen intermittently. Using Indigo RC2. Will try to capture a movie the next time I see it...
Comment 9 Andrew Overholt CLA 2011-06-02 15:00:48 EDT
Thanks, Ladar.  Sorry to hear it's intermittent.  Hopefully we can sort it out.
Comment 10 Andrew Overholt CLA 2011-06-03 15:28:02 EDT
I just tested our latest build from here:

http://download.eclipse.org/technology/linuxtools/updates-nightly/

and cannot reproduce this problem.  If I rebuild my project, the Valgrind errors are all cleared from the problems view and the Valgrind view and the markers in affected editors are removed.
Comment 11 Ladar Levison CLA 2011-06-03 15:38:54 EDT
You might want to test what happens if the valgrind marker appears in a referenced C project. In my case the reference was NOT pointing at the active build configuration for the project. 

I've noticed problems with how CDT is tracking changes in referenced projects and I suspect that issue may have played a role. 

I updated to RC3 this morning. If the issue resurfaces I'll let you know.
Comment 12 Andrew Overholt CLA 2011-06-03 15:49:26 EDT
The referenced projects and active build configuration are not things I was aware was at play here.  I've updated the summary to reflect this.  Feel free to correct it if I'm wrong.
Comment 13 Andrew Overholt CLA 2011-06-06 13:55:01 EDT
Unsetting target milestone for old bugs.
Comment 14 Ladar Levison CLA 2011-06-08 04:04:40 EDT
I managed to capture a video showing the bug. The error dialog shows up towards the end. I remove the comments from the project being profiled and attempt a relaunch. The projects compile sucessfully but I since the valgrind markers don't clear out I get an error dialog. 

Manually cleaning the project clears the markers so that a subsequent launch attempt succeeds. I didn't realize the importance of my project relationships when I initially posted the bug. But in case your curious, magma.check references magma, and magma references magma.so. The markers are showing up in magma.so. 

I can provide more details offline if necessary.
Comment 15 Ladar Levison CLA 2011-06-08 04:25:22 EDT
Created attachment 197568 [details]
Managed to capture a video with the bug.

Managed to capture a video with the bug.
Comment 16 Ladar Levison CLA 2011-06-08 21:17:37 EDT
Reassigning so I know the proper people see the updated info. Also confirming the bug is still present in Indigo RC3.
Comment 17 Andrew Overholt CLA 2011-06-09 09:46:36 EDT
Just to be clear:  it's too late for Indigo but we can investigate for Indigo Service Release 1 in September.
Comment 18 Ladar Levison CLA 2011-06-09 10:53:53 EDT
> Just to be clear:  it's too late for Indigo but we can investigate for Indigo
> Service Release 1 in September.

That's your call. I just figured it would be one of those silly but impactful bugs. 

My guess is that when the CDT builder runs against my check project it is smart enough to clear the Valgrind problem markers on that project, but not smart enough to see and remove the Valgrind markers on the referenced project; that is until it comes time to run the Valgrind launcher. 

The reason I think its silly is that it _should_ be easy to fix. It would be reasonable to simplify the logic into clearing any (and all) workspace Valgrind markers before a new launcher executes (Valgrind or otherwise). 

But until the fix is ready the easiest way to workaround the issue seems is 'cleaning' the project. Interestingly enough a clean operation will remove the Valgrind markers on the referenced project even though the referenced project isn't being modified...
Comment 19 Martin Oberhuber CLA 2011-08-08 07:44:30 EDT
The error markers are particulary annoying in following workflow:

1. Memcheck my app --> errors found
2. Massif my app 
   --> Dialog: "Errors exist in a required project. Continue Launch?"

This dialog is confusing, since the memcheck errors are different in kind than real build errors. It took me a while to figure out that I can safely continue my Launch.

I think that memcheck issues should generally be reported as warnings, not errors. Navigating the issues is nicely possible from the Valgrind View - so there's IMO no reason marking them up as errors.
Comment 20 Martin Oberhuber CLA 2011-10-06 07:48:16 EDT
I have analyzed the situation and found 3 distinct scenarios / workflows in which valgrind plugins don't clear their error markers. See bug 360085, I also added a sample project and steps to reproduce.

I would suggest closing this bug as a duplicate of bug 360085, unless you'd like to treat the 3 distinct scenarios in separate bugs (then this can remain as a "dependency of bug 360085).
Comment 21 Andrew Overholt CLA 2011-10-07 09:33:19 EDT
Thanks for the thorough analysis and patch, Martin!  Closing as a dupe as you suggest.

*** This bug has been marked as a duplicate of bug 360085 ***