Bug 362868 - [AIPTEK] Krita crashes upon putting the stylus back onto the tablet
Summary: [AIPTEK] Krita crashes upon putting the stylus back onto the tablet
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tablets (tablet issues are only very rarely bugs in Krita!) (show other bugs)
Version: 3.0 Beta
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-09 20:08 UTC by Blaise88
Modified: 2016-06-04 11:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
DebugView-log (298.82 KB, text/plain)
2016-05-09 20:16 UTC, Blaise88
Details
DebugView-log 2 (184.99 KB, text/plain)
2016-05-14 15:22 UTC, Blaise88
Details
DebugView-log 3 (no crash) (1.07 MB, text/plain)
2016-05-14 18:47 UTC, Blaise88
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Blaise88 2016-05-09 20:08:51 UTC
Krita 3.0 Beta works pretty well with my Aiptek tablet (while Krita 2.9.11 didn't even start or crashed immediately), however if I accidentally lift the stylus 1+ cm from the tablet's active area, then try to continue working (drawing, selecting etc.) it suddenly crashes.

Reproducible: Always

Steps to Reproduce:
1. create/open document
2. lift stylus at least 1 cm
3. put it back onto the tablet

Actual Results:  
Krita crashes

Expected Results:  
everything should work as before

Version: krita-3.0-Beta-master-99f6246-x64 (earlier 3.0 builds & x32 version affected as well)
OS: Windows 7 (x64)
Tablet: Aiptek 14000u (latest driver: v5.03, 2013-10-21)
Comment 1 Blaise88 2016-05-09 20:16:04 UTC
Created attachment 98870 [details]
DebugView-log
Comment 2 Halla Rempt 2016-05-14 11:28:30 UTC
Hi Blaise,

Thanks for your report. We don't have access to the hardware, so it's hard to figure out what's going on. Could you try to download http://files.kde.org/krita/3/windows/devbuilds/krita-3.0-Beta-master-d330a4a-x64-dbg.zip and see if that gives a usable backtrace so we can see where the crash actually happens? That is a build with the debug symbols included.
Comment 3 Blaise88 2016-05-14 15:11:39 UTC
Hi, thanks for your response!

I tried that, but I'm getting a fairly similar result than last time. 
Also, the DBG-version of krita looks just the same as the normal build (can't notice any additional buttons, debug menus etc.; Krita 3.0 Beta (git refs/he)) - is that normal? Do I have to run anything as administrator or enable any special options in DebugView (like "Capture Kernel")?
Comment 4 Blaise88 2016-05-14 15:22:59 UTC
Created attachment 98970 [details]
DebugView-log 2

krita-3.0-Beta-master-d330a4a-x64-dbg (git refs/he)
(log starts with plugging in the tablet)
Comment 5 Blaise88 2016-05-14 18:43:02 UTC
I just discovered something interesting:
If I start the program in compatibility mode (Windows XP+), this crash doesn't occur - neither in the x32 nor in the x64 build. So this could indeed be considered a workaround.
The disadvantage of it is however, that it slows down krita remarkably, so that painting with even small brushes can be laggy...

I'll add the logfile of this session too. Hope it helps finding the "culprit". :)
Comment 6 Blaise88 2016-05-14 18:47:27 UTC
Created attachment 98975 [details]
DebugView-log 3 (no crash)

same as in DebugView-log 2, except this time run with Windows Vista compatibility -> didn't crash
Comment 7 Halla Rempt 2016-05-15 11:45:47 UTC
That sounds really strange... Actually, being a Linux guy, I didn't even know that you could start an application with different versions of windows "compatibility".
Comment 8 - 2016-05-20 19:38:50 UTC
Good that I looked up similar bugs, before I submited a Bug Report.

First I want to confirm that this Bug also happens on the "Slim Tablet 600U" from Aiptek as well. (with the same driver)

The Bug is easily reproducable following the instructions on Win7 Pro (x64) with Service Pack 1

Following your experiments on the compatibility mode, I found out that it works seemingly fine even on the "Win7-mode (without SP1)"
Comment 9 - 2016-05-20 19:43:23 UTC
Good that I looked up similar bugs, before I submited a Bug Report.
(Krita Version: krita-3.0-RC-1-master-6f75b0f-x64)
First I want to confirm that this Bug also happens on the "Slim Tablet 600U" from Aiptek as well. (with the same driver)

The Bug is easily reproducable following the instructions on Win7 Pro (x64) with Service Pack 1

Following your experiments on the compatibility mode, I found out that it works seemingly fine even on the "Win7-mode (without SP1)"
Comment 10 Blaise88 2016-05-28 10:42:04 UTC
Hi! Thanks for all your great work - Krita 3.0 is going to be a really awesome release! :)
Now, I tried all the recent builds (hoping that this bug might be "magically" resolved by some other bug-fix), but there hasn't been anything to mention lately - up to the latest development build (May 26), that is.
Now Krita crashes right at the start, if I have my tablet plugged in (like in 2.9).
This time the DebugView-log is fairly short, so I'll just paste it in here:

Version: 3.0 RC 1 (git 7785651)
00000001	0.00000000	[2468] QCoreApplication::arguments: Please instantiate the QApplication object first	
00000002	0.00139357	[2468] QCoreApplication::applicationDirPath: Please instantiate the QApplication object first	
00000003	0.00141306	[2468] QCoreApplication::applicationDirPath: Please instantiate the QApplication object first	
00000004	0.00156717	[2468] QCoreApplication::applicationDirPath: Please instantiate the QApplication object first	
00000005	0.00158545	[2468] QCoreApplication::applicationDirPath: Please instantiate the QApplication object first	
00000006	0.00170448	[2468] QCoreApplication::applicationDirPath: Please instantiate the QApplication object first	
00000007	0.00172247	[2468] QCoreApplication::applicationDirPath: Please instantiate the QApplication object first	
00000008	0.00198542	[2468] krita.lib.pigment: Compiled for arch: ::Vc::SSE2Impl	
00000009	0.00200251	[2468] krita.lib.pigment: Features supported:	
00000010	0.00202799	[2468] krita.lib.pigment:   "SSE2"  ---  yes	
00000011	0.00204598	[2468] krita.lib.pigment:   "SSSE3"  ---  no	
00000012	0.00206997	[2468] krita.lib.pigment:   "SSE4.1"  ---  no	
00000013	0.00208765	[2468] krita.lib.pigment:   "AVX "  ---  no	
00000014	0.34830639	[2468] Current Style "windowsvista"	
00000015	0.34847400	[2468] Set style "fusion"	
00000016	0.37603116	[2468] OpenGL Info	
00000017	0.37607163	[2468]   Vendor:  NVIDIA Corporation	
00000018	0.37609291	[2468]   Renderer:  GeForce GT 330/PCIe/SSE2	
00000019	0.37611300	[2468]   Version:  3.3.0	
00000020	0.37613699	[2468]   Shading language:  3.30 NVIDIA via Cg compiler	
00000021	0.37617838	[2468]   Requested format:  QSurfaceFormat(version 3.0, options QFlags(0x4), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior 2, swapInterval 0, profile  2)	
00000022	0.37620327	[2468]   Current format:    QSurfaceFormat(version 3.3, options QFlags(0x4), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior 2, swapInterval 1, profile  2)	
00000023	0.37789005	[2468] krita has opengl true	
00000024	0.37797341	[2468] Setting XDG_DATA_DIRS "C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/bin/../share"	
00000025	0.38478744	[2468] availableCatalogLanguages() localDirPaths ("C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/bin/data/locale") languages QSet("tr", "pl", "cy", "he", "pt", "da", "hi", "de", "lt", "lv", "ug", "hr", "pt_BR", "uk", "hu", "en_GB", "zh_CN", "ia", "mk", "uz", "zh_TW", "mr", "ms", "uz@cyrillic", "mai", "is", "el", "vi", "it", "af", "eo", "nb", "es", "et", "eu", "ne", "ja", "ar", "ro", "nds", "nl", "ru", "nn", "fa", "wa", "fi", "ca@valencia", "be", "bg", "se", "fr", "oc", "ast", "sk", "sl", "fy", "br", "bs", "hne", "sq", "sv", "ga", "kk", "km", "ko", "ca", "ta", "xh", "gl", "tg", "th", "pa", "cs")	
00000026	0.38482851	[2468] Available translations QSet("tr", "pl", "cy", "he", "pt", "da", "hi", "de", "lt", "lv", "ug", "hr", "pt_BR", "uk", "hu", "en_GB", "zh_CN", "ia", "mk", "uz", "zh_TW", "mr", "ms", "uz@cyrillic", "mai", "is", "el", "vi", "it", "af", "eo", "nb", "es", "et", "eu", "ne", "ja", "ar", "ro", "nds", "nl", "ru", "nn", "fa", "wa", "fi", "en_US", "ca@valencia", "be", "bg", "se", "fr", "oc", "ast", "sk", "sl", "fy", "br", "bs", "hne", "sq", "sv", "ga", "kk", "km", "ko", "ca", "ta", "xh", "gl", "tg", "th", "pa", "cs")	
00000027	0.38785669	[2468] availableCatalogLanguages() localDirPaths ("C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/bin/data/locale") languages QSet("tr", "pl", "cy", "he", "pt", "da", "hi", "de", "lt", "lv", "ug", "hr", "pt_BR", "uk", "hu", "en_GB", "zh_CN", "ia", "mk", "uz", "zh_TW", "mr", "ms", "uz@cyrillic", "mai", "is", "el", "vi", "it", "af", "eo", "nb", "es", "et", "eu", "ne", "ja", "ar", "ro", "nds", "nl", "ru", "nn", "fa", "wa", "fi", "ca@valencia", "be", "bg", "se", "fr", "oc", "ast", "sk", "sl", "fy", "br", "bs", "hne", "sq", "sv", "ga", "kk", "km", "ko", "ca", "ta", "xh", "gl", "tg", "th", "pa", "cs")	
00000028	0.38789567	[2468] Available domain translations QSet("tr", "pl", "cy", "he", "pt", "da", "hi", "de", "lt", "lv", "ug", "hr", "pt_BR", "uk", "hu", "en_GB", "zh_CN", "ia", "mk", "uz", "zh_TW", "mr", "ms", "uz@cyrillic", "mai", "is", "el", "vi", "it", "af", "eo", "nb", "es", "et", "eu", "ne", "ja", "ar", "ro", "nds", "nl", "ru", "nn", "fa", "wa", "fi", "en_US", "ca@valencia", "be", "bg", "se", "fr", "oc", "ast", "sk", "sl", "fy", "br", "bs", "hne", "sq", "sv", "ga", "kk", "km", "ko", "ca", "ta", "xh", "gl", "tg", "th", "pa", "cs")	
00000029	0.38804829	[2468] Override language: ""	
00000030	0.38810855	[2468] PATH "C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/bin;C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/lib;C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/lib/kde4;C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/Frameworks;C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64"	
00000031	0.38831782	[2468] catalogLocaleDir domain "krita" language "de-AT" relpath "de-AT/LC_MESSAGES/krita.mo" file "" localeDir ""	
00000032	0.43659171	[2468] krita.tabletlog: Opened tablet context  0x1e8f0350  on window  0x70720 changed packet queue size  127 -> 128	
00000033	0.43670207	[2468] print false exportAs false exportAsPdf false exportFileName ""	
00000034	0.50020719	[2468] krita.tabletlog: # Getting current context data:	
00000035	0.50026292	[2468] krita.tabletlog: lc.lcName = 0x22ba80	
00000036	0.50029230	[2468] krita.tabletlog: lc.lcDevice = 0	
00000037	0.50032109	[2468] krita.tabletlog: lc.lcInOrgX = 0	
00000038	0.50035077	[2468] krita.tabletlog: lc.lcInOrgY = 0	
00000039	0.50037748	[2468] krita.tabletlog: lc.lcInExtX = 65535	
00000040	0.50041193	[2468] krita.tabletlog: lc.lcInExtY = 65535	
00000041	0.50043923	[2468] krita.tabletlog: lc.lcOutOrgX = 0	
00000042	0.50046504	[2468] krita.tabletlog: lc.lcOutOrgY = 0	
00000043	0.50049108	[2468] krita.tabletlog: lc.lcOutExtX = 65535	
00000044	0.50059062	[2468] krita.tabletlog: lc.lcOutExtY = -65535	
00000045	0.50061041	[2468] krita.tabletlog: lc.lcSysOrgX = 0	
00000046	0.50062931	[2468] krita.tabletlog: lc.lcSysOrgY = 0	
00000047	0.50064701	[2468] krita.tabletlog: lc.lcSysExtX = 1680	
00000048	0.50066441	[2468] krita.tabletlog: lc.lcSysExtY = 1050	
00000049	0.50068837	[2468] krita.tabletlog: Qt Desktop Geometry QRect(0,0 1680x1050)	
00000050	0.50071299	[2468] qtDesktopRect = QRect(0,0 1680x1050)	
00000051	0.50073099	[2468] wintabDesktopRect = QRect(0,0 1680x1050)	
00000052	0.50523067	[2468] QWidget::repaint: Recursive repaint detected	
00000053	0.86579466	[2468] KoJsonTrader will load its plugins from "C:/Users/Blaise/Desktop/Krita 3.0 DBG/krita-3.0-RC-1-master-7785651-x64/lib/kritaplugins"	

Again, with compatibility mode (Vista or 7 for x64) no crashes occur at all, but everything from starting up over file creation and painting up to picking colors in the color selector is slower ("laggy").

P.S.
As mentioned before, if there is anything I can do to produce a more useful backtrace, please let me know.
Comment 11 Halla Rempt 2016-05-28 15:13:16 UTC
Hi Blaise,

This tablet log also shows the weird sequence

00000041 0.50043923 [2468] krita.tabletlog: lc.lcOutOrgX = 0
00000042 0.50046504 [2468] krita.tabletlog: lc.lcOutOrgY = 0 
00000043 0.50049108 [2468] krita.tabletlog: lc.lcOutExtX = 65535 
00000044 0.50059062 [2468] krita.tabletlog: lc.lcOutExtY = -65535 

but what that means, I don't know. It's something all crashing tablets have in common. I have no idea what enabling compatibility mode can do or not... But we're trying to get some test hardware so we can investigate more. At this point, we need to be able to do that interactively: changing code, building, testing over and over again...
Comment 12 Halla Rempt 2016-06-03 07:03:46 UTC

*** This bug has been marked as a duplicate of bug 362948 ***
Comment 13 Dmitry Kazakov 2016-06-03 12:47:07 UTC
Git commit 942cb4b614246ad08485eaa2264154de2d07ce17 by Dmitry Kazakov.
Committed on 03/06/2016 at 12:46.
Pushed by dkazakov into branch 'master'.

Add a workaround for weird tablets

Instead of the returning the size of the needed buffer these
"nice" tablet drivers start writing its name straight into
the buffer pointed by a null pointer.

See a comment in the code for more details
Related: bug 359298, bug 363684, bug 363873, bug 351059, bug 354979, bug 362948

M  +35   -2    libs/ui/input/wintab/kis_tablet_support_win.cpp

http://commits.kde.org/krita/942cb4b614246ad08485eaa2264154de2d07ce17
Comment 14 Dmitry Kazakov 2016-06-03 12:48:16 UTC
Git commit 22c3c0d5d49ef164e4def4d545faee7f37797a5f by Dmitry Kazakov.
Committed on 03/06/2016 at 12:48.
Pushed by dkazakov into branch 'krita/3.0'.

Add a workaround for weird tablets

Instead of the returning the size of the needed buffer these
"nice" tablet drivers start writing its name straight into
the buffer pointed by a null pointer.

See a comment in the code for more details
Related: bug 359298, bug 363684, bug 363873, bug 351059, bug 354979, bug 362948

M  +35   -2    libs/ui/input/wintab/kis_tablet_support_win.cpp

http://commits.kde.org/krita/22c3c0d5d49ef164e4def4d545faee7f37797a5f
Comment 15 Blaise88 2016-06-04 11:27:57 UTC
Thank you, you're my saviors!

Just tried out the latest development build (git 9e17aff), and it works totally fine. I'm not experiencing any crashes at all, not even when lifting the pen. Awesome!
Can't say much about the "shakiness" that was mentioned in "Anatomy of a bug fix", since my line work isn't the best to begin with, but it seems mostly smooth to me (and there's still the option to use the stabilizer if necessary). Besides, this all isn't Krita's fault anyway.

Sorry for having bugged you with problems caused by a badly manufactured tablet (no pun intended). I got mine from Amazon in 2008, with the main criteria being large (A4) and not too expensive (up to about 100 €, which it actually cost). As I'm not doing any professional work with it (yet?), I'm sticking around with my Aiptek 14000u for the time being, but next time I'll make sure to invest into a proper one (most likely Wacom).

Thanks again, and have a nice weekend! :)