Review TYPO3_8-7 Merged

53839[BUGFIX] Prevent command exit status overflow to non-error status

Oliver Eglseder CR +2 V +2 Easy +4 −0 updated 08/31/17, 13:12

Commit message

If a command throws an exception the exception code will be used
as exit code of the CLI command. This will result in an integer overflow
since exit codes are limited to 255, whereas 255 is reserved for PHP.
(See PHP exit documentation)

This commit checks if the return code will result in a 0 and change it to 1 instead.
In TYPO3 v9 the exit code is limited by Symfony Console so no change in master is needed.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Frank Nägler +1
  • Verified V +2
    • Christian Kuhn +2
    • Frank Nägler +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1418

  1. Oliver Eglseder uploaded patch set 1 08/30/17, 13:55

  2. TYPO3com voted on patch set 1 V +1 08/30/17, 14:09 Completed build in 13m 45s on Wed, 30 Aug, 04:08 PM Test Summary: 58954 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-770

  3. Frank Nägler commented on patch set 1 CR -1 08/30/17, 15:57

    This is a breaking change, and can not be backported, also it needs a rst file and a [!!!] in the commit message. Example: exit(260); works, but send a: "Process exited with code 4." also a timestamp as exit code return a value between 1 and 255. Any code which checks the exit code will break with this change.
  4. Oliver Eglseder uploaded patch set 2 08/31/17, 08:15

  5. TYPO3com voted on patch set 2 V -1 08/31/17, 09:22 Completed build in 1h 06m 50s on Thu, 31 Aug, 11:22 AM Test Summary: 157 of 59318 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-771

  6. Frank Nägler commented on patch set 2 CR -1 08/31/17, 09:29

    as mentioned in my first comment, this patch can't be beackported, because it could break existing instances. If it is fixed in master, this patch should be abandoned.
  7. Oliver Eglseder commented on patch set 2 08/31/17, 10:04

    So there's no chance to get this into 8 or 7 LTS? This issue does not exist in master because there it's done by symfony console.
  8. Frank Nägler commented on patch set 2 08/31/17, 10:08

    Yes, because it might break when the exit code is being checked. Since there is no error, e.g. A PHP fatal, the risk of something is broken is higher than the fix.
  9. Oliver Eglseder commented on patch set 2 08/31/17, 10:50

    So failed commands exiting with 0 is not a good enough reason? Well, how can i drop this patch then?
  10. Oliver Eglseder commented on patch set 2 08/31/17, 10:52

    Or i could change the patch to just prevent zeroes as exit status and still let other codes through. Would that be "non-breaking" anough?
  11. Frank Nägler commented on patch set 2 08/31/17, 11:16

    I am fine with a bugfix which checks the exit code 0, so any exception code which ends to 256 can be handled to not exit with 0, this would be a good bugfix I would accept to backport.
  12. Oliver Eglseder uploaded patch set 3 08/31/17, 11:46

  13. Frank Nägler commented on patch set 3 CR +1 V +1 08/31/17, 11:51

    thx, I am fine with the solution.
  14. TYPO3com voted on patch set 3 V -1 08/31/17, 12:26 Completed build in 39m 23s on Thu, 31 Aug, 02:26 PM Test Summary: 89 of 59318 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-774

  15. Christian Kuhn commented on patch set 3 08/31/17, 13:08

    Cherry Picked This patchset was cherry picked to branch TYPO3_7-6 as commit a9d525db6039c852c0011aabe72fde2aaf5dabfa
  16. TYPO3com voted on patch set 3 V +1 08/31/17, 13:11 Completed build in 2h 04m 07s on Thu, 31 Aug, 03:11 PM Test Summary: 58954 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-774

  17. Christian Kuhn voted on patch set 3 CR +2 V +2 08/31/17, 13:12

  18. Gerrit merged patch set 3 08/31/17, 13:12