[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    RE: Segfault when reading event device.
From:       "Robertson, Ezban" <ezban.robertson () homeauto ! com>
Date:       2005-06-29 18:53:50
Message-ID: ED3CB89794C8C9469511DFC53A8C737030C8BF () sbs2003 ! HAI ! local
[Download RAW message or body]

I believed I've solved part of the problem, however I'm getting quite a
few of these messages:

[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]

I suspect it'll come back to bite me later if go unnoticed. Does anyone
have any ideas what could cause this?

Thanks.


> -----Original Message-----
> From: Marc Singer [mailto:elf@buici.com] 
> Sent: Tuesday, June 28, 2005 4:14 PM
> To: Robertson, Ezban
> Cc: linux-arm-kernel@lists.arm.linux.org.uk
> Subject: Re: Segfault when reading event device.
> 
> On Tue, Jun 28, 2005 at 02:59:02PM -0500, Robertson, Ezban wrote:
> > Although the values of ts_read below looks good to me, one 
> things that 
> > bothers me is ts->list argument (First arg in ts_read). I 
> realize this 
> > package doesn't have much docs but maybe someone can 
> indicate it that 
> > looks ok or not.
> > 
> > 
 [tcsetpgrp failed in terminal_inferior: Inappropriate ioctl 
> > for device] [tcsetpgrp failed in terminal_inferior: Inappropriate 
> > ioctl for device] [tcsetpgrp failed in terminal_inferior: 
> > Inappropriate ioctl for device] lh7a40x_clcd_mmap
> > createfont: (height == 0) found builtin font System (0)
> > PD_OPEN: TS DEVICE: /dev/input/event0: fd: 8
> > createfont: (height == 0) found builtin font System (0)
> > PD_Read:
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x4002263c in ts_read (ts=0x0, samp=0xbefffb88, nr=1) at 
> ts_read.c:38
> > 38      ts_read.c: No such file or directory.
> 
> This is the interesting part, but without a source listing 
> we're still blind.
> 
> If the code is dereferencing ts and ts is NULL, look to see 
> why ts is zero.
> 
> >         in ts_read.c
> > (gdb) bt
> > #0  0x4002263c in ts_read (ts=0x0, samp=0xbefffb88, nr=0) at
> > ts_read.c:38
> > #1  0x00025794 in PD_Read (px=0xbefffc04, py=0xbefffc00, 
> pz=0xbefffbfc,
> >     pb=0xbefffbf8, mode=283428)
> >     at /touchscreen/packages/mwx91/src/drivers/mou_touch
> > screen.c:97
> > #2  0x0000efc4 in GdReadMouse (px=0xbefffc34, py=0xbefffc30,
> > pb=0xbefffc2c)
> >     at /touchscreen/packages/mwx91/src/engine/devmouse.c
> > :241
> > #3  0x0002c4dc in GsCheckMouseEvent ()
> >     at /touchscreen/packages/mwx91/src/mwx/srvevent.c:
> > 168
> > #4  0x00025fcc in GsSelect (timeout=0)
> >     at /touchscreen/packages/mwx91/src/mwx/srvmain.c:5
> > 71
> > #5  0x0002591c in main (argc=1, argv=0xbefffd44)
> >     at /touchscreen/packages/mwx91/src/mwx/srvmain.c:2
> > 06
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Marc Singer [mailto:elf@buici.com]
> > > Sent: Tuesday, June 28, 2005 12:43 PM
> > > To: Robertson, Ezban
> > > Cc: linux-arm-kernel@lists.arm.linux.org.uk
> > > Subject: Re: Segfault when reading event device.
> > > 
> > > On Tue, Jun 28, 2005 at 10:59:12AM -0500, Robertson, Ezban wrote:
> > > > I've ran into a problem while reading the event device 
> 0 (a touch 
> > > > panel device). The driver is working after being able 
> to execute 
> > > > ts_calibrate, but executing the code fragment below from an
> > > app causes
> > > > a seg fault and I not sure why.
> > > > Maybe someone can identify what's possibly wrong.
> > > > 
> > > > 
> > > > 	  struct ts_event event;
> > > > 
> > > >         /* read a data point */
> > > >         
> > > >         ret = ts_read(ts,&event,1);
> > > >         if(ret < 0 ) {
> > > >                 EPRINTF("[%s] Error %d reading from touch 
> > > > panel\n", TS_DEVICE, errno);
> > > >                 return -1;
> > > >                 }
> > > > 
> > > > Where ts_event is
> > > > 		{
> > > > 		int x;
> > > > 		int y;
> > > > 		unsigned int pressure;
> > > > 		struct timeval timestamp;
> > > > 		}
> > > > 
> > > >     ts_read in the source is doing a 
> ts->list->ops->read(ts->list, 
> > > > samp, nr);
> > > 
> > > There isn't enough code here to see what is going on.  Have you 
> > > tried loading the program into GDB and letting it show 
> you where the 
> > > segfault is occurring.?
> > > 
> > > > 
> > > > Msg log:
> > > > 
> > > > #
> > > > createfont: (height == 0) found builtin font System (0)
> > > > PD_OPEN: TS DEVICE: /dev/input/event0: fd: 5
> > > > createfont: (height == 0) found builtin font System (0)
> > > > CLCD: SINGLE PANEL
> > > > CLCD: LCD is in Color STN Interface
> > > > CLCD: 16 BPP mode
> > > > CLCD: disabling LCD
> > > > CLCD: enabling LCD
> > > > CLCD: Registers set to
> > > >  TIM0: 0505054c TIM1: 000000ef TIM2: 007707d7 TIM3: 00000000
> > > >  UBAS: c1c00000 LBAS: c1c12c00 IENB: 00000000 CNTL: 
> > > 00010909 PD_Read
> > > > signal 11 caught
> > > > 
> > > > 
> ------------------------------------------------------------------
> > > > -
> > > > List admin: 
> > > http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> > > > FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> > > > Etiquette:  
> http://www.arm.linux.org.uk/mailinglists/etiquette.php
> > > 
> 

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic