-
Notifications
You must be signed in to change notification settings - Fork 189
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
Debugger compatibility #683
Comments
Afaict if the interpretor has different behavior than normal execution it's the interpreters bug. |
Thanks. So it looks like But I'm still interested in #574 so moving to |
And reading through the list of compiled methods from JuliaInterpreter, they all seems like temporary workaround and none of them seems like the correct long term solution. This means that changing other's code is not the correct solution either. In this and also a few other cases like
Correct. And that's pretty much all what I see in that list as mentioned above.
The correct solution there is likely a cfunction flag. |
Closing since this is clearly a debugger bug and it doesn't make much sense to workaround it here when there's already an easy workaround for the user. whether to use |
Closing this issue is OK, I guess. I don't think there is an active issue tracking only
What do you mean by this? We have code like Line 40 in 0b2dc20
and you are suggesting to improve it somehow? Something is better than |
No, I mean it needs to be a Julia change. The only thin you need a guaranteed on is that n signal is delivered before you can catch it. It has men mentioned a few times but I cannot find it..... |
It would be nice if there is an issue in Julia repository that I can subscribe to. By the way, I just tried the repro code I posted in JuliaLang/julia#29498 and now it works with Julia 1.3.0-DEV.121 (dc6c7c7e6f). Maybe JuliaLang/julia#31191 [1] fixed what you had in mind? But it seems the issue fixed by it was more about the world-age. [1] mentions JuliaLang/julia#29498 |
What did I had in mind? That julia issue doesn't seem to have anything to do with signal handling. |
That's why I was puzzled. |
What are you puzzled by? I'm not sure what you mean by "what I had in mind" but the only thing I've mentioned in this thread that you didn't understand that is related to #574 is adding new function to I never once mentioned either JuliaLang/julia#29498 or JuliaLang/julia#31191 so I never had anything in particular about them in mind, apart from that it doesn't seem to be signal handling related at all. And if you are just puzzled by why it's fixed or why you can hit a non-signal handling related issue, then, well, that's just how things usually works.......................... |
You said
From your later clarifications, my understanding was that you were saying some Julia internal related to cfunction and signal handler has to be fixed to resolve #574. However, it seems that #574 is fixed by JuliaLang/julia#31191 while it seems, as I said, that
and that the PR JuliaLang/julia#31191 does not have
as you said. So, my understanding is that #574 is fixed by a patch that has nothing to do with the "correct solution" I thought you had in mind. That's why I was puzzled.
JuliaLang/julia#29498 is the "Julia mirror" of #574. That's why I'm mentioning it. I'm mentioning JuliaLang/julia#31191 because, as I said, JuliaLang/julia#31191 is linking JuliaLang/julia#29498 and JuliaLang/julia#31191 may have fixed JuliaLang/julia#29498.
I don't understand this sentence. Are you saying the signal handler bug is still there and JuliaLang/julia#31191 just hid the symptom without fixing the cause? |
Errr, #574 is a pull request and that's all what I was talking about. There's nothing to "fix" for a PR. In the context of a PR, I think it's pretty clear that what I was saying is the implementation of it, especially since I explicitly quoted your "moving to disable_sigint". I'm mentioning it because I don't think moving to
If you are talking about the issue you hit in #574, you should be more clear on that........ It wasn't even mentioned anywhere in this issue before my mentioning of the correct solution.
So, no it's not. The issue you hit in #574 is unrelated to signal handling nor the correct solution. #574 is a PyCall PR and needs changes in julia to correctly fix.
And no, really.... #574 is about signal handling, JuliaLang/julia#29498 is not...... A mirror issue is when closing one closes the other one. You merely have some dependencies in between due to the current implementation in the PR. The two are not equivalent...
I'm making very wield guesses of what you are puzzled by. Since you were puzzled by me mentioning the issue you hit in #574 being not signal handling related, I was guessing you were puzzled by or didn't realized that JuliaLang/julia#29498 is not really related to #574 or signal handling at all. From
It seems that I wasn't too off. To clarify again, JuliaLang/julia#29498 is not a signal handler bug. JuliaLang/julia#29498 might have been fixed JuliaLang/julia#31191. I didn't check either so I don't know but either way, neither of the two fix or hide any signal handling bug. There are AFAICT no julia signal handler bug mentioned anywhere in any linked issues in this thread so far. The only thing I said that'll help implementing the correct solution in #574 is a small feature addition, not a bug. |
And I don't see a reason there need to be one. Debugger is completely irrelevant since it's a debugger bug that already has a workaround. The two doesn't make any difference for #574 (the PR, not any issue you hit in that PR though those issues have even less to do with either functions). Only minor issue being |
OK. You seem to get caught up with the first sentence in that paragraph. The PR #574 at that point was mentioned for its aspect on the cleanup of API usage; i.e., stop using the Julia internal functions
Note also that API cleanup is how I mentioned #574 in the OP as well. Having said that, I agree that the sentence you quoted alone is very confusing. I'm sorry about confusing you.
Yes, I know. Note that PR #574 already uses
I was indeed sloppy about distinction between the PR #574 itself and the blocker issue of #574. I'll try to be clear.
No, the opposite. My guess for what blocks #574 has been the world age issue revealed in JuliaLang/julia#29498. That's why I was confused with your comments indicating that merging #574 requires some changes in Julia's signal related code. This was very different from my expectation.
Thanks. This explains a lot. From my point of view, merging #574 is blocked by the bug JuliaLang/julia#29498 because it makes PyJulia not usable. On the other hand, you seems to be focusing on the fact that |
No, it's possible to implement that but it's a really bad way to do it and AFAICT #574 isn't doing that correctly. What you have in #574 is equivalent to/no better than not having any signal handling code, which is why it really doesn't make sense to add so many disable_sigint to begin with. The only thing missing in that approach (and one important thing missing from your PR) is to re-enable the signal after you setup the try-catch block to make sure,
This is only needed for callback so it should be handled there. And the only thing you need is a sigatomic on the |
I thought any
Does this eliminate the needs of Also, how is it "better than not having any signal handling code?" If you want to handle signals while calling Python functions, I think you need to call |
What do you mean by "need".
I mean the PR as is doesn't need the
Eliminate the need for what..... You only need
I said, #574 is no better than not having any signal handling code. And I'm only talking about |
I thought any
What do you mean by "implementing the cfunction side?"
(You misunderstood what I wanted to know in what way "a sigatomic on the
I'm pointing out one direction of really improving #574 feature-wise, by handling signals during |
Yes, that's assuming a complete implementation on the
Well, then I assume you realized that your quote completely changed the meaning of the original sentence. I'm not sure why you are quoting then..... Which is probably not important but that's really confusing..............
Yes
No.
Well, removing
Well, I have no idea what API's are used by python for signal handling and I have no idea how that's related to this discussion. AFAICT, before you mentioning it, all the discussions about signals has been about how julia handles signals, which is why I feel it's OK to use signal handling to refer to julia signal handling. |
It's not clear to me what you mean by that. My guess has been reenable_sigint() do
try
...
catch
...
end
end is bad, and try
reenable_sigint() do
...
end
catch
...
end is good. Is it correct? I suppose I still need to wrap all the Also, my understanding for why the second code is correct is that this use of
It's not clear to me what do you mean by "implementing the cfunction side." Is it
So you are saying there are two possible correct implementations to achieve the goal of #574:
How is the second implementation consistent with the documentation of
I've been assuming that interrupting the CPython runtime in the middle of its execution is not safe. |
Yes.
Currently, yes, but that's really bad.
Errr, you just said it above. The correct order of try catch and reenable_sigint.
No. I'm saying there is another possible implementation that will behave just like #574 as currently implemented.
There's no inconsistency. |
And in case it's not clear, the only problem with or without |
OK, so I think I've been misinterpreting the documentation. If I'm allowed to put braces in English it would be:
and not
Is it correct? If that's the case, why wrap try
...
catch
disable_sigint() do
...
end
end in the Julia callbacks that may be called via |
Yes.
Because the exception could be thrown before the That's why I said it's a really local problem to the callback, in particular the entry and exit of the callback that the user cannot control. It's possible to fix there and it should be fixed there. |
Good. That clarifies a lot. Thank you very much. |
It seems we may need to use
disable_sigint
to support the JuliaInterpreter.jl out-of-the-box https://discourse.julialang.org/t/debugger-fails-on-pycall/23560/3At the moment, users have to do
push!(JuliaInterpreter.compiled_modules, PyCall)
: https://discourse.julialang.org/t/debugger-fails-on-pycall/23560/6@stevengj You didn't want to put
disable_sigint
for allccall
#574 (comment) but maybe replacing only thesigatomic_begin
-sigatomic_end
pairs is OK?The text was updated successfully, but these errors were encountered: