public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Call of tty->driver.write provides segmentation fault
@ 2003-09-04  9:07 Laurent Hugé
  2003-09-04  9:52 ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Hugé @ 2003-09-04  9:07 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'm currently contriving a network driver using the serial port.
I've created my own line discipline (and tests prove it reads well), but I
can't write to the port : I tried to use tty->driver.write(tty, 0, msg,
strlen(msg)) (the same way that in printk.c, i.e. after testing that
tty->driver.write exists) but it crashs into a segmentation fault.
Since the driver implementation is not mine (I'm just using the serial
module), I can't check the function's address, but I believe the tty is ok (it 
is the same I use for the line discipline).

Does anyone know in which way I can search a solution ?
Thanks,
-- 
Laurent Hugé.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Call of tty->driver.write provides segmentation fault
  2003-09-04  9:07 Call of tty->driver.write provides segmentation fault Laurent Hugé
@ 2003-09-04  9:52 ` Russell King
  2003-09-04 11:35   ` Laurent Hugé
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King @ 2003-09-04  9:52 UTC (permalink / raw)
  To: Laurent Hugé; +Cc: linux-kernel

On Thu, Sep 04, 2003 at 11:07:11AM +0200, Laurent Hugé wrote:
> I'm currently contriving a network driver using the serial port.
> I've created my own line discipline (and tests prove it reads well), but I
> can't write to the port : I tried to use tty->driver.write(tty, 0, msg,
> strlen(msg)) (the same way that in printk.c, i.e. after testing that
> tty->driver.write exists) but it crashs into a segmentation fault.
> Since the driver implementation is not mine (I'm just using the serial
> module), I can't check the function's address, but I believe the tty is
> ok (it is the same I use for the line discipline).

You need to look at the kernel messages - normally you'll find an
"oops" in there when this happens.  If the dump doesn't contain
symbolic information (ie, the function names) you'll need to pass
it though ksymoops to decode it (using the correct System.map file
for the kernel which generated the dump.)

If you do use ksymoops, be sure to include the original oops dump -
ksymoops appears to drop some lines from the oops dump.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Call of tty->driver.write provides segmentation fault
  2003-09-04  9:52 ` Russell King
@ 2003-09-04 11:35   ` Laurent Hugé
  2003-09-04 11:41     ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Hugé @ 2003-09-04 11:35 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel

Le Jeudi 4 Septembre 2003 11:52, Russell King a écrit :
> You need to look at the kernel messages - normally you'll find an
> "oops" in there when this happens.
There's no Oops ; I've only got a segmentation fault, but the kernel doesn't 
crash.
-- 
Laurent Hugé.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Call of tty->driver.write provides segmentation fault
  2003-09-04 11:35   ` Laurent Hugé
@ 2003-09-04 11:41     ` Russell King
  2003-09-04 18:49       ` Re : " Laurent Hugé
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King @ 2003-09-04 11:41 UTC (permalink / raw)
  To: Laurent Hugé; +Cc: linux-kernel

On Thu, Sep 04, 2003 at 01:35:14PM +0200, Laurent Hugé wrote:
> Le Jeudi 4 Septembre 2003 11:52, Russell King a écrit :
> > You need to look at the kernel messages - normally you'll find an
> > "oops" in there when this happens.
> There's no Oops ; I've only got a segmentation fault, but the kernel doesn't 
> crash.

If that's the case, I can't help you.  If the kernel isn't oopsing, then
it isn't the call to tty->driver.write which is causing your problem -
it must be an error in the userspace program.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re : Call of tty->driver.write provides segmentation fault
  2003-09-04 11:41     ` Russell King
@ 2003-09-04 18:49       ` Laurent Hugé
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Hugé @ 2003-09-04 18:49 UTC (permalink / raw)
  To: Russell King; +Cc: linux-kernel

Le Jeudi 4 Septembre 2003 13:41, Russell King a écrit :
> If that's the case, I can't help you.  If the kernel isn't oopsing, then
> it isn't the call to tty->driver.write which is causing your problem -
> it must be an error in the userspace program.
Ok, at least, I learned one thing !
Eventually, I've found a workaround ; I've been taught that I can write 
directly at the serial port address (I tought it wasn't permitted by the 
serial module), so that's what I do since I've got to send only one caracter 
(sort of acknowledge).
Now I'm trying to find out why the tcsetattr of my termios configuration fails 
(the thing work at 9600 bauds but not at 115200).
Thanks,
-- 
Laurent Hugé.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-09-04 18:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-04  9:07 Call of tty->driver.write provides segmentation fault Laurent Hugé
2003-09-04  9:52 ` Russell King
2003-09-04 11:35   ` Laurent Hugé
2003-09-04 11:41     ` Russell King
2003-09-04 18:49       ` Re : " Laurent Hugé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox