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]: Runtime Crash when using worker interaction to default worker with error return #41626

Closed
warunalakshitha opened this issue Nov 2, 2023 · 2 comments · Fixed by #41679
Assignees
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@warunalakshitha
Copy link
Contributor

warunalakshitha commented Nov 2, 2023

Description

Please refer the example.

import ballerina/http;

service /payments on new http:Listener(9095) {

    resource function post orders/[string orderID]/reserve() returns int|error {

        worker w1 returns error? {
            int a = 10;
            a -> function;
        }
        int b = <- w1;
        return b;
    }
}

When running above progran, runtime crash with following log.

java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    waruna/httpService/0/$value$$anonType$_0.$post$orders$^$reserve(Lio/ballerina/runtime/internal/scheduling/Strand;Lio/ballerina/runtime/api/values/BString;)Ljava/lang/Object; @1206: invokestatic
  Reason:
    Type 'waruna/httpService/0/$value$$anonType$_0' (current frame, stack[1]) is not assignable to 'io/ballerina/runtime/internal/scheduling/Strand'
  Current Frame:
    bci: @1206
    flags: { }

@warunalakshitha warunalakshitha added Type/Bug Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime labels Nov 2, 2023
@warunalakshitha
Copy link
Contributor Author

warunalakshitha commented Nov 2, 2023

Error can be removed if we return only int (remove error)

@warunalakshitha warunalakshitha changed the title [Bug]: Runtime Crash when using worker interaction to parent function [Bug]: Runtime Crash when using worker interaction to default worker with error return Nov 2, 2023
@warunalakshitha warunalakshitha moved this from BackLog to Planned for Sprint in Ballerina Team Main Board Nov 9, 2023
@gabilang gabilang moved this from Planned for Sprint to In Progress in Ballerina Team Main Board Nov 9, 2023
@gabilang gabilang moved this from In Progress to PR Sent in Ballerina Team Main Board Nov 11, 2023
@github-project-automation github-project-automation bot moved this from PR Sent to Done in Ballerina Team Main Board Nov 23, 2023
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants