Bug Hunting Session
Bug 126989 - Libreoffice v6.3.0.4 hangs - Scan in Writer/ Impress/ Draw/(Calc?)
Summary: Libreoffice v6.3.0.4 hangs - Scan in Writer/ Impress/ Draw/(Calc?)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.4.0 target:6.3.1
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-17 14:38 UTC by Juergen Klatt
Modified: 2019-09-17 18:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Patched shim (15.73 KB, application/x-zip-compressed)
2019-08-18 09:09 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Klatt 2019-08-17 14:38:11 UTC
Hello,

According to the release notes that you have now implemented a 32-bit driver in the LibO (x64-bit) again, I did my first scan test.

The scanner (Epson Perfection 3170 Photo) is accessible, the image was scanned and displayed in the scanner preview.
As soon as I click on the "Scan" button in the scanner driver, the driver closes and in the moment the image data is sent to Writer, Writer (message in the title: "no respond") hangs without actually inserting the image.
When Writer restarts, I'm offered document recovery, but only a blank document is opened.

When testing with the LibO version 6.4 (see below), I have also set the new checkbox for transmitting the crash data, but I could not tell if a Crashreport was actually sent.

Tested LibO-Apps:
Writer	-->	hangs
Draw	-->	hangs
Impress	-->	hangs
Calc	-->	scanning Options greyed out :(

Tested with:

a)
Windows 10 Pro 1903 

b)
The Epson Scanner-Driver (3.04g) is the newest I can get, but it is an older one.

c)
Version: 6.3.0.4 (x64)
Build-ID: 057fc023c990d676a43019934386b85b21a9ee99
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE

d)
Version: 6.4.0.0.alpha0+ (x64)
Build-ID: 3e64065612acec2eb29aa21e2b515953422256d7
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-08-15_22:57:26
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE

e)
Tested also with deactivated OpenGL-Options, with the Same result.

f)
Message in Windows Event-Manager:

 EventData 
   soffice.bin 
   6.3.0.4 
   19d4 
   01d55504cbcf852e 
   30 
   C:\Program Files\LibreOffice\program\soffice.bin 
   459c9e98-25f8-4d30-8d7f-bd8050c26af0   
    
   Cross-thread 
   430072006F00730073002D0074006800720065006100640000000000 
------------------------------------------------------------

Binäre Daten/ binarys:

In Wörtern/ Words

0000: 00720043 0073006F 002D0073 00680074 
0010: 00650072 00640061 00000000  


In Bytes

0000: 43 00 72 00 6F 00 73 00   C.r.o.s.
0008: 73 00 2D 00 74 00 68 00   s.-.t.h.
0010: 72 00 65 00 61 00 64 00   r.e.a.d.
0018: 00 00 00 00               ....



Best Regards

Jürgen Klatt
Comment 1 Mike Kaganski 2019-08-17 14:49:39 UTC
Could you please check if a "twain32shim.exe" process is present when you see Writer hung? And what happens if you terminate it? This process is what actually communicates with the scanner; and Writer should wait for the process; we would need to debug that process if it actually hangs.
Comment 2 Mike Kaganski 2019-08-17 15:18:25 UTC
Another thing that would be great to check: if older 32-bit LibreOffice works with the scanner without problems.

Could you please download an older 32-bit release (using 6.2 portable release [1] should be fine), and test if it scans fine? That would allow to differentiate between a pre-existing problem vs something related to the new code. Thank you!

[1] http://downloadarchive.documentfoundation.org/libreoffice/old/6.2.5.2/portable/
Comment 3 Juergen Klatt 2019-08-17 18:09:57 UTC
Hello Mike,

yes, I haved used 32-bit Versions before and my scanner works fine.

No problems with this Version:
Version: 6.2.5.2 (x86)
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (de_DE); UI-Language: en-US

Since the 64-bit Versions it didn't works (twain 32-bit...).

---------------------------

A short answer maybe it is usefull:

I have used the tool "Process Explorer v16.26" downloaded from the following website for the analysis of the Windows processes:
https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

