Closed Bug 883554 Opened 11 years ago Closed 11 years ago

Defect - Clipboard empty after copying due to other applications having the clipboard open

Categories

(Core :: Widget: Win32, defect, P1)

22 Branch
x86_64
Windows 7
defect

Tracking

()

VERIFIED FIXED
mozilla25
Tracking Status
firefox22 --- affected
firefox23 + verified
firefox24 + verified
firefox25 + verified

People

(Reporter: Kensie, Assigned: bbondy)

References

Details

(Keywords: regression, Whiteboard: feature=defect c=Context_menus u=metro_firefox_user p=1)

Attachments

(4 files)

I used to have intermittent problems when copying from Firefox, sometimes it would paste what was in the clipboard previously. This wasn't happening reliably enough though to test.

Lately (within the last month I think? I can do more checking if needed, just haven't had time) fairly reliably when I copy from Aurora the clipboard then becomes empty. I usually have to copy everything twice now (I'd say 90% of the time). If I try and right-click to paste, paste is greyed out. Nothing pastes in other apps either, clipboard is good and empty.

Again, I'm using Aurora, I am usually on the current build, I believe this problem started in May, but it happens reliably enough that I should be able to find a regression window. I have not yet tried on a new profile, though I regularly use 2 profiles, seeing it on both.
I have an update, it seems that the clipboard isn't empty but somehow Aurora loses "connection" to it. If I try and paste in another app it will paste the last thing I copied. Even after successfully pasting in another app, if I right-click in Aurora paste is greyed out.
ugh, reread before hitting send - by last thing I mean that I will have copied something, x, and it will have worked fine. Then I try to copy y and Aurora loses touch with the clipboard. If I try and paste in another app, it pastes x.
I have this problem as well. In my case it doesn't just leave the clipboard empty - it leaves whatever was there before.

I can repro it with right click->Copy (from context menu), ctrl+c, etc.
Keywords: regression
Someone mentioned https://bugzilla.mozilla.org/show_bug.cgi?id=842361 in one of the dupes, which seems plausible.
Summary: Clipboard empty after copying → Clipboard empty after copying from a site that has clipboard events
Ya bug 842361 seems right, I cannot reproduce this myself, I tried a variety of things mentioned in the forum and dupes, but based on the number of dupes this is definitely a problem for some people. 

