bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: oskit-mach: device_write


From: Daniel Wagner
Subject: Re: oskit-mach: device_write
Date: Fri, 8 Mar 2002 00:25:56 +0100
User-agent: Mutt/1.3.24i

> That is pretty strange.  There are two things here that are not right.
> That value from ops->write_inband (61) is bogus for that call.  But,
> whatever is in *bytes_written at that point definitely ought to make it
> back to the user.  To debug the latter case, please do "finish" from that
> frame and step through the mig stub to see the value being packed up.

1. case

ds_net_write_inband makes first a sanity check for the given paramenters.
If this fails it just returns without setting bytes_written to 0.




Index: ds_net.c
===================================================================
RCS file: /cvsroot/hurd/gnumach/oskit/Attic/ds_net.c,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 ds_net.c
--- ds_net.c    4 Mar 2002 19:29:24 -0000       1.1.2.4
+++ ds_net.c    7 Mar 2002 23:16:17 -0000
@@ -223,7 +223,10 @@ ds_net_write_inband (device_t dev, ipc_p
 
   if (count < sizeof (struct ether_header) ||
       count > sizeof (struct ether_header) + ETHERMTU)
-    return D_INVALID_SIZE;
+    {
+      *bytes_written = 0;
+      return D_INVALID_SIZE;
+    }
 
   rc = oskit_netio_push (dev->com.net.sendi, &bio.ioi, count);
   *bytes_written = count;





2. case

I'm still trying to figure out what I see:


Breakpoint 3, ds_device_write (dev=0xc107280, reply_port=0xc1218f4, 
    reply_port_type=18, mode=8, recnum=0, data=0xc11310c "\003", count=4, 
    bytes_written=0xc2bf034) at ../../oskit-mach/oskit/ds_routines.c:695
695       if (dev == DEVICE_NULL)
(gdb) finish
Run till exit from #0  ds_device_write (dev=0xc107280, reply_port=0xc1218f4, 
    reply_port_type=18, mode=8, recnum=0, data=0xc11310c "\003", count=4, 
    bytes_written=0xc2bf034) at ../../oskit-mach/oskit/ds_routines.c:695
0x00148212 in _Xdevice_write (InHeadP=0xc1148a8, OutHeadP=0xc2bf010)
    at device_server.c:250
250             OutP->RetCode = ds_device_write(device, (ipc_port_t) 
In0P->Head.msgh_reply_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits), 
In0P->mode, In0P->recnum, In0P->data, In0P->dataType.msgtl_number, 
&OutP->bytes_written);
Value returned is $20 = -305
(gdb) p *OutP
$21 = {Head = {msgh_bits = 18, msgh_size = 32, msgh_remote_port = 202512628, 
    msgh_local_port = 0, msgh_seqno = 0, msgh_id = 2902}, RetCodeType = {
    msgt_name = 2, msgt_size = 32, msgt_number = 1, msgt_inline = 1, 
    msgt_longform = 0, msgt_deallocate = 0, msgt_unused = 0}, RetCode = 0, 
  bytes_writtenType = {msgt_name = 17, msgt_size = 32, msgt_number = 1, 
    msgt_inline = 1, msgt_longform = 0, msgt_deallocate = 0, msgt_unused = 0}, 
  bytes_written = 0}
(gdb) 
(gdb) n
251             device_deallocate(device);
(gdb) 
252             if (OutP->RetCode != KERN_SUCCESS)
(gdb) 
253                     return;



-- 
Daniel Wagner                       "Don't drink and derive."        
email: wagi@gmx.ch

GnuPG: 1024D/DCDE890A (public key available on any keyserver)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]