Closed Bug 1447925 Opened 6 years ago Closed 6 years ago

Firefox 59.0 for linux cannot paste text copied from IBM client access emulator 5250

Categories

(Core :: Widget: Gtk, defect)

59 Branch
Unspecified
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox-esr52 --- unaffected
firefox59 --- wontfix
firefox60 --- fixed
firefox61 --- fixed

People

(Reporter: mobbe, Assigned: stransky)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Build ID: 20180310025718

Steps to reproduce:

I try to copy text from IBM client access emulator 5250 and paste it in Firefox address bar or in input field
I select text in client access emulator using ctrl+c, I paste it in Firefox address bar or in input/textara field using ctrl+v or right click + paste.



Actual results:

The text is not pasted in Firefox 59 for linux and later versions. I've tried also wiht Firefox 61.a01 Nightly
The text is pasted correctly in Firefox 58 for linux and previuous versions.
The text is pasted correctly in all other applicatione like text editor (Kate and KWrite) or other applications like Thunderbird 31.4.0, Libre Office etc.
The text is pasted correctly in Firefox 59 for windows.
The same result is obtained in all other linux machines used by my collegues


Expected results:

Continue to have the text pasted as in previous versions
Keywords: regression
OS: Unspecified → Linux
Component: Untriaged → Event Handling
Product: Firefox → Core
Monica, could you perhaps try to find the regression range?
https://mozilla.github.io/mozregression/
I had some problems using mozregression-gui that cannot install automatically in .mozilla/mozregression/persist/ in my PC, but I extracted and checked manually the different versions and this is the result:

- 2017-12-07--mozilla-central--firefox-59.0a1.en-US.linux-x86_64.tar.bz2 changeset: 8c84a3550f7adfc529b8568d9c559e7fd58946c3 run well, I can paste the text

- 2017-12-08--mozilla-central--firefox-59.0a1.en-US.linux-x86_64.tar.bz2 changeset: 6e2181b6137c87fde58434bb926ea3f21fc1ed11 doesn't run well and I cannot paste the text. 

Sorry, but I'm not able to execute a completely check because mozregression-gui doesn't extract automatically from file .tar.bz2 so doesn't run fine
given regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8c84a3550f7adfc529b8568d9c559e7fd58946c3&tochange=6e2181b6137c87fde58434bb926ea3f21fc1ed11
	

Suspect: 
296dd5f8849a	Martin Stransky — Bug 1417874 - Split clipboard implementation to shared (nsClipboard) and backend specific (nsClipboardX11) parts, r=jhorak

