[KProcessRunner] Improve error reported to user when exit code != 0
Needs ReviewPublic

Authored by ahmadsamir on Fri, Feb 7, 4:19 PM.


Group Reviewers

When a process that KRun tried to run fails to launch:

  • Tell the user when the executable could not be found
  • If we find an executable but it exited abnormally (exit code != 0 ), inform the user about that and suggest he tries running it from terminal to get more details
Test Plan

(Proceed with the sudo commands at your own risk :)):

  • 'sudo chmod a-x /usr/bin/gwenview' then try opening a picutre with gwenview from e.g. dolphin, see the error message
  • break your system slightly: sudo chmod a+x /usr/bin/gwenview & sudo mv /usr/lib64/libKF5Kipi.so.32.0.0 /usr/ then try opening a picture with gwenview from dolphin, see the error message
  • Finally: sudo mv /usr/libKF5Kipi.so.32.0.0 /usr/lib64/ to unbreak your system

BUG: 415567

FIXED-IN: 5.67

Diff Detail

R241 KIO
l-krun-exitcode (branched from master)
No Linters Available
No Unit Test Coverage
Build Status
Buildable 22182
Build 22200: arc lint + arc unit
ahmadsamir created this revision.Fri, Feb 7, 4:19 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFri, Feb 7, 4:19 PM
ahmadsamir requested review of this revision.Fri, Feb 7, 4:19 PM
ahmadsamir planned changes to this revision.Fri, Feb 7, 6:39 PM
ahmadsamir requested review of this revision.Sun, Feb 9, 8:52 AM

krununittest fails to pass, I tried to debug it but can't get it to work. Disabling the third row "QTest::newRow("tempfile") << true << false;" in KRunUnitTest::KRunRunService_data, makes it pass... I can't figure it out.

31: PASS   : KRunUnitTest::KRunRunService(standard)
31: command= "cp %f %d/dest" args= ("cp %f %d/dest", "file:///tmp/krununittest-lvuRpo/srcfile")
31: EXEC "/usr/bin/cp /tmp/krununittest-lvuRpo/srcfile /tmp/krununittest-lvuRpo//dest"
31: EXEC done
31: sleeping for 180 seconds before deleting file...
31: PASS   : KRunUnitTest::KRunRunService(tempfile)
31: QWARN  : KRunUnitTest::KRunRunService(runApp) "The executable 'cp' terminated abnormally.\nFor more details try running it from a terminal emulator (e.g. Konsole)."
31: QFATAL : KRunUnitTest::KRunRunService(runApp) QWidget: Cannot create a QWidget without QApplication
31: FAIL!  : KRunUnitTest::KRunRunService(runApp) Received a fatal error.
31:    Loc: [Unknown file(0)]
31: Totals: 30 passed, 1 failed, 0 skipped, 0 blacklisted, 387ms
31: ********* Finished testing of KRunUnitTest *********
1/1 Test #31: kiowidgets-krununittest ..........Child aborted***Exception:   0.40 sec

And jobtest fails with:
8: FAIL! : JobTest::moveDestAlreadyExistsAutoRename(files other partition) Compared values are not the same
8: Actual (spyRenamed.count()): 3
8: Expected (2) : 2
8: Loc: [/home/ahmad/rpmbuild/dev/kio/autotests/jobtest.cpp(1656)]

and the same with "(dirs other partition)", but that is unrelated AFAICS.