Bug 85056 - Writer crash after copy paste specific text
Summary: Writer crash after copy paste specific text
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Windows (All)
: high major
Assignee: Not Assigned
Keywords: regression
Depends on:
Reported: 2014-10-15 11:16 UTC by grofaty
Modified: 2014-10-29 17:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Crashing window right after paste (79.10 KB, image/png)
2014-10-16 06:11 UTC, grofaty
backtrace (12.11 KB, text/plain)
2014-10-23 09:20 UTC, grofaty

Note You need to log in before you can comment on or make changes to this bug.
Description grofaty 2014-10-15 11:16:20 UTC
Problem description: 
When I type in specific text LibreOffice Writer crashes. The same happens if I paste the text from e.g. Notepad. This problem appears on LibreOffice and I have upgraded from LibreOffice when I have never experienced any kind of crash.

P.S. Writer in my case from crashes all the time, but above is one example that I can always reproduce.

Steps to reproduce:
1. Just to make sure I have renamed the profile, so C:\Users\[username]\AppData\Roaming\LibreOffice I have renamed subfolder 4 to _4 and run a LibreOffice. I see subfolder "4" is created and so new fresh profile.
2. Type in or copy the following text from Notepad:
V Fixpack 3 je nova funkcionalnost, da lahko paket objaviš objaviš objaviš objaviš  --> there should be one line
3. And after one second LibreOffice crash window appears.

Current behavior:
LibreOffice Writer crashes.

Expected behavior:
LibreOffice Writer should not crash.
Comment 1 Joey Reid 2014-10-16 02:55:50 UTC
To be clear you copied
"V Fixpack 3 je nova funkcionalnost, da lahko paket objaviš objaviš objaviš objaviš  -->"
minus the quotes, correct?
I was not able to reproduce this issue with:
Build ID: 3fd416d4c6db7d3204c17ce57a1d70f6e531ee21
Build ID: defa080e585fb351bc4049b2f280d2e7e5256f6e
TinderBox: Win-x86@42, Branch:master, Time: 2014-10-15_01:10:51

I tried coping from both notepad and chrome. In both cases, I could not reproduce this crash. System Win 7 32bit.
Comment 2 grofaty 2014-10-16 06:09:50 UTC
I have found out if I am using my own profile then when I copy/paste the text from Firefox normal web page:

V Fixpack 3 je nova funkcionalnost, da lahko paket objaviš objaviš objaviš objavi

and it does not crashes the Writer. But if I copy some additional character (or more characters) like:

V Fixpack 3 je nova funkcionalnost, da lahko paket objaviš objaviš objaviš objavi

then Writer crashes. It looks like some problem with end of line character or something. If I copy the text to Notepad and Writer does not crashes. I don't know if I copy more text from Notepad and then Writer crashes. Strange.

But what is interesting if I rename LibreOffice profile and so new clean profile is created then it is 10 times worse. Writer crashes on EVERY copy/paste from Firefox web page or Notepad.

See attachment print-screen of crashes. Is this ordinary LibreOffice crash window or is this some kind of Windows crash notification window?

Is there anyway I can get some additional info about crash. Default crash window is not informative at all.
Comment 3 grofaty 2014-10-16 06:11:25 UTC
Created attachment 107912 [details]
Crashing window right after paste
Comment 4 Joel Madero 2014-10-23 01:46:13 UTC
Ubuntu 14.04 x64 - copy/paste from firefox.  No crash.

If you'd like to do a debug for us that'd be fantastic: https://wiki.documentfoundation.org/Development/How_to_debug#Debugging_with_WinDbg_.28on_Windows.29
Comment 5 grofaty 2014-10-23 09:20:15 UTC
Created attachment 108292 [details]

I have installed WinDbg tool following instructions:

I am attaching backtrace file. Hope this helps. I am not an expert, but there is interesting error:

Fatal Python error: Py_Initialize: can't initialize sys standard stream

It looks like Python (probably integrated LibreOffice Python) crashes at initialize process. Just for note, I my LibreOffice is installed in the following path: C:\Programs\LibreOffice4. Is Python expecting some other path like C:\Program files\LibreOffice4 or something?

Do you need some additional info?
Comment 6 Joel Madero 2014-10-23 14:07:33 UTC
Nope - that's sufficient for now. Thanks!

We're always looking for new talent to join QA in triaging bugs. Since you were able to follow the instructions and get a backtrace, it would be great if you had a bit of time to help us get through our list of unconfirmed bugs. Send me an email if you're interested!

Thanks :-D
Comment 7 grofaty 2014-10-24 07:49:35 UTC
I have been searching the web and I see other non-LibreOffice users also experience the same Python crash error. It looks like there is something wrong with embed Python that is fighting with some other program that also has embed Python in it.


I tried to search for other Python.exe files on my disk:

C:\>dir python.exe /s
 Volume in drive C has no label.
 Volume Serial Number is DCD7-FA64

 Directory of C:\Programs\ActiveStateKomodoEdit8\lib\python

06.06.2013  12:45            27.136 python.exe
               1 File(s)         27.136 bytes

 Directory of C:\Programs\gimp2\Python

15.05.2013  21:43            26.624 python.exe
               1 File(s)         26.624 bytes

 Directory of C:\Programs\LibreOffice4\program

18.09.2014  17:16            19.232 python.exe
               1 File(s)         19.232 bytes

 Directory of C:\Programs\LibreOffice4\program\python-core-3.3.3\bin

18.09.2014  12:19            27.136 python.exe
               1 File(s)         27.136 bytes

