Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Show the PID of each worker when running under valgrind #11013

Merged
merged 1 commit into from
Apr 26, 2015

Conversation

garrison
Copy link
Sponsor Member

When valgrind outputs any warning/error messages, it does so along with a banner of the getpid() that the error is coming from. This is immensely helpful when working to debug programs that fork multiple processes.

This patch causes each such julia worker process to output the getpid() of the worker when the worker starts (but only when running under valgrind). This allows a person to determine which worker number each error/warning comes from. For instance, given the following (schematic) output, it is now possible to determine that the "invalid read" warning is due to the linalg1 tests.

$ valgrind -q --smc-check=all-non-file --trace-children=yes --suppressions=$PWD/../contrib/valgrind-julia.supp ../julia runtests.jl linalg
    From worker 2:  PID = 12609
    From worker 3:  PID = 12610
==12609== Invalid read of size 16
[snip]
From worker 3:       * linalg2
From worker 3:       * linalg3
From worker 2:       * linalg1

I put this patch where I thought it would fit, but I'd be happy to move it if there's a better place.

@timholy
Copy link
Sponsor Member

timholy commented Apr 26, 2015

LGTM.

timholy added a commit that referenced this pull request Apr 26, 2015
RFC: Show the PID of each worker when running under valgrind
@timholy timholy merged commit 98e87ab into JuliaLang:master Apr 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants