norbusan / ptex2pdf

convert Japanese TeX documents to pdf
GNU General Public License v2.0
413 stars 0 forks source link

Could not interprete the stop sign from new TeXworks #2

Closed kuroky49 closed 9 years ago

kuroky49 commented 9 years ago

From the version 4.6.0 of TeXworks, if a user clicks the red cross sign on the left upper part when the typeset procedure returns the error, TeXworks hangs. The change of TeXworks would be critical, but pdflatex (for alphabet world) doesn't have this problem. Could you interpret the stop sign from new TeXworks?

For the original bug report, please see http://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa/57633.html and http://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa/57639.html .

norbusan commented 9 years ago

Do you know which signal TeXworks send when trying to interrupt the sub-process? 9 (SIG-TERM) I guess.

kuroky49 commented 9 years ago

TeXworks calls QProcess.kill() when "Abort typesetting" button is pressed. I don't know Qt well, but there are some issues around kill(). See, for example, http://www.qtcentre.org/threads/52227-Kill-a-Process-started-with-Qprocess .

The problem might occur due to the update of Qt in TeXworks compilation.

kuroky49 commented 9 years ago

http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qprocess.cpp says as follows:

/*!
    Attempts to terminate the process.

    The process may not exit as a result of calling this function (it is given
    the chance to prompt the user for any unsaved files, etc).

    On Windows, terminate() posts a WM_CLOSE message to all toplevel windows
    of the process and then to the main thread of the process itself. On Unix
    and OS X the \c SIGTERM signal is sent.

    Console applications on Windows that do not run an event loop, or whose
    event loop does not handle the WM_CLOSE message, can only be terminated by
    calling kill().

    \sa kill()
*/
void QProcess::terminate()

and

/*!
    Kills the current process, causing it to exit immediately.

    On Windows, kill() uses TerminateProcess, and on Unix and OS X, the
    SIGKILL signal is sent to the process.

    \sa terminate()
*/
void QProcess::kill()
kuroky49 commented 9 years ago

The discussion from https://twitter.com/abenori/status/594264550356164608 could be also helpful.

kuroky49 commented 9 years ago

The problem was totally caused by TeXworks compilation and it was solved: http://www.tug.org/pipermail/tlbuild/2015q2/003230.html . Thank you.