What I can see from above result there are Komodo Edit and Gimp programs that are also using embed Python.			   

I am using Windows in virtual machine, so I can play around and make several clean tests. I did the following:

a) Uninstall Gimp.			   
b) Try to reproduce a problem in LibreOffice Writer also debugging with WebDbg tool and there is Python crash in WebDbg.

c) Additionally uninstall Komodo Edit.
d) Try to reproduce a problem in LibreOffice Writer also debugging with WebDbg tool and there is Python crash in WebDbg.

e) Additionally uninstall LibreOffice and manually delete C:\Programs\LibreOffice4\ installation directory.
f) Install LibreOffice 4.3.2 (the same version that was installed up to know).
g) Try to reproduce a problem in LibreOffice Writer, but problem does not appear any more! Problem solved.

It is possible that some Pyhton variables are prior to TEST 3 still pointed to some other now non-existing path, so reinstall helped a bit. I will try to play around when I have time to, to really see what is going on.
Comment 8 grofaty 2014-10-24 09:07:58 UTC
I reverted virtual machine back to original state before TEST 1 in my previous post, so now LibreOffice Writer crashes again as expected.

1. I didn't uninstall Gimp or Komodo Edit.
2. Uninstall LibreOffice
3. Manually delete C:\Programs\LibreOffice4 directory (this is directory where I have had LibreOffice installed), to make sure all uninstall left overs are removed. I haven't deleted profile from C:\Users\[user]\AppData\Roaming\LibreOffice\4 - so profile hasn't been touched.
4. Install LibreOffice (the same one as uninstalled) back to directory C:\Programs\LibreOffice4
5. Try to reproduce the problem and I can't. So problem solved.

When I installed LibreOffice I installed it over EXISTING installation of LibreOffice which was working fine without crashing.

I don't know it looks to me that there was some left over from previous install. I always installed LibreOffice in existing installation. Maybe something has left over from or even one of the previous one.

So I suggest to look into installation program if it does everything as expected.

P.S. I manage to fix the problem fighting with it several days, but some non-technical user may just leave LibreOffice as broken.

Comment 9 tommy27 2014-10-26 07:12:43 UTC
so basically the bugs is only reproducible if you install over
is it correct?
Comment 10 oscar valenzuela 2014-10-26 19:42:26 UTC
No repro in LibreOffice (Dev) 4.4.0 alpha1 under Mac OS X 10.10 (Yosemite) x86-64.
Comment 11 grofaty 2014-10-27 10:22:51 UTC
@tommy27, it looks like to me. The problem appeared after installing LibreOffice over, but I have done such a migration many many times. So it also could be some left over from any other previous migration.

Final point is uninstalling and manually deleting left overs and installing again solves the problem.

But you never know, maybe some other product on my PC has corrupted some Python variable or something similar and LibreOffice stopped working. Maybe I should install over existing (the same version), but I haven't tried that and I don't have exact environment anymore (I have deleted virtual machines, because I have found work-around for the problem).

@oscar valenzuela, I am not sure about OSX, but if I am not mistaken, Python is only embed in LibreOffice for Windows. On Linux it is used default package already installed on Linux distribution. I am not sure about OSX. So in my humble opinion the only relevant test is Windows, because LibreOffice install has some specifics about Python embed install. I hope I am not mistaken, this is as far as I remember reading some LibreOffice document few months ago.
Comment 12 Joey Reid 2014-10-29 01:13:25 UTC
Marking it as fixed since a clean profile solved the problem and we cannot reproduce it.
Comment 13 grofaty 2014-10-29 16:14:31 UTC
I am reopening this bug report. I can't exactly reproduce the problem like described in bug report (first post), but today I have been working with LibreOffice Writer and Calc and it is pure hell, it just crashes every two to three minutes. Some times it crashes 10 times in minute and then like 5 minute without crash. Totally useless... Crashing got from bad to worse. 

It is hard from my perspective, because I don't use LibreOffice for like 10 days, then when I need it like writing some documentation then I need it for 3 hours.

Today I have used LibreOffice in deep. Need to write some document.

What I have found now I just can't reproduce the bug, it just can't be reproduced. It crashes on no particular action, it crashed:
1. On copy/paste some text (something like first post of this report). But not always.
2. Copy/paste image from another program. But not always.
3. After typing some text, nothing in particular and never know when crash will appear.
4. After for example clicking on an Autospell check icon from toolbar etc.

At some point I counted and I need to recover a file 15 times per minute. But it happen even bigger problem. At one moment my document was quite large and after clicking repair document after crash and document recovered and LibreOffice crashes right away and doing this for 5 times in a role. So now I am in trouble of opening a document and continue working on it.

At this point I needed to work and finish because of a death line and I was forced to do the following:
1. Uninstall LibreOffice
2. Manually deleted install left overs from C:\Programs\LibreOffice4 (my install dir).
3. Install back into same location C:\Programs\LibreOffice4

And now I was able to open crashed document and recovery went OK and now after 3 hours of full time work with Writer I NEVER faced the crash again.

So it looks like there is some nasty bug in LibreOffice that was introduced somewhere between and

The whole point is crash is totally unpredictable and not reproducable. I don't think someone will gonna be able to reproduce the problem.

But in my humble opinion it got to be something wrong with Python. I suggest that some developer looks into debug file I have created few days ago.

Please do contact me I am willing to make any additional test if required. Until fixed I am stuck to LibreOffice 4.2.6 branch.
Comment 14 Joel Madero 2014-10-29 17:28:24 UTC
Please don't reopen bugs unless you are positive it's the same problem. Please report a new bug.