Getting a strange error on my Crouton chroot on my Chromebook after apt-get install smlnj and attempting to call sml from the terminal, an error that I haven't been able to find anywhere else:
$ sml
/usr/lib/smlnj/bin/sml: Error -- unable to map 1179648 bytes, errno = 1
/usr/lib/smlnj/bin/sml: Fatal error -- unable to allocate memory object for BIBOP
Any guidance?
Edit: This issue (bug #120) was fixed in SML/NJ version 110.77 (release notes) by enabling MAP_ANONYMOUS, which was previously unsupported in Linux. Installing the latest version of SMLNJ would be preferable to the solution below, since it doesn't require weakening the security of the system. If you do continue via modifying the permissions of
/dev, it's advisable to removeexecpermission after each session.This problem is primarily reproducible in a Chromium OS environment running ChrUbuntu or Crouton, but may happen to other users in other environments who have a similar problem.
Running
straceonsmlgives this (attempted) operation before the error output:According to the mmap(2) documentation,
EPERMindicates that the system is attempting to allocate memory with execute permission in a directory that is markednoexec.Indeed,
mountgives:The solution is thus to remount
/devwithexecpermission: