Skip to content
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

error of mojox_run or my error #3

Open
sugar84 opened this issue Sep 22, 2011 · 4 comments
Open

error of mojox_run or my error #3

sugar84 opened this issue Sep 22, 2011 · 4 comments

Comments

@sugar84
Copy link
Contributor

sugar84 commented Sep 22, 2011

Hello, Brane.

I have this code and have some problems with it, it has started 4 processes and 2 of them killed (exit_signal => 9). Why does this triggered? And piece of stdout is broken (odd symbols), but it's less problem, because it is simply solved with RE.
And why some of process had killed by SIGKILL? It's a bug?
Why DESTROY method started with ref_count to object about 4?

And in this script in my desktop i had in 7 processe 1-2 killed.
Can you explain this behavior?
In this small example proccesses after kill made stdout, but in real app when message is larger, stdout after kill was blank. And code did not work well.

Best regards,
Anton Ukolov

@bfg
Copy link
Owner

bfg commented Sep 22, 2011

This is weird indeed.

Can you tell me more about your environment? OS, kernel, perl version?

Seems like some streams are not reported as closed by mojo::ioloop (

However, you're having a bug in your code.

If you're spawning a sub it's return value will be returned in result structure, not stdout/stderr; so line 13 should be:

return "_\__hello world!__/_";

@bfg bfg closed this as completed Sep 22, 2011
@bfg bfg reopened this Sep 22, 2011
@sugar84
Copy link
Contributor Author

sugar84 commented Sep 22, 2011

Bug? Are sure?
I use "spawn", not "spawn_sub", and in your test you are doing the same thing. And send data to stdout, and MojoX::Run catches it.

On server: perl 5.10.0, Mojolicious 1.11, Linux 2.6.33.2, there is running first snippet of code

On desktop: perl 5.12.4, Mojolicious 1.11, Linux 3.0.4, there i've run this script

But why DESTROY was triggered? The object was not flushed, ref count is >= 1. And kills were made from DESTROY

@bfg
Copy link
Owner

bfg commented Sep 22, 2011

oh, you're right :)

@sugar84
Copy link
Contributor Author

sugar84 commented Sep 22, 2011

ok =)
Please, take look at this script at the END section. You will see that 2 of 7 process got KILL signal. In my real app i had 3 of 5 killed processes before they print result to STDOUT.
Is it bug? If yes how to fix it?
Can you produce this behavior on your own machine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants