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

[Bug]: Accessing Mutable Field of 'Isolated' Object Outside 'Lock' Statement in Lambda Function #41214

Closed
chiranSachintha opened this issue Aug 16, 2023 · 1 comment · Fixed by #41828
Assignees
Labels
Priority/Blocker Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug userCategory/Compilation
Milestone

Comments

@chiranSachintha
Copy link
Member

Description

isolated class IsolatedClass {
    private int[][] arr;

    function init(int[] node) {
        self.arr = [];
        function v = function () {
            self.arr.push(node);
        };
    }

    function value(int[] node) {
        function v = function () {
            self.arr.push(node);
        };
    }
}

In the above example when attempting to access a mutable field of an 'isolated' object outside of a 'lock' statement within a lambda function it doesn't give any error. This can result in data integrity issues due to concurrent access without proper synchronization.

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@ballerina-bot ballerina-bot added the needTriage The issue has to be inspected and labeled manually label Aug 16, 2023
@chiranSachintha chiranSachintha added Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. and removed needTriage The issue has to be inspected and labeled manually labels Aug 16, 2023
@chiranSachintha
Copy link
Member Author

Related to #40757 (comment)

@MaryamZi MaryamZi self-assigned this Nov 28, 2023
@MaryamZi MaryamZi added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Dec 6, 2023
@MaryamZi MaryamZi added this to the 2201.9.0 milestone Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/Blocker Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug userCategory/Compilation
Projects
None yet
3 participants