[Lldb-commits] [PATCH] fix lldb-mi hang on OSX
Hafiz_Abid at mentor.com
Tue Dec 2 09:45:21 PST 2014
I see only one fileno call inside lldb-mi and that is specific to Windows code. Probably some fileno call inside lldb proper is causing this issue. In which case, there is nothing much lldb-mi can do but to try to avoid this scenario. As I told earlier, ‘select’ based solution increases time to run test many times. So that does not seem reasonable. I am OK with ioctl based solution and will commit it later if there are no more comments/suggestion.
>Side comment, But regarding conditionally compiling the file, i prefer doing that at the CMake level (only include it in the set of inputs if the platform is correct) instead of wrapping the whole file in ifdefs.
Agree. But if problem is handled at the build level then autoconf based system should be updated too. Anyway, this issue can be dealt separately.
From: lldb-commits-bounces at cs.uiuc.edu [mailto:lldb-commits-bounces at cs.uiuc.edu] On Behalf Of Zachary Turner
Sent: 02 December 2014 16:34
To: Илья К; lldb-commits at cs.uiuc.edu
Subject: Re: [Lldb-commits] [PATCH] fix lldb-mi hang on OSX
I kind of feel like calling fgets from one thread and fileno from another thread indicates a design flaw. Is there any way to fix the design problem instead of this particular bug?
On Tue, Dec 2, 2014 at 1:24 AM Илья К <ki.stfu at gmail.com<mailto:ki.stfu at gmail.com>> wrote:
>RE: But I am still wondering why you need extra "return" in case of -exec-run. It seems to work ok on Linux. Where is it blocking in OSX?
I had the same bug on OSX but "select" patch helped me (btw, thank Dawn for that).
As I understood the problem occurs when trying to get filno(stdin), when another thread sleeping in fgets(stdin). The filno() starts sleeping too because stdin's mutex already locked by fgets(). Perhaps it related to OSX's libc implementation and therefore it don't reproduced on Linux.
I wrote test, which doesn't works properly without WITH_SELECT_FIX:
select(1, &inset, NULL, NULL, NULL);
char *line = fgets(buf, sizeof buf, stdin);
printf("you entered: %s\n", buf);
>RE: Btw, if the problem is only with gdb-exit then an extra check for it where we check for "quit" will work too.
As I said above, it doesn't solve a problem, it only fixes a certain case.
So I think you should accept the Dawn's "select" patch.
lldb-commits mailing list
lldb-commits at cs.uiuc.edu<mailto:lldb-commits at cs.uiuc.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-commits