On Mon, Mar 15, 2010 at 10:19:29PM -0700, Ping Cheng wrote:
> On Sun, Mar 14, 2010 at 11:55 PM, Peter Hutterer
> <[email protected]>wrote:
> 
> > 5780e59c4 "Take scroll buttons into accounts when allocating buttons."
> > added
> > a conditional to always have at least 7 buttons for devices with more than
> > 3
> > buttons. The exact number is nbuttons + 4, but for serial devices nbuttons
> > is always WCM_MAX_MOUSE_BUTTONS - resulting in a segfault later on when
> > arrays are accessed OOB.
> >
> > Reported-by: Ping Cheng <[email protected]>
> > Signed-off-by: Peter Hutterer <[email protected]>
> > ---
> > Ping, I think this should fix your crash with the isdv4 branch.
> >
> 
> 
> Your patch (with "if (nbuttons < WCM_MAX_BUTTONS)" instead of "<=" though)
> does fix the crash issue on my ISDV4 with touch system.  However, I made a
> new one with the following commit comments:
> 
> -------------------
> The workaround that supports at least 7 buttons could cause
> nbbuttons larger than WCM_MAX_BUTTONS, the maximum number of
> buttons that is supported by the driver. This patch keeps
> nbbuttons in its range.
> 
> This patch also fixes a driver crash issue on ISDV4 with touch
> systems that may be caused by nbbuttons being larger than
> WCM_MAX_BUTTONS. The "may be" is backed up by the following testing result:
> 
> 1.  linuxwacom-0.8.5-11 has the same block of code. However,
> running linuxwacom-0.8.5-11 on the same ISDV4 system (Xorg 1.6.0)
> without this patch doesn't have the issue.
> 
> 2.  Running xf86-input-wacom without this patch on a pen only
> ISDV4 system doesn't have the issue either (Thomas Jaeger reported
> the same positive testing result too).
> 
> So, there must be some other issues behind the crash that we don't
> understand yet.
> ------------------------

fwiw, memory corruption can be quite funky and depends on compile-time
options (optimization for example). So I'm not surprised that you only see
the crash some of the time and even a different X server revision may cause
different results.

Have you tried running linuxwacom through valgrind to see if it complains?

Also, does this mean the isdv4-rework-stage1 branch can be merged now?

Cheers,
  Peter

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to