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

Runtime.assert does not work when called from lazy atom field #8741

Closed
2 tasks
Akirathan opened this issue Jan 11, 2024 · 0 comments · Fixed by #8742
Closed
2 tasks

Runtime.assert does not work when called from lazy atom field #8741

Akirathan opened this issue Jan 11, 2024 · 0 comments · Fixed by #8742
Assignees
Labels
--bug Type: bug -compiler p-high Should be completed in the next sprint

Comments

@Akirathan
Copy link
Member

During my work on #8622, I encountered a weird error in an unexpected AssertionError in

if file.exists.not then Panic.throw "Assertion error"
assert file.exists.not
. That assert fails, but the if check above it does not.

I was unable to provide a smaller reproducer, and it is not clear to me what are the circumstances of this bug. I suggest reimplementing Runtime.assert builtin method to just check whether assertions are enabled via a builtin method, and do the rest in pure Enso code. Let's simplify it.

To reproduce:

env JAVA_OPTS=-ea ./built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/bin/enso --no-ir-caches --in-project test/Table_Tests --run test/Table_Tests/src/Database/SQLite_Spec_New.enso

The actual output is:

Running tests in group '[SQLite File] Connection.query'...
  Running spec 'should allow to access a Table by name'...
    SQLite_Spec_New.File_Connection.create_file
    SQLite_Spec_New.File_Connection.create_file: file.exists = True
  Finished spec 'should allow to access a Table by name'.
    Common_Spec_New.Basic_Data.teardown
Execution finished with an error: Assertion Error: ''
        at <enso> Runtime.assert_builtin(Internal)
        at <enso> Runtime.assert(/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/Runtime.enso:64:29-57)
        at <enso> File_Connection.type.create_file(SQLite_Spec_New.enso:102:9-30)
        at <enso> File_Connection.type.create<arg-1>(SQLite_Spec_New.enso:93:30-56)
        at <enso> File_Connection.file(Internal)
        at <enso> File_Connection.connection<arg-0>(SQLite_Spec_New.enso:110:34-42)
        at <enso> File_Connection.connection<arg-1>(SQLite_Spec_New.enso:110:27-42)
        at <enso> File_Connection.connection(SQLite_Spec_New.enso:110:9-43)
        at <enso> Basic_Data.type.create_t1<arg-1>(/home/pavel/dev/enso/test/Table_Tests/src/Database/Common/Common_Spec_New.enso:46:21-50)
        at <enso> Basic_Data.type.create_t1(/home/pavel/dev/enso/test/Table_Tests/src/Database/Common/Common_Spec_New.enso:46:14-113)
        at <enso> Basic_Data.type.create<arg-2>(/home/pavel/dev/enso/test/Table_Tests/src/Database/Common/Common_Spec_New.enso:40:77-116)
        at <enso> <anonymous><arg-0>(/home/pavel/dev/enso/test/Table_Tests/src/Database/Common/Common_Spec_New.enso:190:20-26)
        at <enso> <anonymous><arg-1>(/home/pavel/dev/enso/test/Table_Tests/src/Database/Common/Common_Spec_New.enso:190:20-31)
        at <enso> null(Internal)
        at <enso> <anonymous>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Group.enso:22:53-56)
        at <enso> Helpers.execute_spec_code<arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Helpers.enso:60:18-34)
        at <enso> Panic.catch(Internal)
        at <enso> Panic.type.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/Panic.enso:185-190)
        at <enso> Helpers.execute_spec_code(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Helpers.enso:59-63)
        at <enso> case_branch<arg-3>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Helpers.enso:51:37-63)
        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_New/0.0.0-dev/src/Helpers.enso:51:13-64)
        at <enso> Runtime.no_inline(Internal)
        at <enso> Duration.type.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:127:18-43)
        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_New/0.0.0-dev/src/Helpers.enso:50-51)
        at <enso> Helpers.run_spec(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Helpers.enso:49-52)
        at <enso> <anonymous>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Helpers.enso:36:24-36)
        at <enso> Function.<<(/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/Function.enso:46:26-38)
        at <enso> wrapped_function(/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/Internal/Array_Like_Helpers.enso:73:18-27)
        at <enso> Array_Like_Helpers.vector_from_function(Internal)
        at <enso> Array_Like_Helpers.vector_from_function(/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/Internal/Array_Like_Helpers.enso:98:15-68)
        at <enso> Vector.map(/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/Vector.enso:614:9-93)
        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_New/0.0.0-dev/src/Helpers.enso:34-40)
        at <enso> Helpers.run_specs_from_group(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Helpers.enso:30-43)
        at <enso> Helpers.run_group_with_filter(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Helpers.enso:20:5-45)
        at <enso> <anonymous><arg-1>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Suite.enso:61:27-78)
        at <enso> <anonymous>(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Suite.enso:60-62)
        at <enso> <anonymous>(/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/Vector.enso:723:13-26)
        at <enso> go<arg-2>(/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/Range.enso:243:21-36)
        at <enso> go(/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/Range.enso:242-244)
        at <enso> Range.each<arg-2>(/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/Range.enso:245:13-25)
        at <enso> Range.each(/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/Range.enso:239-245)
        at <enso> Vector.each(/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/Vector.enso:722-723)
        at <enso> Suite.run_with_filter(/home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Test_New/0.0.0-dev/src/Suite.enso:59-62)
        at <enso> SQLite_Spec_New.main(SQLite_Spec_New.enso:147:5-50)

Tasks

Preview Give feedback
@Akirathan Akirathan self-assigned this Jan 11, 2024
@Akirathan Akirathan moved this from ❓New to 📤 Backlog in Issues Board Jan 11, 2024
@Akirathan Akirathan added the p-high Should be completed in the next sprint label Jan 11, 2024
@Akirathan Akirathan moved this from 📤 Backlog to 🔧 Implementation in Issues Board Jan 11, 2024
@Akirathan Akirathan linked a pull request Jan 11, 2024 that will close this issue
5 tasks
@Akirathan Akirathan mentioned this issue Jan 11, 2024
5 tasks
@github-project-automation github-project-automation bot moved this from 🔧 Implementation to 🟢 Accepted in Issues Board Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler p-high Should be completed in the next sprint
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant