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

Cannot debug with gdb in WSL when MPI_InitFinalize is called #6919

Closed
yw5aj opened this issue Jul 12, 2018 · 8 comments
Closed

Cannot debug with gdb in WSL when MPI_InitFinalize is called #6919

yw5aj opened this issue Jul 12, 2018 · 8 comments

Comments

@yw5aj
Copy link

yw5aj commented Jul 12, 2018

deal.II version: 8.5.1
WSL version: Ubuntu 18.04

(Google Groups discussion: https://groups.google.com/forum/#!topic/dealii/j0q7m6k6nNQ)

Dear all,

I am stuck in this remote debug issue - any pointer would be really appreciated.

I have set up Windows Subsystem Linux with Ubuntu 18.04 as instructed in https://github.com/dealii/dealii/wiki/Windows and it worked perfectly for tutorials without MPI, such as stpe-1 and step-6. The version for deal.II is 8.5.1.

However, when I use it for step-18, when I step into line 1894 where Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); is called, the program hangs there and does nothing (no progress shows up in the Linux Console Window). Waiting for 30 minutes doesn't help.

Interestingly:

  1. The compilation and linking worked fine; if I open Ubuntu terminal and run step-18 from there, everything works immediately;
  2. Before when I used candi (rather than apt install) to install deal.II 9.0.0 it worked, making me think that whether I made a mistake somewhere in installing/upgrading the openmp related libraries;
  3. The same workflow worked on my home computer but not my work computer - same Ubuntu version and deal.II version.

Update one day after my original post - I used gdb in the Ubuntu terminal:

gdb step-18
b main
r

And then either stepping into or over the line

1898          Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);

Will hang the program.

I can neither step over nor step into that line - either way, it hangs there.


A quick update 7/13/2018 - just used candi to build and install all (including PETSc and deal.II 9.0.0) and the same problem still persists.

@drwells
Copy link
Member

drwells commented Jul 14, 2018

Thanks for reporting this.

Since GDB and WSL both intercept, in some way, system calls, I would estimate that they interact in some strange way that causes this problem.

I don't have windows 10 so I can only make guesses as to what is going on. Would you mind compiling and running

#include <mpi.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
  MPI_Init(&argc, &argv);

  int rank = 0;
  MPI_Comm_rank (MPI_COMM_WORLD, &rank);
  if (rank == 2)
    puts("hello from rank 2");

  MPI_Finalize();
}

under GDB? If this hangs then we know that the problem is not with deal.II.

@masterleinad
Copy link
Member

I can reproduce the issue and can report that @drwells' test code also hangs using gdb.

@drwells
Copy link
Member

drwells commented Jul 18, 2018

It sounds like this error should be reported upstream. @masterleinad since you can reproduce this, would you mind filing a WSL bug? If we do that then I believe we should document this bug in the wiki and then close the issue since there is no way for us to fix this.

@drwells
Copy link
Member

drwells commented Jul 29, 2018

Since @masterleinad can reproduce the issue and it is not dependent on deal.II, we should close this issue.

@masterleinad would you mind filling out a bug report at https://github.com/Microsoft/WSL?

@drwells drwells closed this as completed Jul 29, 2018
@masterleinad
Copy link
Member

Sure.

@masterleinad
Copy link
Member

The bug report is in microsoft/WSL#3428.

@masterleinad
Copy link
Member

Works with Version 10.0.17134.1 which is the April 2018 Update.

@drwells
Copy link
Member

drwells commented Aug 2, 2018

That is fortuitous. At least we followed up with Microsoft on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants