lightoj-dev / bugs-and-features

This repository is only for tracking bugs and feature requests on LightOJ
14 stars 1 forks source link

Kotlin with Compilation Error #185

Closed xuanswe closed 1 year ago

xuanswe commented 1 year ago

Describe the bug

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
/usr/lib/kotlinc/bin/kotlinc: line 80: 33941 Killed                  "${JAVACMD:=java}" $JAVA_OPTS "${java_args[@]}" -cp "${kotlin_app[@]}" "${kotlin_args[@]}"

To Reproduce Steps to reproduce the behavior:

  1. Open submission https://lightoj.com/submission/2798853. If this page is not public, then the code is here
  2. Open the problem and use the code in the previous page
  3. Click "Run on Samples": sometime success (Sample Passed), sometime "Compilation Error"
  4. Click on "Submit": "Compilation Error"

Expected behavior The code should always be compiled successfully.

Screenshots image

image

image

Browser information (please complete the following information):

xuanswe commented 1 year ago

Oh, if I add import java.util.*, it's success. But the error message is misleading.

xuanswe commented 1 year ago

From the same code, that uses readLine() to read input. Now, I want to use bufferedReader, I get Compilation Error again. See code here

image

xuanswe commented 1 year ago

Not sure if that's a bug of kotlin compiler or the configuration of LightOJ.

xuanswe commented 1 year ago

Well, now try the accepted code again, it fails. So, basically, unpredictable when the code is accepted or fails with Compilation Error.

jan876 commented 1 year ago

Thanks for reporting the issue. It was actually a combination of both. Kotlin requires a lot of memory to compile and also the old kotlin was not happy with the java version. We fixed this and rejudged all the submissions.

Keeping the ticket open, please close this if it solved the issue. Thanks.

xuanswe commented 1 year ago

Thanks for reporting the issue. It was actually a combination of both. Kotlin requires a lot of memory to compile and also the old kotlin was not happy with the java version. We fixed this and rejudged all the submissions.

Keeping the ticket open, please close this if it solved the issue. Thanks.

Wow! Thanks! it works now. Not tested with other problems, but at least, my code passed the mentioned problem immediately on the first try.