Bug 71750

Summary: weston-keyboard disappears during text entry
Product: Wayland Reporter: Anu Reddy <anasuyax.r.nannuri>
Component: westonAssignee: Wayland bug list <wayland-bugs>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: medium    
Version: 1.3.0   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Virtual keyboard disappearing during the text entry
weston-keyboard gdb backtrace
a different backtrace
yet another bt signature

Description Anu Reddy 2013-11-18 17:32:22 UTC
Steps :
1.	Ensure Weston.ini is configured to automatically launch the keyboard application
2.	Launch Weston : Weston-launch
3.	Launch Weston terminal
4.	Run Weston-editor from Weston terminal
5.	VKB pops up when you click on Weston editor text area.
6.	Enter 2-4 lines of text in text area ‘Entry’ by touching display Virtual Keyboard
7.	After 2 to 4 lines of entry keyboard disappear. 
8.	Once you stop typing VKB displays again.
9.	VKB disappear once you start typing. 
10.	Appears when you stop typing on display.
11.	After some attempts observe VKB does not displayed.
12.	Close Weston editor
13.	Launch Weston editor :Weston-editor
14.	Touch the text area. Observe VKB does not appear.

Actual Result :
•	After 2-4 lines of entry, keyboard disappear.
•	Once you stop typing VKB displays again.
•	VKB disappear once you start typing. 


Expected Result : 
•	VKB is displayed for text entry .
Environment:
wayland (HEAD) heads/1.3-0-g84247b7
drm (HEAD) libdrm-2.4.46-0-gc6d73cf
mesa (HEAD) heads/9.2-0-gc8e0d10
libva (HEAD) libva-1.2.1-0-g88ed1eb
intel-driver (HEAD) 1.2.1-0-g8f306e3
weston (HEAD) 1.3.1-0-g5e3ff49
Comment 1 Anu Reddy 2013-11-18 18:51:10 UTC
Created attachment 89420 [details]
Virtual keyboard disappearing during the text entry

please find the attached video showing VKB disappear when the display is touched.
VKB appear when display is not toched. After 5-6 attempts VKB does not appear.
Comment 2 U. Artie Eoff 2014-01-08 22:52:57 UTC
Created attachment 91715 [details]
weston-keyboard gdb backtrace

The weston-keyboard is crashing...
Comment 3 U. Artie Eoff 2014-01-08 22:55:50 UTC
Created attachment 91716 [details]
a different backtrace

another crash (SIGABRT) in a different location.
Comment 4 U. Artie Eoff 2014-01-08 22:56:46 UTC
Created attachment 91717 [details]
yet another bt signature
Comment 5 Kristian Høgsberg 2014-01-09 06:33:56 UTC

*** This bug has been marked as a duplicate of bug 65186 ***
Comment 6 U. Artie Eoff 2014-01-09 13:29:02 UTC
(In reply to comment #5)
> 
> *** This bug has been marked as a duplicate of bug 65186 ***

I'm not certain this is related to bug 65186... note that this one relates to weston-keyboard crashing regardless of length of text.  While the other one relates to weston-editor crashing with long lines of text.  I think the stack traces are slightly diff, too.
Comment 7 Anu Reddy 2014-01-09 17:43:01 UTC
(In reply to comment #5)
> 
*** This bug has been marked as a duplicate of bug 65186 ***

I checked the bug 65186 before. Here the issue is weston-keyboard crash while entering the text. I did not see any editor crashes while testing.
Comment 8 Kristian Høgsberg 2014-01-10 08:00:14 UTC
Memory corruption fixed by

commit a548b4b85cfdbef103f622c3e3aaf976938535f9
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Thu Jan 9 23:39:20 2014 -0800

    keyboard: Fix insert_text() string utility
    
    strncat() into a newly allocated buffer isn't well-defined.  I don't know
    how this didn't crash all the time, getting blocks from malloc() with
    a NUL in the first byte must be fairly common.
    
    Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750

and

commit 700d6ad071614895c3cb305b894b8c1a003db39e
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Thu Jan 9 23:45:18 2014 -0800

    keyboard: Don't strcat() into a strdup()ed string
    
    We need to reallocate the memory to hold the entire concatenated string,
    but strcat() doesn't do that.
    
    Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.