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

Re: [MirageOS-devel] contributing best practices?

On 25 Mar 2014, at 16:06, Mindy Preston <mindy@xxxxxxxxxxxxxxxxxxx> wrote:

> Hi all,
> I just submitted my first pull request of substance for Mirage (against 
> mirage-tcpip).  It's a fix for some DHCP-option parsing bugs I found, which 
> prevented unikernels from getting IPs on some EC2 instances.

Firstly, my apologies for inflicting the `RX exn 
Invalid_argument("String.sub")` error on you :-)  The DHCP client code was 
written an age ago (before the cstruct syntax extension), and so is 
particularly poor at error handling or other niceties.

One quick trick that often helps in these sorts of situations is to wrap the 
offending code in a try/with and print the backtrace:

with exn ->
  Printf.printf "Exn: %s\n%!" (Printexc.to_string exn);
  Printexc.print_backtrace stdout; 
  raise exn

This should help isolate the problem much more quickly.  Debugging remotely on 
Amazon before networking is up is particularly tedious due to the amount of 
time it takes the remote console logs to update (often up to 5 minutes for me).

(For those who haven't seen the blog posts:
 - http://www.somerandomidiot.com/blog/2014/03/14/its-a-mirage/
 - http://www.somerandomidiot.com/blog/2014/03/24/advancing-toward-the-mirage/
 - http://www.somerandomidiot.com/blog/2014/03/24/arriving-at-the-mirage/ )

> I couldn't find any documentation of best practices for contributions, so I 
> just minimized my changeset and submitted the pull request on GitHub - is 
> there something better/else/more/etc that's preferred?

That looks great as is.  I'm just rebuilding my environment, will test on EC2 
tomorrow morning, and then merge/release your fix once I've verified it's ok 

It occurs to me that with so many libraries these days, we really ought to 
maintain a trove on the Mirage website.  I've filed 
https://github.com/mirage/mirage/issues/236 for this.

MirageOS-devel mailing list



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