1)
I started the Process Explorer.
2)
Started Writer and the scan.
3)
Writer hangs, after the scanner driver closed.
4)
Now go back to the Process Explorer and there I killed or restart
the process of "twain32shim.exe"
5)
After that, the image is inserted in the Writer document and the hanging is gone.
Comment 4 Mike Kaganski 2019-08-18 09:03:04 UTC
https://gerrit.libreoffice.org/77659
Comment 5 Mike Kaganski 2019-08-18 09:09:23 UTC
Created attachment 153471 [details]
Patched shim

(In reply to Juergen Klatt from comment #3)

Thank you for the test!
Could you please check if the provided twain32shim.exe works correctly?
Please rename the twain32shim.exe in C:\Program Files\LibreOffice\program to e.g. twain32shim.exe.bak, and then extract the updated .exe from the attachment into the same C:\Program Files\LibreOffice\program directory; then test scanning again.

The file in the attachment is compiled with patch from comment 4 applied.
Thanks!
Comment 6 Juergen Klatt 2019-08-18 11:24:56 UTC
Hello Mike,

thank You very much.

Everything works fine.

Tested with:
Windows 10 Pro 1903

Version: 6.3.0.4 (x64)
Build-ID: 057fc023c990d676a43019934386b85b21a9ee99
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
and the new twain32shim.exe
Writer = OK
Impress = OK
Draw = OK
Calc = missing scan options, because they are greyed out

Version: 6.4.0.0.alpha0+ (x64)
Build-ID: 3e64065612acec2eb29aa21e2b515953422256d7
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-08-15_22:57:26
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
and the new twain32shim.exe
Writer = OK
Impress = OK
Draw = OK
Calc = missing scan options, because they are greyed out

-----------------

Is it in planning that in the future also from Calc can be scanned?

Thanks again for Your good work.

Best regards

Juergen Klatt
Comment 7 Commit Notification 2019-08-18 11:42:26 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/53e4d5fe73d98b109d79fc2c1f5032faea88afb9%5E%21

tdf#126989: always terminate shim after fallback complete

It will be available in 6.4.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 8 Mike Kaganski 2019-08-18 11:53:25 UTC
(In reply to Juergen Klatt from comment #6)
> Everything works fine.

Great! Fixed now in master; backport pending to 6-3.

> Is it in planning that in the future also from Calc can be scanned?

I think it should be a separate feature request (I'm sure already existing); personally I only wanted to re-enable what used to be working... But someone will surely handle that at some point.
Comment 9 Oliver Brinzing 2019-08-18 12:08:10 UTC
also checked with:

TW-Brother MFC-L2700DN LAN 3.20 (32-32):

Version: 6.3.0.4 (x64)
Build ID: 057fc023c990d676a43019934386b85b21a9ee99
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US

-> works in both cases with original and fixed "twain32shim.exe"
Comment 10 Mike Kaganski 2019-08-18 12:50:34 UTC
(In reply to Mike Kaganski from comment #8)
> > Is it in planning that in the future also from Calc can be scanned?
> 
> I think it should be a separate feature request (I'm sure already existing);
> personally I only wanted to re-enable what used to be working... But someone
> will surely handle that at some point.

tdf#120912

(In reply to Oliver Brinzing from comment #9)

Thanks!
Comment 11 Commit Notification 2019-08-19 10:24:43 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/704a9a86600a5a60d668140790fc916b5014bef9%5E%21

tdf#126989: always terminate shim after fallback complete

It will be available in 6.3.2.

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 12 Commit Notification 2019-08-29 04:09:19 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-6-3-1":

https://git.libreoffice.org/core/+/8317bd50771c38e720d493f92e32c1b41c510e1f%5E%21

tdf#126989: always terminate shim after fallback complete

It will be available in 6.3.1.

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 13 Werner 2019-09-11 20:38:36 UTC
Thanks for the new driver. I tried it but unfortunately without success.On my PC at home scanning has worked immediately after installing LO 6.3.04.Unfortunately not on our 5 training computers. Also LO 6.3.1.2 gives no change.I have one of the training computer (Win 10 Home 64 bit) hung in my wireless network at home, does not work either.Does anyone have an idea where to look further?Greetings Werner!