On Sun, Mar 29, 2015 at 5:02 PM, Magnus Therning <[email protected]>
wrote:

> I've finally managed to set up an ARM system that can compile
> successfully (based on the pre-built image with swap added and an NTP
> client installed).  Compiling for unix now works perfectly fine,
> albeit a bit slow.
>
> The next step was to get mirage-www into a xen image.  I've
> succesfully built and started the following two configurations:
>
>     MODE=xen FS=crunch NET=direct DHCP=true PORT=80
>     MODE=xen FS=crunch DEPLOY=true ADDR=192.168.0.21 MASK=255.255.255.0
> GWS=192.168.0.1 PORT=80
>
> In both cases I've modified www.xl to contain
>
>     vif = [ 'bridge=xenbr0' ]
>
> In both cases the VM comes up just fine, when using DCHP it gets an IP
> without issues.  Then, when sitting there waiting for a connection I
> get this on the console:
>
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>

Assuming you're using the v2.3.0 release (IIRC v2.4.0 hasn't been merged
yet), then this is the assert:

  let input t ~tcp ~udp ~default buf =
    (* buf pointers to start of IPv4 header here *)
    let ihl = (Wire_structs.Ipv4_wire.get_ipv4_hlen_version buf land 0xf) *
4 in
    let src = Ipaddr.V4.of_int32 (Wire_structs.Ipv4_wire.get_ipv4_src buf)
in
    let dst = Ipaddr.V4.of_int32 (Wire_structs.Ipv4_wire.get_ipv4_dst buf)
in
    let payload_len = Wire_structs.Ipv4_wire.get_ipv4_len buf - ihl in
    (* XXX this will raise exception for 0-length payload *)
    let hdr, data = Cstruct.split buf ihl in
    assert (Cstruct.len data = payload_len);
    let proto = Wire_structs.Ipv4_wire.get_ipv4_proto buf in
    match Wire_structs.Ipv4_wire.int_to_protocol proto with
    | Some `ICMP -> icmp_input t src hdr data
    | Some `TCP  -> tcp ~src ~dst data
    | Some `UDP  -> udp ~src ~dst data
    | None       -> default ~proto ~src ~dst data

So it looks like you're receiving truncated IP frames. It would be helpful
to know what the frames actually are-- could you do something like:

git clone git://github.com/mirage/mirage-tcpip
cd mirage-tcpip
git checkout v2.3.0

perhaps change the assert into something like

if Cstruct.len data <> payload_len then begin
  printf "argh, it's all broken! len = %d payload_len = %d\n" (Cstruct.len
data) payload_len;
  Cstruct.hexdump buf;
end

(quoting the Cstruct manual:
 " when the going gets tough, the tough hexdump their cstructs
    and peer at it until the bug disappears.  This will directly
    prettyprint the contents of the cstruct to the standard output. ")

opam pin add tcpip .

.. and then rebuild your app with the new code.

[ snip ]

>     DHCP: offer received
>                         IPv4: 192.168.0.21
>                                           Netmask: 255.255.255.0
>                                                                 Gateways:
> [192.168.0.1]
>      sg:true gso_tcpv4:true rx_copy:true rx_flip:false smart_poll:false
>     ARP: sending gratuitous from 192.168.0.21
>     DHCP offer received and bound to 192.168.0.21 nm 255.255.255.0 gw
> [192.168.0.1]
>

It's obviously not all bad, since some networking is working!


>     Manager: configuration done
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     ARP responding to: who-has 192.168.0.21?
>     ARP: transmitting probe -> 192.168.0.11
>     ARP: updating 192.168.0.11 -> 00:c2:c6:0f:72:dd
>
> When making a request to 192.168.0.21 I get a bit of a response, but not a
> full
> one and the console is filled with stuff like this:
>
>     200 GET /
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     TCP retransmission on timer seq = 452908524
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     TCP retransmission on timer seq = 452908524
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     TCP retransmission on timer seq = 452908524
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     TCP retransmission on timer seq = 452908524
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     TCP retransmission on timer seq = 452908524
>     RX exn File "lib/ipv4.ml", line 181, characters 4-10: Assertion failed
>     ARP responding to: who-has 192.168.0.21?
>
> Clearly I'm doing something wrong here, but what?  Any and all suggestions
> are
> welcome.
>

I don't think the assert failures are your fault ;-)

Cheers,
Dave


>
> /M
>
> --
> Magnus Therning                      OpenPGP: 0xAB4DFBA4
> email: [email protected]   jabber: [email protected]
> twitter: magthe               http://therning.org/magnus
>
> The ultimate goal of all computer science is the program.  The
> performance of programs was once the noblest function of computer
> science, and computer science was indispensable to great programs.
> Today, programming and computer science exist in complacent isolation,
> and can be [rescued only] by conscious coöperation and collaboration
> of all programmers.
>
> _______________________________________________
> MirageOS-devel mailing list
> [email protected]
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
>
>

-- 
Dave Scott
_______________________________________________
MirageOS-devel mailing list
[email protected]
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Reply via email to