[MLton] a few remaining Solaris bugs with the new runtime

Matthew Fluet fluet@cs.cornell.edu
Thu, 13 Jul 2006 17:20:13 -0400 (EDT)


> I've fixed the profiling and FFI bugs.  The only remaning bug on
> Solaris is the echo regression failure.  Looking with truss, I see
> that the following system call fails:
>
>  setsockopt(4, 65535, 4, 0x7F921608, 8, 1)       Err#22 EINVAL
>
> The problem seems to be the "8", which the the "optlen" argument to
> setsockopt.
>
>  int setsockopt(int s, int level, int optname, const void *optval, int optlen);
>
> That length is computed in basis-library/net/socket.sml with
>
>  val intLen = Int.quot (C_Int.precision', 4)
>
> What I don't understand is why the precision is divided by 4 (yielding
> 8) and not 8 (yielding 4, which I think is the correct value for
> optlen).  The same question applies to the definition of sizeLen in
> the same file.
>
>  val sizeLen = Int.quot (C_Size.wordSize, 4)
>
> If I change those 4's to 8's, the echo regression works fine on
> Solaris.

Division by 8 seems right.