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

QProcess::start: Process is already running #35

Closed
mathsoft-dev opened this issue Jun 23, 2015 · 5 comments
Closed

QProcess::start: Process is already running #35

mathsoft-dev opened this issue Jun 23, 2015 · 5 comments
Assignees

Comments

@mathsoft-dev
Copy link
Collaborator

callJohnShow() often lead to weird message popping out in the terminal "QProcess::start: Process is already running". As the doc says, If the "QProcess object is already running a process, a warning may be printed at the console, and the existing process will continue running unaffected. ".

It's because we call john show process another time beforelast call is finished. This is harmless(and doesn't really affect feature, since we'll still get one john show results). However, it doesn't look really profesionnal to have a lot of those messages in the terminal. Also, now that we call john show every 15 seconds, it's probably gonna happens even more often.

Use case :

  1. Start a new attack which will end really fast, for example, choose external mode with no name. It'll end really fast because john says: Option requires a parameter: "--external="
  2. Start a new attack again, you'll get the QProcess warning in the terminal since the previous johnShow process hasn't finished.
@mathsoft-dev
Copy link
Collaborator Author

This piece of code(from method callJohnShow) doesn't work as we thought :
1.if (m_johnShow.state() != QProcess::NotRunning)
2. m_johnShow.stop();
.....
3. m_johnShow.start();
In fact, it doesn't seem to protect us. Imagine the use case described in the first post, m_johnShow.state() == QProcess::Starting before we call m_johnShow.stop(). However, it is probably stopped asynchronously, because, before starting johnShow again(line 3), m_johnShow is still in the Starting state as the debugger shows. It is NOT stopped yet which gives the warning on the terminal.

@mathsoft-dev mathsoft-dev reopened this Jun 23, 2015
mathsoft-dev added a commit to mathsoft-dev/johnny that referenced this issue Jun 23, 2015
@mathsoft-dev
Copy link
Collaborator Author

JohnHandler::terminate(bool) wasn't doing anything to terminate the process for the case QProcess::Starting. Fixed in 6bc896d.

@mathsoft-dev mathsoft-dev self-assigned this Jun 23, 2015
@shinnok
Copy link
Member

shinnok commented Jun 24, 2015

How about we also don't call johnShow if johnAttack exited with error status?

@mathsoft-dev
Copy link
Collaborator Author

How about we also don't call johnShow if johnAttack exited with error status?

Okay, I'll make the change

mathsoft-dev added a commit to mathsoft-dev/johnny that referenced this issue Jun 24, 2015
@mathsoft-dev
Copy link
Collaborator Author

Fixed.

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

No branches or pull requests

2 participants