I think the problem is with EmptyClipboard being called for the selection clipboard (which Windows doesn't support) and we are emptying the clipboard but somewhere else they expect us to do nothing there.
Assignee: nobody → netzen
Attachment #771614 - Flags: review?(jmathies)
the problem seems to be reproducible/apparent when the current zonealarm free firewall is installed...
Attachment #771614 - Flags: review?(jmathies) → review+
I don't have a firewall installed. My HP came with a Norton trial, I just ran Norton's uninstall tool just to be sure, still having the problem.
Yeah, I don't have any firewalls or weird addons/global hooks like that installed either.
I would gladly test a version of FF22 with the patch if someone would like to compile it & provide a link to the installer.
We'll be able to test with the latest nightly once this lands on central. I'm pretty sure this will fix the problem for those who get the problem.

https://hg.mozilla.org/integration/mozilla-inbound/rev/b3e2267ea811
Target Milestone: --- → mozilla25
I was able to reproduce this in a clean profile, using a single tab (it doesn't start happening right away) on a static page (no adds, no js, just text and links). It is easier to trigger using right-click > copy link location. 

In fact, on this static page http://nextstreetcar.ca/ I can regularly reproduce the issue with right-click > copy link location I have not yet been able to reproduce the issue when highlighting and copying text (I can reproduce this on other pages but they had eg flash ads).
Target Milestone: mozilla25 → ---
Target Milestone: --- → mozilla25
Status: NEW → ASSIGNED
Priority: -- → P2
QA Contact: jbecerra
Summary: Clipboard empty after copying from a site that has clipboard events → Defect - Clipboard empty after copying from a site that has clipboard events
Whiteboard: feature=defect c=Context_menus u=metro_firefox_user p=1
https://hg.mozilla.org/mozilla-central/rev/b3e2267ea811
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
is it possible to uplift the bugfix to firefox 23 beta?
Probably I'll be requesting it shortly.  Could someone who can reproduce it verify it as fixed with this build?

http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2013-07-08-03-11-14-mozilla-central/firefox-25.0a1.en-US.win32.installer.exe
ok, i've reinstalled the zonealarm firewall again, but the issue still seems to be present in the build you've provided.
Could you provide a link to the zonealarm you're using.  Did this work on Firefox v21 for you correctly?

I'm wondering if there's 2 issues or 1 here. 
If anyone else can also confirm it's not fixed or fixed that would be great.
i wasn't affected myself originally but many users in the sumo forums were reporting the copy/paste issue in relation to zone alarm. 
i've installed the free firewall myself from http://www.zonealarm.com/security/en/trialpay-za-signup.htm (zafwSetupWeb_110_768_000.exe), installed with the strict settings but allowed any subsequent requests for access & could replicate the issue myself with firefox 22 and above (including the build you've linked to above) - in firefox 21 it still seemed to be alright. copy and pasting only works intermittently (sometimes you have to copy anything a few times in a row for the bug to appear).

should i file a separate report for it?
that's probably best, it's not clear to me if everyone who had this issue had zone alarm installed.
I still see it with that nightly. I don't have Zone Alarm installed. Does any OEM distribute Zone Alarm or are these all self installed?

One of the cc'ed bugs mentioned a regression window, I'll do that testing now and see if I have the same window. I'm not 100% if this bug is happening on my laptop, I'll keep testing there as well (I mostly use it for troubleshooting which does not involve copy/paste).
Here's something interesting, I know I had Norton on this machine when it came new, I can't find anything that says it had Zone Alarm (I will contact support to find out) but I ran the Zone Alarm uninstaller anyway http://download.zonealarm.com/bin/free/support/download/clean.exe and now I don't seem to be able to reproduce the problem.
i probably don't have to file a bug report for zonealarm myself - the user in the duped bug 883554 has already mentioned the presence of the firewall...
Given that this hasn't landed past mozilla-central yet, and there are a lot of dupes and people CC'ed on this issue, I'm going to re-open.  Normally we create new bugs for followup work unless it will be landed but I think in this case it'll be cleaner to re-open.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #771614 - Attachment description: Patch v1. → Only clear Global Clipboard - rev1.
I installed zonealarm and could reproduce the problem a couple times, but it since went away completely. I think it's something to do with timing and I suspect maybe an extra open/close clipboard too close to another one is causing a problem.
Attachment #771614 - Attachment description: Only clear Global Clipboard - rev1. → [already landed] Only clear Global Clipboard - rev1.
Attachment #772165 - Flags: review?(jmathies)
Confirmed, I only had NIS 2011, which I ran the uninstall tool for, so either the zonealarm cleanup tool gets something that norton left behind, or it does something else maybe set by another program?
(In reply to Brian R. Bondy [:bbondy] from comment #30)
> Created attachment 772165 [details] [diff] [review]
> Use OleSetClipboard to clear - rev1
> 
> I installed zonealarm and could reproduce the problem a couple times, but it
> since went away completely. I think it's something to do with timing and I
> suspect maybe an extra open/close clipboard too close to another one is
> causing a problem.

This was happening to me out of the blue, not with massive copy/pasting. I'd be working (handling customer tickets) and find one that was a dupe, go to copy the url of the ticket and nope, didn't work. Or I'd get a ticket where the user needed a link to a support doc, again, I'd copy/paste only to find it didn't work.
Attachment #772165 - Flags: review?(jmathies) → review+
I can confirm that removing ZoneAlarm Free Firewall solves the problem for me, and that the issue still exists in the build from comment 21.
I caught the error in a debugger and the problem is that when trying to set the clipboard data it fails with cannot open clipboard, which failed with access denied.

You get that failure when another application already has the clipboard open.

I think what's happening is this:
In particular nsBaseClipboard::SetData first calls EmptyClipboard and then calls SetNativeClipboardData.  The call to SetNativeClipboardData fails because zonealarm has the clipboard open because it seen the clipboard changed in EmptyClipboard and it tried to scan it.
Ideally what the code in nsBaseClipboard would do is open the clipboard, then clear, then set data, then close the clipboard. Bu thte API is currently designed to have clear and set independent, which causes problems with zonealarm who tries to scan after it detects a change.
I should point out again that I have this problem without ZoneAlarm installed; however I wouldn't be shocked if some other app I have running does a similar thing (locking the clipboard for a few ms to scan it). How can I identify the app?
Same here, the problem came back. I thought I had reproduced this issue after restart but I probably didn't and that's probably what stopped the issue from showing up.

I am probably running windows defender, but definitely no 3rd party security software.
Decided to throw this review at you after all since it only has non trivial effects on Windows.  See the previous couple comment for details about what the problem was. I can no longer reproduce with this newest patch even with a clean install of zonealarm.
Attachment #772234 - Flags: review?(jmathies)
Attachment #772234 - Attachment description: Don't empty if setting ata anyway - rev 1 → Don't empty clipboard if doing a SetData - rev 1
So when does this stuff get added? Will it be applied to the next FF23 beta? A 22.01 release? Otherwise? Thanks. :)
Once it is confirmed fixed, it will likely be uplifted to Aurora and Beta. Beta goes to release on or around August 6, 2013.
Comment on attachment 772234 [details] [diff] [review]
Don't empty clipboard if doing a SetData - rev 1

Please add a good comment somewhere explaining why we do this.
Attachment #772234 - Flags: review?(jmathies) → review+
Summary: Defect - Clipboard empty after copying from a site that has clipboard events → Defect - Clipboard empty after copying due to other applications having the clipboard open
(In reply to Brian R. Bondy [:bbondy] from comment #42)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/5f62c9519423

There is a typo ("becacuse") in the comment. ;)
oh well :)
https://hg.mozilla.org/mozilla-central/rev/a8daf8516ed2
https://hg.mozilla.org/mozilla-central/rev/5f62c9519423
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Hi folks,

I'm new to bugzilla and this forum. I have noticed this inability to copy issue since v22. I do have ZoneAlarm free version on Win 7. (Have hated ZA for a while actually but am still using it.)

Excuse my ignorance, but how do I go about fixing this issue? Will FF update automatically in a day or two, or do I need to use the v23 beta or something?

Hopefully I don't have to wait until August or whenever the next FF update is because this issue renders FF useless for me. (Cutting and pasting all day long at work.) I have just been using Chrome in the mean time but would prefer to use FF.

Thanks!
Could someone try using the new nightly build to let me know if the issue is fixed?

http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2013-07-11-03-02-04-mozilla-central/firefox-25.0a1.en-US.win32.installer.exe

---

Hey Mike, you can try using a Nightly build where it may be fixed now. It'll likely get uplifted to aurora and beta once we confirm fixed.
I tried the nightly build and it fixed the problem
Attachment #771614 - Attachment description: [already landed] Only clear Global Clipboard - rev1. → Only clear Global Clipboard - rev1.
Contains the 3 r+ed patches, for easier uplift.
Attachment #774260 - Flags: review+
Comment on attachment 774260 [details] [diff] [review]
Patch v1 - consolidated patch for uplift to aurora and beta

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 842361
User impact if declined: Some users with programs that monitor and scan clipboard contents will cause Firefox copy to fail.  Zone alarm is an example of such a program, but there are others too.
Testing completed (on m-c, etc.): I could reproduce with ZoneAlarm and the problem is gone now.  Someone else also confirmed fixed on m-c. 
Risk to taking this patch (and alternatives if risky): Very low
String or IDL/UUID changes made by this patch: None
Attachment #774260 - Flags: approval-mozilla-beta?
Attachment #774260 - Flags: approval-mozilla-aurora?
Priority: P2 → P1
Comment on attachment 774260 [details] [diff] [review]
Patch v1 - consolidated patch for uplift to aurora and beta

