Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable asserts when running engine tests #4918

Closed
2 tasks done
wdanilo opened this issue Feb 5, 2023 · 0 comments
Closed
2 tasks done

Enable asserts when running engine tests #4918

wdanilo opened this issue Feb 5, 2023 · 0 comments
Assignees
Labels
-compiler p-low Low priority x-chore Type: chore

Comments

@wdanilo
Copy link
Member

wdanilo commented Feb 5, 2023

This task is automatically imported from the old Task Issue Board and it was originally created by Pavel Marek.
Original issue is here.


When running library tests, i.e., enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso --no-ir-caches --run test/Tests, asserts are disabled by default. If we enable asserts by prepending the aforementioned command with env JAVA_OPTS='-ea', tests will fail with:

Execution finished with an error: java.lang.AssertionError
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostObject.forObject(HostObject.java:137)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostLanguage.getLanguageView(HostLanguage.java:173)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostLanguage.getLanguageView(HostLanguage.java:68)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.getLanguageView(LanguageAccessor.java:203)
        at <java> org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.getLanguageViewNoCheck(PolyglotLanguageContext.java:943)
        at <java> org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.getLanguageView(PolyglotLanguageContext.java:913)
        at <java> org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch.getValueInfo(PolyglotValueDispatch.java:1282)
        at <java> org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotHostAccess.getValueInfo(PolyglotHostAccess.java:152)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostInteropErrors.getValueInfo(HostInteropErrors.java:123)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostInteropErrors.nullCoercion(HostInteropErrors.java:57)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNode.convertImpl(HostToTypeNode.java:191)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNode.doGeneric(HostToTypeNode.java:140)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNodeGen$Uncached.execute(HostToTypeNodeGen.java:163)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNode.truffleObjectToArray(HostToTypeNode.java:653)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNode.asJavaObject(HostToTypeNode.java:426)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNode.convertImpl(HostToTypeNode.java:195)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNode.doCached(HostToTypeNode.java:118)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostToTypeNodeGen.execute(HostToTypeNodeGen.java:40)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostExecuteNode.doFixed(HostExecuteNode.java:128)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:61)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostObject.invokeMember(HostObject.java:451)
        at <java> org.graalvm.truffle/com.oracle.truffle.host.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:2674)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.invokeMember(InteropLibrary.java:3450)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:8138)
        at <java> org.enso.interpreter.node.callable.resolver.HostMethodCallNode.resolveHostMethod(HostMethodCallNode.java:200)
        at <java> org.enso.interpreter.node.callable.resolver.HostMethodCallNodeGen.execute(HostMethodCallNodeGen.java:41)
        at <java> org.enso.interpreter.node.callable.InvokeMethodNode.doPolyglot(InvokeMethodNode.java:212)
        at <java> org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:87)
        at <java> org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at <java> org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:54)
        at <java> org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:99)
        at <java> org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric_generic1(AssignmentNodeGen.java:56)
        at <java> org.enso.interpreter.node.scope.AssignmentNodeGen.executeGeneric(AssignmentNodeGen.java:36)
        at <java> org.enso.interpreter.node.scope.AssignmentNodeGen.executeVoid(AssignmentNodeGen.java:72)
        at <java> org.enso.interpreter.node.callable.function.BlockNode.executeGeneric(BlockNode.java:51)
        at <java> org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:90)
        at <enso> Vector.write_bytes<arg-1>(Internal)
        at <enso> Panic.catch_primitive(Internal)
        at <enso> Panic.catch(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Error/Common.enso:401-411)
        at <enso> Function.<|(Internal)
        at <enso> Vector.write_bytes(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/System/File.enso:1123-1129)
        at <enso> File_Spec.spec<arg-0>(src/System/File_Spec.enso:206:13-41)
        at <enso> File_Spec.spec<arg-1>(src/System/File_Spec.enso:206:13-88)
        at <enso> Main.run_spec<arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:782:18-25)
        at <enso> Panic.catch_primitive(Internal)
        at <enso> Panic.catch(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Error/Common.enso:401-411)
        at <enso> Panic.recover(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Error/Common.enso:471-476)
        at <enso> Function.<|(Internal)
        at <enso> Main.run_spec(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:781-785)
        at <enso> case_branch<arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:168:45-61)
        at <enso> Runtime.no_inline(Internal)
        at <enso> Duration.time_execution(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Time/Duration.enso:68:14-39)
        at <enso> case_branch(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:168:20-62)
        at <enso> Main.specify(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:167-169)
        at <enso> Function.<|(Internal)
        at <enso> File_Spec.spec<arg-1>(src/System/File_Spec.enso:201-206)
        at <enso> case_branch<arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:131:21-29)
        at <enso> State.run(Internal)
        at <enso> Function.<|(Internal)
        at <enso> case_branch(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:130-132)
        at <enso> Main.group<arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:128-137)
        at <enso> Boolean.if_then(Internal)
        at <enso> Main.group(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:127-137)
        at <enso> Function.<|(Internal)
        at <enso> File_Spec.spec(src/System/File_Spec.enso:153-359)
        at <enso> Main.main<arg-1>(src/Main.enso:86:5-18)
        at <enso> Suite.type.run<arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:103:13-17)
        at <enso> State.run(Internal)
        at <enso> Function.<|(Internal)
        at <enso> Suite.type.run<arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:102-105)
        at <enso> Main.wrap_junit_testsuites(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:814:14-19)
        at <enso> Function.<|(Internal)
        at <enso> Suite.type.run(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:101-105)
        at <enso> Suite.type.run_main(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Main.enso:29:9-30)
        at <enso> Function.<|(Internal)
        at <enso> Main.main(src/Main.enso:75-135)

Note that, AFAIK, Truffle tests sharing policies in asserts. So that if EnsoLanguage wants to conform to ContextPolicy == SHARED, it should at least enable asserts, so that we can see all the sharing-related assertion failures.

Tasks:

  • Fix test failing with asserts
  • Enable asserts in CI tests by default

Comments:

Trying this after merging latest develop to my branch on 2022-12-15, I cannot even execute a single arbitrary Enso source file with assertions enabled. It fails very early, complaining about some Truffle Source validity check. (Pavel Marek - Dec 16, 2022)


I've tried today and I'm getting ``` Execution finished with an error: java.lang.AssertionError: Invariant contract violation for receiver Nothing(org.enso.interpreter.runtime.data.Type). at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.notOtherType(InteropLibrary.java:2972) at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.isNull(InteropLibrary.java:2960) at org.enso.interpreter.node.expression.builtin.meta.EqualsAnyNodeGen.executeAndSpecialize(EqualsAnyNodeGen.java:812) at org.enso.interpreter.node.expression.builtin.meta.EqualsAnyNodeGen.execute(EqualsAnyNodeGen.java:464) at org.enso.interpreter.node.expression.builtin.meta.EqualsAnyMethodGen.execute(EqualsAnyMethodGen.java:70) at Any.==(Internal) at Any.!=(/home/radeusgd/NBO/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Any.enso:127:21-32) at Any.!=(/home/radeusgd/NBO/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Any.enso:127:20-37) at Suite_Config.type.from_environment(/home/radeusgd/NBO/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Suite_Config.enso:40:31-77) at Test_Suite.type.run_main(/home/radeusgd/NBO/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test_Suite.enso:39:18-46) at Function.<|(Internal) at Main.main(src/Main.enso:81-147) ```

Seems that Nothing is both isNull and isMetaObject and Truffle does not like that. (Radosław Waśko - Jan 13, 2023)


**Jaroslav Tulach** reports a new **STANDUP** for today (2023-01-19):

Progress: create "asserts on" branch: https://github.com/enso-org/enso/compare/wip/jtulach/EnableAsserts_183546453; Fighting DebuggingEnsoTest & instrumented nodes; fighting with TypeMembersTest.checkAtomMembers test; fixing runtime-with-instruments tests: c0b78a3; Blog post and AoC Review; It should be finished by 2023-01-25.

Next Day: At European Youth Olympic Festival. Back on Wednesday. (Enso Bot - Jan 19, 2023)


**Jaroslav Tulach** reports a new **STANDUP** for yesterday (2023-01-24):

Progress: Slowly getting back to work after vacation. Enable asserts PR: #4074,
Debugging AvoidIdInstrumentationTagTest, fixing RuntimeSuggestionUpdatesTest; Review of unboxed atoms: #3862; Eliminate (few) UUIDs note: https://www.pivotaltracker.com/story/show/182963507/comments/235202034 and discussion about UUIDs with Wojciech and publicly: https://discord.com/channels/401396655599124480/1067464813661409401 It should be finished by 2023-01-25.

Next Day: Enabling asserts work. (Enso Bot - Jan 25, 2023)


**Jaroslav Tulach** reports a new **STANDUP** for yesterday (2023-01-25):

Progress: - bisecting asserts enabled
- asserts found a serious problem in introp with other languages: #4074 (comment)
- analyzing why test failures are "swallowed"
- working on TypeMembersTest
- Using IndirectInvokeMethodNode to invoke to_display_text
- review assert from EpbContext with Marcin
- 1788857
- more of UUIDs discussion: https://discord.com/channels/401396655599124480/1067464813661409401
- review UUIDs with Marcin
- meeting with Pavel - review of his work on custom == and hash code
- build system work: #4081
- Grey pending nodes proposal: develop...JaroslavTulach:enso:wip/eng/GreyPendingNodes_184034702 It should be finished by 2023-01-25.

Next Day: Integrate enabling asserts work. (Enso Bot - Jan 26, 2023)


The PR is green and subject to be merged as soon as approved. (jaroslavtulach - Jan 26, 2023)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler p-low Low priority x-chore Type: chore
Projects
None yet
Development

No branches or pull requests

2 participants