There have been a number of updates in the pipeline that were held off until 5.8.1 was released. I've merged a few into master and there are some more that will come in in due course.
Statistics: The statistics have been revisited, particularly the shared statistics. The statistics now include information about garbage-collections and other operations that cause the ML environment to be suspended. Obviously this is only useful if the statistics are being read by another process but the idea is that it would be possible to provide information to a user about why the ML environment is not responding. On Unix Poly/ML only creates the shared memory file for the statistics if --exportstats is given. The file is now created in the directory given in the $POLYSTATSDIR environment variable if that is present, falling back to $HOME/.polyml otherwise. When looking for remote statistics $POLYSTATSDIR is checked first followed by $HOME/.polyml.
Secure OSs: There is now support for OpenBSD and SELinux in enforcing mode. There was a problem with these operating systems because they forbid the creation of memory areas with both execute and write permissions. In order to create and garbage collect ML code the RTS needs to be able to write to the code areas and it also needs to be executed. The work-around is to use memory mapped files and create two separate regions mapped to the same file. This is only done if the usual memory allocation with read-write-execute permission fails. I wanted to get this working because I was concerned that at some point more main-stream operating systems, such as Mac OS, might introduce a similar restriction. Note that there is still an issue with text-relocations but this can be got round using either "chcon -t textrel_shlib_t poly" on SELinux or LDFLAGS='-Wl,-z,notext' on OpenBSD.
David
On 11/08/2020 09:37, David Matthews wrote:
Secure OSs:? There is now support for OpenBSD and SELinux in enforcing mode.? There was a problem with these operating systems because they forbid the creation of memory areas with both execute and write permissions.? In order to create and garbage collect ML code the RTS needs to be able to write to the code areas and it also needs to be executed.? The work-around is to use memory mapped files and create two separate regions mapped to the same file.
I have problems building that version b95a85ead3ae on Windows with MinGW:
""" In file included from osmemwin.cpp:34: osmem.h:97:5: error: 'Bitmap' does not name a type 97 | Bitmap pageMap; | ^~~~~~ osmemwin.cpp: In member function 'bool OSMem::Initialise(OSMem::_MemUsage, size_ t, void**)': osmemwin.cpp:76:10: error: 'pageMap' was not declared in this scope 76 | if (!pageMap.Create(space / pageSize)) | ^~~~~~~ osmemwin.cpp:84:5: error: 'pageMap' was not declared in this scope 84 | pageMap.SetBit(space / pageSize - 1); | ^~~~~~~ osmemwin.cpp: In member function 'void* OSMem::AllocateDataArea(size_t&)': osmemwin.cpp:97:16: error: 'pageMap' was not declared in this scope; did you mea n 'pages'? 97 | while (pageMap.TestBit(lastAllocated - 1)) // Skip the wholly al located area. | ^~~~~~~ | pages osmemwin.cpp:99:26: error: 'pageMap' was not declared in this scope; did you mea n 'pages'? 99 | uintptr_t free = pageMap.FindFree(0, lastAllocated, pages); | ^~~~~~~ | pages osmemwin.cpp: In member function 'bool OSMem::FreeDataArea(void*, size_t)': osmemwin.cpp:118:9: error: 'pageMap' was not declared in this scope; did you mea n 'pages'? 118 | pageMap.ClearBits(offset, pages); | ^~~~~~~ | pages osmemwin.cpp: In member function 'void* OSMem::AllocateCodeArea(size_t&, void*&) ': osmemwin.cpp:134:16: error: 'pageMap' was not declared in this scope; did you me an 'pages'? 134 | while (pageMap.TestBit(lastAllocated - 1)) // Skip the wholly al located area. | ^~~~~~~ | pages osmemwin.cpp:136:26: error: 'pageMap' was not declared in this scope; did you me an 'pages'? 136 | uintptr_t free = pageMap.FindFree(0, lastAllocated, pages); | ^~~~~~~ | pages osmemwin.cpp: In member function 'bool OSMem::FreeCodeArea(void*, void*, size_t) ': osmemwin.cpp:160:9: error: 'pageMap' was not declared in this scope; did you mea n 'pages'? 160 | pageMap.ClearBits(offset, pages); | ^~~~~~~ | pages make[3]: *** [Makefile:800: osmemwin.lo] Error 1 make[3]: Leaving directory '/d/cygwin64/home/wenzelm/lib/polyml/polyml-git/libpo lyml' make[2]: *** [Makefile:840: all-recursive] Error 1 make[2]: Leaving directory '/d/cygwin64/home/wenzelm/lib/polyml/polyml-git/libpo lyml' make[1]: *** [Makefile:729: all-recursive] Error 1 make[1]: Leaving directory '/d/cygwin64/home/wenzelm/lib/polyml/polyml-git' make: *** [Makefile:488: all] Error 2 Build failed *** Error """
(See also https://isabelle.sketis.net/repos/isabelle/file/9e5862223442/Admin/polyml/IN...)
Makarius
On 11/08/2020 12:22, Makarius wrote:
On 11/08/2020 09:37, David Matthews wrote:
Secure OSs:? There is now support for OpenBSD and SELinux in enforcing mode. There was a problem with these operating systems because they forbid the creation of memory areas with both execute and write permissions.? In order to create and garbage collect ML code the RTS needs to be able to write to the code areas and it also needs to be executed.? The work-around is to use memory mapped files and create two separate regions mapped to the same file.
I have problems building that version b95a85ead3ae on Windows with MinGW:
It should be fixed now. It seemed to be with the 32-in-64 bit version on MSys.
David