Given the low risk and the patch verification confirmation, approving on aurora and beta.
Attachment #774260 - Flags: approval-mozilla-beta?
Attachment #774260 - Flags: approval-mozilla-beta+
Attachment #774260 - Flags: approval-mozilla-aurora?
Attachment #774260 - Flags: approval-mozilla-aurora+
I still have problem with copy function on firefox if I try to copy non editable text from youtube or fb. Tried firefox 22, firefox aurora (13/07/2013), firefox 22 portable. Reset profile 3 times, restart with addons disabled, delete profile folder from firefox portable. I have zonealarm installed (zonealarm toolbar disabled) but I don't have copy/paste problems with other programs.
Sorry for posting again, I can't copy text from this page, my yahoo mail, 9gag.com but I can from about:support .
Alex (making assumptions from your email!) - see Comment 52, it mentions what versions of Firefox this fix will become available in. The fix isn't in for 22 as that's when the problem appeared. 

I'm not sure if the fix is in the version of Aurora you tested, hopefully someone will confirm which date of Aurora/Beta the fix is in, so I can watch for the issue, too. I couldn't repro the bug in the nightly from Comment 47, but I also wasn't reproducing the bug as frequently in non-patched builds at the time either.
That is expected, please try the build in comment 47.  Aurora and Beta just landed so it will be in the next build of those types.  The fix will be in FF23+.
Sorry, I saw comment 52 and thought bug was fixed in Aurora. Currently I can't copy non editable text from any site, few days before I could. I'll try nightly.
Keywords: verifyme
Reproduced the issue on FF 23b5 with ZoneAlarm installed.
Verified fixed FF 23b6 Win 7 x64.
User Agent :Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20130717 Firefox/25.0
Build ID: 20130717030207(latest nightly)

User Agent :Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130717 Firefox/24.0
Build ID: 20130717004002 (latest Aurora)

User Agent :Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
Build ID:20130717030207 (FX 23 B6 release)

Tested on above builds. Ctrl+c and Right click copy, and Ctrl V and Right click paste working fine on Windows 7 64 bit.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Works for me for iteration-10.

