-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
CALL/INFO fails silently #2635
Comments
I'm quite not sure with this one... actually I'm not much sure, why the |
Also there is a question, if the object should not contain other fields... like used command, arguments, start time, end time and other possibly useful information. |
I think more could be done with this, it is very under utilized. I don't know where There are not really any other process management functions in Rebol, and Although, including |
Current call implementation comes from the Atronix branch. I think I never used the |
When thinking about it, I would probably return the process handle only when the The best advantage would be to be able monitor a state of the running process, like its memory/cpu usage. It would also allow automatic process termination. Any ideas are welcome. No timetable for it yet.. unfortunately. |
Does Rebol already have the concept of a process handle? But something that can dynamically pull process info from the OS seems like the best idea compared to fully static objects. |
No.. there is not such a handle, but it may be added. Originally handle was just a pointer (hidden integer), but now these may keep its type and also an internal context. They are used for example to hold various cryptography contexts.. I use these context handles mostly in extension... like here: |
Scenario 1
When:
Using
CALL/INFO
with an argument that calls and external program directly via string or block.Then:
The output from the REPL is the contents of a process information object with the ID of
0
.Scenario 2
When:
Then:
In this case even the strange output of Scenario 1 is masked by the following value. There is no output aside from the newline. This doesn't reveal any additional problems, but it shows how the problem may be masked and difficult to debug.
Expected Behavior
When not using
/info
, the error is printed as expected. This same error should be displayed in all cases.I believe that removing the premature return here would fix this:
https://github.com/Oldes/Rebol3/blob/96b13b877805682b3eb9fefc7c870de355f85d8a/src/core/n-io.c#L903
Alternative
I could see that using
/INFO
would be a way to intentionally silence errors, but because the cause of the error is not contained in the information object there is no way for the program to log or report to the user what happened.The early return was part of the original code, so this may have been the intended use case. Though it is possible that it was a mistake added in the Atronix additions but I didn't dig that far into the file history.
If this is the desired use then, then I might suggest that the error is captured in the information object rather than thrown out. Putting the string created by
Make_OS_Error(r)
into the object would supply the developer with the tools to properly handle the error without having to run a series of tests.This code:
Inserted here:
https://github.com/Oldes/Rebol3/blob/96b13b877805682b3eb9fefc7c870de355f85d8a/src/core/n-io.c#L901
Produces a result like:
I created a pull request with code that demonstrates this approach: Oldes/Rebol3#101
The text was updated successfully, but these errors were encountered: