[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Oct 27 11:04:22 PDT 2019


mgorny added a comment.

I've just tried on Linux and it seems that Python closes the same descriptors. So somehow closing stdin works here on Linux, and fails on NetBSD. Curious enough, with a simple test I can verify that both NetBSD and Linux return EBADF when trying to close stdin twice. So unless there's another reason EBADF is returned here, it seems that stdin is closed somewhere earlier on NetBSD, and the same thing doesn't happen on Linux.

However, I think this is only a symptom of a more generic problem. I don't think we should really be creating a second system of file objects outside Python, and injecting it into Python file objects like this. I have a bad feeling for e.g. creating low-level a new file object for stdin, and then having Python destroy it alongside its own stdin object.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68737/new/

https://reviews.llvm.org/D68737





More information about the lldb-commits mailing list