Tested on Windows 8.1 Preview using latest nightly from ftp://ftp.mozilla.org/pub/firefox/nightly/2013/07/2013-07-17-03-02-07-mozilla-central/ for Metro Firefox.
(In reply to Brian R. Bondy [:bbondy] from comment #47)
> Could someone try using the new nightly build to let me know if the issue is
> fixed?

For me, it looks like c&p only works, if I don't close my Seamonkey(Trunk) before pasting the clipboard anywhere.

(My Tinderbox-builds)
Last good: 20130709095550
First bad: 20130711023249
That sounds right, Seamonkey would also have the problem and will also get the same fix for newer builds.
(In reply to Brian R. Bondy [:bbondy] from comment #62)
> That sounds right, Seamonkey would also have the problem and will also get
> the same fix for newer builds.

Thank you. I thought, because the Bug is in 'core', the Fix also is in Seamonkey.
Note: the Bug came into seamonkey 'after' the fix was checked in.
The copy/paste thing seems to be fixed in as much as it works now, but it doesn't work properly, as it seems to do what it has always done, which is to randomly insert line feeds and carriage returns and leading/trailing spaces, that shouldn't be there. You don't see this if you are just pasting into 'text', but when I try to paste things, typically a 6-10 digit alpha-numeric string, into say a cell in Access or Excel, I end up with these. Using IE, this does not happen.
(In reply to Gus from comment #65)
> The copy/paste thing seems to be fixed in as much as it works now, but it
> doesn't work properly, as it seems to do what it has always done, which is
> to randomly insert line feeds and carriage returns and leading/trailing
> spaces, that shouldn't be there. You don't see this if you are just pasting
> into 'text', but when I try to paste things, typically a 6-10 digit
> alpha-numeric string, into say a cell in Access or Excel, I end up with
> these. Using IE, this does not happen.

Thanks for the report but we only track one problem per bug. And when a bug is already landed we never do extra work inside of it.  Please post a new bug with exact steps for your problem.  Thanks!
I re-installed ff 22.0, and since then it has allowed copy & paste two times out of at least a dozen attempts, random, after reboot, whatever.

Every time Firefox gets a nasty bug I switch to Chrome for a bit; today it's looking pretty nice and I may not come back.  This is a very serious bug - I cannot work without copy & paste!
(In reply to Duane from comment #67)
> I re-installed ff 22.0, and since then it has allowed copy & paste two times
> out of at least a dozen attempts, random, after reboot, whatever.
> 
> Every time Firefox gets a nasty bug I switch to Chrome for a bit; today it's
> looking pretty nice and I may not come back.  This is a very serious bug - I
> cannot work without copy & paste!

Please, read the bug, it's already fixed in the latest Beta. And you're probably using ZoneAlarm, configure it to avoid scanning the clipboard if you can.
Please consider using beta, aurora, or nightly until the release date mentioned in Comment 40.
Have been using beta since last night and have had zero troubles. Bug seems fixed - thanks!
I've got a problem with copy to clipboard. Sometimes it works, sometimes doesn't. The problem appears since I updated FF to FF22. Previous versions worked OK. 
OS: Windows XP SP3.
(In reply to zpostbox1 from comment #71)
> I've got a problem with copy to clipboard. Sometimes it works, sometimes
> doesn't. The problem appears since I updated FF to FF22. Previous versions
> worked OK. 
> OS: Windows XP SP3.

Please file a new bug report with your specific steps to reproduce and add the bug number here.
(In reply to Anthony Hughes, Mozilla QA (:ashughes) from comment #72)
> (In reply to zpostbox1 from comment #71)
> > I've got a problem with copy to clipboard. Sometimes it works, sometimes
> > doesn't. The problem appears since I updated FF to FF22. Previous versions
> > worked OK. 
> > OS: Windows XP SP3.
> 
> Please file a new bug report with your specific steps to reproduce and add
> the bug number here.

There is no need, this issue was first introduced in FF22, so it will not be fixed in FF22. (See the tracking flags for affected version).

It is fixed in FF23, and if this is a bad problem for you, the suggested work around is to uninstall/disable the conflicting program that is scanning the clipboard, or use Firefox beta for now.  ( http://www.mozilla.org/en-US/firefox/beta/ )
(In reply to Brian R. Bondy [:bbondy] from comment #73)
> There is no need, this issue was first introduced in FF22, so it will not be
> fixed in FF22.

Sorry Brian for missing the status flags. 

@zpostbox1, to reiterate what Brian said, we have no intention to fix this for Firefox 22 at this time. We are a couple of weeks away from the fix for this shipping in Firefox 23. If you absolutely cannot wait then I recommend switching to Firefox Beta.
OK, thanks, FF23 works fine!
Cannot copy & paste with FF22.0 using keyboard shortcut Ctrl-C, but right-click copy does work. After seeing a comment about Zonealarm I disabled Zonealarm and the problem was solved instantly.
For users using ZoneAlarm, disabling the option "Enable site status check" in "Web Identity Protections" category seems to be enough to fix the issue with copy/paste.
http://download.zonealarm.com/bin/inclient/ZA_HelpCenter/91623.htm

Anyway, it's clearly related to anti-phishing settings of ZA.
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Build ID: 20130816030205
Built from http://hg.mozilla.org/mozilla-central/rev/1ed5a88cd4d0

WFM
Tested on windows 8 using latest nightly for iteration-12. Ctrl+c and Right click copy, and Ctrl V and Right click paste working fine.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: