eclipse / omr

Eclipse OMR™ Cross platform components for building reliable, high performance language runtimes
http://www.eclipse.org/omr
Other
940 stars 394 forks source link

Enable core file generation on Linux in the Azure pipeline #6490

Open babsingh opened 2 years ago

babsingh commented 2 years ago

This issue is opened to enable core file generation for the x86-64 Linux job, which is run in Azure. Related: https://github.com/eclipse/omr/pull/6487. The Azure job is defined in azure-pipelines.yml:

https://github.com/eclipse/omr/blob/7abfd05e8d911a44fc6ce4cba97584f9065444a7/azure-pipelines.yml#L114-L118

The below tests are failing because core files are not generated on Linux within the Azure pipeline. These tests are disabled in https://github.com/eclipse/omr/pull/6487 until core file generation can be enabled on Linux in the Azure pipeline.

The following tests FAILED:
     31 - porttest (Failed)

31: [  FAILED  ] PortDumpTest.dump_test_create_dump_with_NO_name
31: [  FAILED  ] PortDumpTest.dump_test_create_dump_with_name
31: [  FAILED  ] PortDumpTest.dump_test_create_dump_from_signal_handler

31: /home/vsts/work/1/s/fvtest/porttest/omrdumpTest.cpp line  173: omrdump_test_create_dump_with_NO_name omrdump_create returned: 1, with filename: The core file created by child process with pid = 16910 was not found. Expected to find core file with name "core"

I tried to add the below cmds in azure-pipelines.yml, but privileged cmds cannot be invoked in the Azure environment:

### For core file generation
     sudo echo "core.%p" > /proc/sys/kernel/core_pattern
     sudo echo "kernel.core_pattern=core.%p" >> /etc/sysctl.conf
     sudo systemctl disable apport
     ulimit -c unlimited
     ulimit -n 1048576
     ulimit -u unlimited

### Does not work: privileged cmds cannot be invoked
     /home/vsts/work/_temp/788c8a55-2e55-4912-9795-f8c5bedd2b80.sh: line 1: /proc/sys/kernel/core_pattern: Permission denied
     /home/vsts/work/_temp/788c8a55-2e55-4912-9795-f8c5bedd2b80.sh: line 2: /etc/sysctl.conf: Permission denied
     apport.service is not a native service, redirecting to systemd-sysv-install.
davidjmccann commented 2 years ago

This is a little related to #6300, although given that this isn't in a container, it might be solved another way.

babsingh commented 2 years ago

it might be solved another way.

There may be an easier way to enable core-file generation at the kernel level in the Azure pipeline.

But, https://github.com/eclipse/omr/issues/6300 will work as an alternative since the runtime will generate the core-file without relying upon the kernel or its settings.