Bug 111908 - soffice --help crashes / fails assertion / silently fails
Summary: soffice --help crashes / fails assertion / silently fails
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.4.0.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.0.0 target:5.4.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Assert
  Show dependency treegraph
 
Reported: 2017-08-19 11:20 UTC by Aron Budea
Modified: 2017-09-20 22:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-08-19 11:20:19 UTC
This is likely Windows-only (tested with Win 7).

Run 'soffice.exe --help' in a 6.0 master build.
- If it's a release build, there's a crash in ucrtbase.dll
- If it's a debug build, there's an assert in minkernel\crts\ucrt\src\appcrt\lowio\isatty.cpp, line 17: Expression: (fh >= 0 && (unsigned)fh < (unsigned)_nhandle)

In 5.4.0.3 or 5.4.1.1 soffice.exe exits silently.

Help displays fine in 5.3.4.2, so this is a regression.
Comment 1 Aron Budea 2017-08-19 13:29:17 UTC
Bibisected the the commit referenced below using repo bibisect-win32-5.4.
Adding Cc: to Mike Kaganski, please take a look sometimes.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=601bdc416b6ef17498c94fec49164b1b4c38528d
author		Mike Kaganski <mike.kaganski@collabora.com>	2016-11-25 03:39:30 (GMT)
committer	Mike Kaganski <mike.kaganski@collabora.com>	2016-12-23 04:54:35 (GMT)

tdf#100826: Use parent console for output if possible
Comment 2 Jean-Baptiste Faure 2017-08-20 06:07:10 UTC
(In reply to Aron Budea from comment #0)
> This is likely Windows-only (tested with Win 7).

Indeed, no crash for me under Ubuntu with LO 5.4.0 from Ubuntu PPA, LO 5.4.2.0.0+ and LO 6.0.0.0.alpha0+ both built at home. 

Best regards. JBF
Comment 3 Mike Kaganski 2017-08-21 06:54:32 UTC
A patch is in gerrit: https://gerrit.libreoffice.org/41378
Comment 4 Mike Kaganski 2017-08-21 07:27:53 UTC
A clarification (something that confused me first):

the problem is not reproducible if soffice is run from Windows' cmd.exe or a shortcut. It is reproducible when run from cygwin shell.
Comment 5 Commit Notification 2017-08-21 07:50:50 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7766135f1ca11f942eb5b9ccc7828d55acfbe28f

tdf#111908: only freopen if we try to use another console

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Mike Kaganski 2017-08-21 07:51:02 UTC
Backport to 5-4: https://gerrit.libreoffice.org/#/c/41379/
Comment 7 Aron Budea 2017-08-21 09:40:04 UTC
(In reply to Mike Kaganski from comment #4)
> A clarification (something that confused me first):
> 
> the problem is not reproducible if soffice is run from Windows' cmd.exe or a
> shortcut. It is reproducible when run from cygwin shell.
Not sure what the difference is, but for me it happened from cmd.exe.
Nevertheless, thanks for the fix, Mike!
Comment 8 Commit Notification 2017-08-22 14:57:23 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ae5accf8e7280c83e95d64cdfbe6fb0729a67b8d&h=libreoffice-5-4

tdf#111908: only freopen if we try to use another console

It will be available in 5.4.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.