microsoft / microsoft/MIEngine

Missing newline on cerr before solib-event stops debugger for good

Open
#404 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
859
Forks
233
Avg merge
1d 6h
Merged PRs (30d)
3

Description

Debugging the following little program on a CentOS 5 target with MIEngine and gdb 7.6.1-47.el5 stops the debugger without any way to continue:

#include <iostream>
#include <dlfcn.h>

int main() {
    std::cerr << "Hello World";
    //std::cerr << std::endl; // fixes the issue

    if(!dlopen("libpthread.so.0", RTLD_LAZY)) {
      std::cout << "error: " << dlerror() << std::endl;
      return 1;
    }
    return 0;
}

The last message in the log reads:

Hello World*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="11"

The problem appears to be a missing newline on the cerr pipe which hides the gdb message that follows afterwards. Adding the newline fixes the issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the C++ program on the CentOS 5 target with MIEngine and gdb 7.6.1-47.el5, then inspect the MI log around the cerr output and solib-event stop. Done means the debugger can continue and the gdb message following the cerr output is visible rather than hidden.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp, linux
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.