uv_default_loop() call does not check return value and generates segmentation fault
In Source/cmakemain.cxx there is no return value check when calling uv_default_loop().
In Linux kernels that do not have CONFIG_EVENTFD enabled (like mine), uv_default_loop() returns -ENOSYS (-38) "Function not implemented".
This causes a NULL pointer to be passed to a later function call and the segmentation violation.
705 int ret = do_cmake(ac, av);
706 #ifndef CMAKE_BOOTSTRAP
707 cmDynamicLoader::FlushCache();
708 #endif
709 uv_loop_close(uv_default_loop()); <---- no error code checking
710 return ret;
711 }
To reproduce this, compile your kernel with CONFIG_EVENTFD disabled and invoke something simple like 'cmake --help'.
Edited by Brad King