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

Re: sockets exn- one day i'll learn to put things down


  • To: Anil Madhavapeddy <anil@xxxxxxxxxx>, Mirage List <cl-mirage@xxxxxxxxxxxxxxx>
  • From: Richard Mortier <Richard.Mortier@xxxxxxxxxxxxxxxx>
  • Date: Fri, 4 Nov 2011 21:16:43 +0000
  • Accept-language: en-US, en-GB
  • Acceptlanguage: en-US, en-GB
  • List-id: MirageOS development <cl-mirage.lists.cam.ac.uk>
  • Thread-index: AcybNzXcWfQMgrSfTDCjKEdxwsUYjQ==
  • Thread-topic: sockets exn- one day i'll learn to put things down

On 4 Nov 2011, at 09:40, Anil Madhavapeddy wrote:

> On Wed, Nov 02, 2011 at 05:24:41PM +0000, Richard Mortier wrote:
>> aha. i have no objections - i'll start making use of that now anyway.
>> (presume you mean passing -lwt-debug to camlp4 as noted at
>> <http://ocsigen.org/lwt/manual/> ?)
> 
> Yeah. Did it work if you just manually add it to ocamlbuild? I've not had
> a chance to try it yet.

i *think* so...  to summarise:

+ i've sent (or will send shortly) another pull req as i forgot to commit the 
addition of "-g" to ocamlc commands (required to actually have the backtraces 
filled in)

+ adding -lwt-debug to all builds changes the backtrace output i see to:

"""
Fatal error: exception Invalid_argument("Lwt.wakeup")
Raised at file "std/format.ml", line 195, characters 15-26
Called from file "std/format.ml", line 421, characters 8-33
Called from file "std/format.ml", line 436, characters 6-24
Called from file "std/lwt.ml", line 922, characters 66-71
Re-raised at file "net/socket/flow.ml", line 51, characters 2-287
Re-raised at file "std/lwt.ml", line 485, characters 33-36
Called from file "std/lwt.ml", line 147, characters 2-34
Called from file "std/lwt.ml", line 147, characters 2-34
...
"""

the reason i say "i think so" above is, surely i should see more detail than 
that with debugging turned on?  (though checking line numbers, it is the 
backtrace_* versions of lwt bind etc that are being called.)

+ anyway, investigating flow.ml around line 51 i see:

"""
let close t =
  R.close t.fd;
  Lwt.wakeup t.abort_u ();
  return ()

let close_on_exit t fn =
  try_lwt 
    lwt x = fn t in
    close t 
    >> return x
  with exn -> 
    close t
    >> fail exn
"""

where line 51 is the "lwt x = ...".

now, that looks suspicious to me- if an exception is raised in the initial call 
of close then won't this attempt to wakeup the abort_u thread twice, leading to 
the Lwt.wakeup exception observed?  

unfortunately, commenting out the try/catch sections doesn't solve the problem, 
so i'll keep looking...  any hints welcome- i'm getting this crash sufficiently 
frequently that i'd really prefer to fix it before the tutorial next week...

-- 
Cheers,

R.

i apologise for the rather long and pointless legalese that usually follows - i 
have no control over this. it embarrasses me as much as it irritates you...

This message and any attachment are intended solely for the addressee and may 
contain confidential information. If you have received this message in error, 
please send it back to me, and immediately delete it.   Please do not use, copy 
or disclose the information contained in this message or in any attachment.  
Any views or opinions expressed by the author of this email do not necessarily 
reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.