@:stransky]
Your patch seems to cause the regression, Could you look into this?
Blocks: 1417874
Component: Event Handling → Widget: Gtk
Flags: needinfo?(stransky)
Yes, I'll look at it. Monica, can you please run firefox in terminal and see if there's any error message?
Flags: needinfo?(stransky) → needinfo?(mobbe)
(In reply to Martin Stránský [:stransky] from comment #4)

Martin, what do you mean for "run firefox in terminal"?
Could you give me detailed instructions what I have to do?
(In reply to Monica Bettoli from comment #5)
> (In reply to Martin Stránský [:stransky] from comment #4)
> 
> Martin, what do you mean for "run firefox in terminal"?
> Could you give me detailed instructions what I have to do?

Just close all your firefox windows, open terminal (gnome-terminal or anything else) and type "firefox" there + enter. It should launch firefox and you'll also see terminal output there.
(In reply to Martin Stránský [:stransky] from comment #6)
> Just close all your firefox windows, open terminal (gnome-terminal or
> anything else) and type "firefox" there + enter. It should launch firefox
> and you'll also see terminal output there.

I used "Konsole" and those are the messages received

These message before appears the profile selection window 
(firefox:4845): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(firefox:4845): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
(firefox:4845): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: classe ELF errata: ELFCLASS32


These message before appears in firefox opening
(/home/mob/firefox-59.0/firefox/firefox-bin:4923): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(/home/mob/firefox-59.0/firefox/firefox-bin:4923): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
(/home/mob/firefox-59.0/firefox/firefox-bin:4923): Pango-WARNING **: /usr/lib/pango/1.6.0/modules/pango-basic-fc.so: classe ELF errata: ELFCLASS32

But the same messages appears also if I run FF 58 version
Flags: needinfo?(mobbe)
Is there any message if you try to paste?
Flags: needinfo?(mobbe)
Which distro/system do you run? I expect your desktop is KDE.
(In reply to Martin Stránský [:stransky] from comment #8)
> Is there any message if you try to paste?

I've launched again and these messages are added in opening firefox:
###!!! [Parent][MessageChannel] Error: (msgtype=0x21000A,name=PClientManager::Msg___delete__) Channel closing: too late to send/recv, messages will be lost
###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

but no other messages appears when I try to paste the text in address bar


(In reply to Martin Stránský [:stransky] from comment #9)
> Which distro/system do you run? I expect your desktop is KDE.
Linux 3.16.7-7-desktop
openSUSE 13.2 (Harlequin) (x86_64)
Yes, my desktop is KDE
Flags: needinfo?(mobbe)
When your clipboard contains data from IBM client access emulator 5250, can you please run this command on console and attach the output here?

xclip -o -t TARGETS

(you need to type it to make sure you don't overwrite actual clipboard content). Thanks.
Flags: needinfo?(mobbe)
(In reply to Martin Stránský [:stransky] from comment #11)
> When your clipboard contains data from IBM client access emulator 5250, can
> you please run this command on console and attach the output here?
> 
> xclip -o -t TARGETS
> 
> (you need to type it to make sure you don't overwrite actual clipboard
> content). Thanks.

I haven't xclip, we are trying to find the package for suse 13.2, but we have some problem to find it.
Flags: needinfo?(mobbe)
Martin,
this is the result:

IBM_X5250_STRING
UTF-8
COMPOUND_TEXT
STRING
Thanks, looks like we need to use gtk_clipboard_request_text() to get the text to allow internal Gtk+ converts.
Assignee: nobody → stransky
Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1437314
See Also: → 1449490
That patch makes my firefox crash whenever I paste something from a selection owner that previously did not work. Pasting selections that previously did work continue to work.

Unfortunately gdb is unhelpfull right now, so I can't provide any details.
(In reply to Martin Husemann from comment #17)
> That patch makes my firefox crash whenever I paste something from a
> selection owner that previously did not work. Pasting selections that
> previously did work continue to work.
> 
> Unfortunately gdb is unhelpfull right now, so I can't provide any details.

Please try the latest patch - It fixes a crash in the original patch.
Blocks: 1437314
Comment on attachment 8962713 [details]
Bug 1447925 - Add GetClipboardText() to get text data from clipboard,

https://reviewboard.mozilla.org/r/231580/#review238706

::: widget/gtk/nsClipboardX11.h:29
(Diff revision 3)
>  
>      virtual const char* GetClipboardData(const char* aMimeType,
>                                           int32_t aWhichClipboard,
>                                           uint32_t* aContentLength) override;
> +    virtual const char* GetClipboardText(int32_t aWhichClipboard) override;
>      virtual void ReleaseClipboardData(const char* aClipboardData) override;

nit: please put GetTargets to the GetClipboardText, to make more clear that they are doing the simillar thing.
Comment on attachment 8962713 [details]
Bug 1447925 - Add GetClipboardText() to get text data from clipboard,

https://reviewboard.mozilla.org/r/231580/#review238722

::: widget/gtk/nsClipboardX11.h:31
(Diff revision 4)
>                                           int32_t aWhichClipboard,
>                                           uint32_t* aContentLength) override;
> +    virtual const char* GetClipboardText(int32_t aWhichClipboard) override;
>      virtual void ReleaseClipboardData(const char* aClipboardData) override;
>  
>      virtual GdkAtom* GetTargets(int32_t aWhichClipboard,

Can also this be renamed to GetClipboardTargets? I'll leave it up to you.
Attachment #8962713 - Flags: review?(jhorak) → review+
Comment on attachment 8964499 [details]
Bug 1447925 - Use GetClipboardText() to get text data at nsClipboard::GetData(),

https://reviewboard.mozilla.org/r/233228/#review238726
Attachment #8964499 - Flags: review?(jhorak) → review+
Comment on attachment 8962713 [details]
Bug 1447925 - Add GetClipboardText() to get text data from clipboard,

https://reviewboard.mozilla.org/r/231580/#review238706

> nit: please put GetTargets to the GetClipboardText, to make more clear that they are doing the simillar thing.

I'd preffer to keep them separately as GetClipboardText/Data needs to be released by ReleaseClipboardData() and GetTargets() by g_free(). I updated the comments accordingly at nsClipboard.h.
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/537057d5ac49
Add GetClipboardText() to get text data from clipboard, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/4087700190a5
Use GetClipboardText() to get text data at nsClipboard::GetData(), r=jhorak
https://hg.mozilla.org/mozilla-central/rev/537057d5ac49
https://hg.mozilla.org/mozilla-central/rev/4087700190a5
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
I've tested the version firefox-61.0a1.en-US.linux-x86_64.tar.bz2 and copy/paste from client access emulator 5250 run well.
These fixes broke the build for Wayland, I had to revert these commits to build it.
(In reply to greg from comment #31)
> These fixes broke the build for Wayland, I had to revert these commits to
> build it.

Sure, that's Bug 1449490.
Comment on attachment 8962713 [details]
Bug 1447925 - Add GetClipboardText() to get text data from clipboard,

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1417874
[User impact if declined]: Pasting text fails from source which does not offer UTF-8 text.
[Is this code covered by automated tests?]: yes
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: none
[Is the change risky?]: yes, medium risk.
[Why is the change risky/not risky?]: The change is rather intrusive but it's  at nightly for while and also it's covered by automated testing.
[String changes made/needed]: none
Attachment #8962713 - Flags: approval-mozilla-beta?
Comment on attachment 8964499 [details]
Bug 1447925 - Use GetClipboardText() to get text data at nsClipboard::GetData(),

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1417874
[User impact if declined]: Pasting text fails from source which does not offer UTF-8 text.
[Is this code covered by automated tests?]: yes
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: none
[Is the change risky?]: yes, medium risk.
[Why is the change risky/not risky?]: The change is rather intrusive but it's  at nightly for while and also it's covered by automated testing.
[String changes made/needed]: none
Attachment #8964499 - Flags: approval-mozilla-beta?
Comment on attachment 8962713 [details]
Bug 1447925 - Add GetClipboardText() to get text data from clipboard,

fix a regression for pasting text from some apps on x11, seems worth getting this in for 60esr if nothing else.  approved for 60.0b13.
Attachment #8962713 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #8964499 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
> [Is this code covered by automated tests?]: yes
> [Needs manual test from QE? If yes, steps to reproduce]: no

Marking as qe-verify- since it is covered by automation.
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: