Bug 127547 - Freeze/crash in Microsoft Print to PDF dialog when trying to paste (Ctrl-V) a filename in the 'Save Print Output As' dialog
Summary: Freeze/crash in Microsoft Print to PDF dialog when trying to paste (Ctrl-V) a...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Windows (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0 target:7.6.4
Keywords:
: 149998 (view as bug list)
Depends on:
Blocks: Crash
  Show dependency treegraph
 
Reported: 2019-09-14 15:57 UTC by bitcat70
Modified: 2023-11-30 11:25 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
File used when the bug was encountered (119.66 KB, application/vnd.oasis.opendocument.text)
2019-09-14 16:01 UTC, bitcat70
Details
bts on windbg (66.66 KB, text/plain)
2020-01-22 10:50 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bitcat70 2019-09-14 15:57:46 UTC
Description:
The program freezes when pasting text into the "File name:" field in the "Microsoft Print to PDF" printer.

Steps to Reproduce:
1. Copy text from withing the document to be used in/as the file name.
2. Open the "Print" dialog.
3. Select "Microsoft Print to PDF" as the printer and click "OK".
4. Paste the copied text into the "File name:" field.
5. Freeze.

Actual Results:
The application froze.

Expected Results:
Save the file as a PDF on my desktop.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 6.2.7.1 (x64)
Build ID: 23edc44b61b830b7d749943e020e96f5a7df63bf
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL

After copying the text inside of LibreOffice Write document I followed the steps in another program, IrfanView, and it worked as expected.

GL Report:
Renderer: AMD Radeon HD 7700 Series
Vendor: ATI Technologies Inc.
Memory: 1024 MB
Version: 4.6.13559 Core Profile Forward-Compatible Context 26.20.12001.7006
Shading language version: 4.60
Comment 1 bitcat70 2019-09-14 16:01:53 UTC
Created attachment 154161 [details]
File used when the bug was encountered

The first two words from the document, "Understanding Broilers", were copied and pasted into the "File name:" field of the "Microsoft Print to PDF" dialog when the bug was encountered.
Comment 2 Oliver Brinzing 2019-09-15 08:31:30 UTC
reproducible, even with AOO 4.1.5
Comment 3 Julien Nabet 2019-09-16 09:39:05 UTC
On Win10 with master sources updated today, I don't reproduce this.
However, it creates a PDF named "Understanding Broilers" containing just "Understanding Broilers" (!!).
Comment 4 sdc.blanco 2019-12-13 02:41:35 UTC
I can confirm with

Version: 6.4.0.0.beta1 (x64)
Build ID: 4d7e5b0c40ed843384704eca3ce21981d4e98920
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: en-US (en_DK); UI-Language: en-US
Calc: CL

Additional information.

A.  Simpler procedure to produce, using an empty / new / minimal document.

For example: 

1.  Open New Document.
2.  Write "abcd" on the first line, then select and copy (Ctrl-C)
3.  Open "Print" dialog.
4.  Select "Microsoft Print to PDF" as the printer and click "OK".
5.  Paste (Ctrl-V) into the File name field in the "Save Print Output As" window.

Actual result:  Freeze (i.e., cannot cancel or close the "Save Print Output As" window, cannot access other document windows).  

B. According to Microsoft's Task Manager, both soffice.exe and soffice.bin are running, but LO is not responsive.

C. If Ctrl-V has nothing in its buffer to paste (i.e., is "empty"), then no freeze when using Ctrl-V

D.  No problem to write manually into the Field name and print the document (to PDF).
Comment 5 Julien Nabet 2019-12-17 13:55:21 UTC
On Win10 with master sources updated today, I could reproduce this.
I noticed we had the same pb with "Microsoft XPS Document Writer".
Comment 6 Julien Nabet 2020-01-21 14:44:29 UTC
Mike: noticing https://cgit.freedesktop.org/libreoffice/core/commit/?id=84be3e396cae16a975c7c7f5b892e6b615b73356, thought you might have some idea here?
Comment 7 Julien Nabet 2020-01-22 10:50:04 UTC
Created attachment 157317 [details]
bts on windbg

Here are all the bts retrieved on Windbg on Win10 with master sources updated today.

Steps to retrieve them:
- launch LO from cygwin term
- launch Windbg and attach LO process + "g"
- reproduce the freeze with sdc.blanco's comment
- Ctrl-c one (2 times if needed) on Cygwin
=> Windbg allows to launch the following command:
~*k
All bts display on Command window
but you can't copy paste bts from Windbg since clipboard is locked for all apps in Windows.
solution: in Windbg, menu Edit, Write Window Text to File...
Comment 8 Julien Nabet 2020-01-22 16:16:31 UTC
Let's increase a bit importance since clipboard problem seems to have larger impact than printing.
Comment 9 QA Administrators 2022-01-22 03:56:17 UTC Comment hidden (obsolete)
Comment 10 sdc.blanco 2022-01-22 13:10:58 UTC
works for me

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: bb29b12a9e367d181a5d9d962d466df41e093e0c
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL
Comment 11 Steven Casey 2023-11-13 01:31:52 UTC
*** Bug 149998 has been marked as a duplicate of this bug. ***
Comment 12 Steven Casey 2023-11-13 01:35:18 UTC
Not reproducible for me. Considering sdc (comment 10) can't reproduce either, going to mark this report as WORKSFORME.

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 32; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 13 Buovjaga 2023-11-13 05:44:15 UTC
Still repro.

However, in bug 149998 comment 1 Stuart said "happens with other applications as well. Word 2019 for example". So it might be notourbug.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c0c8cffd3541e3cd616c96791b04e7ebf2b2ed03
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 14 Hossein 2023-11-13 09:19:17 UTC
Reproduced with:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5dac0fe157a5c35824cab2c27e391ff7a0d1d421
CPU threads: 20; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

While debugging with "Visual Studio 2022", I pressed pause button when freeze happened.

Using "Enable Just My Code" option, I get this message:

Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code)

When not using the above option, I get this stack trace:

ntdll.dll!NtWaitForSingleObject()
KernelBase.dll!WaitForSingleObjectEx()
nvwgf2umx.dll!...()
nvwgf2umx.dll!...()
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

During the period of the freeze, copy/paste does not work in any application.

Note that I don't face freeze when doing the same thing in MS Office Word, copy text from Word and pasting that in the print dialog.
Comment 15 Commit Notification 2023-11-13 13:04:02 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/07dfeffae8cba808dbad85dfed9b6a693a1f9543

tdf#127547 Freeze in Microsoft Print to PDF dialog

It will be available in 24.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 16 Noel Grandin 2023-11-13 13:10:56 UTC
Thanks to Julien for providing a useful stacktrace, and to Hossein for testing the patch
Comment 17 Julien Nabet 2023-11-13 13:41:28 UTC
(In reply to Noel Grandin from comment #16)
> Thanks to Julien for providing a useful stacktrace, and to Hossein for
> testing the patch

No pb, if providing a bt or a Valgrind trace may help don't hesitate to ask! :-)
Comment 18 Commit Notification 2023-11-30 11:25:23 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/98a35222bdc0b4dcf146c40248799addd2fbf510

tdf#127547 Freeze in Microsoft Print to PDF dialog

It will be available in 7.6.4.

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

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