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

gRPC mock server return (-1073741819) access violation error randomly on Windows #52

Closed
tienvx opened this issue Feb 21, 2024 · 5 comments

Comments

@tienvx
Copy link
Contributor

tienvx commented Feb 21, 2024

This error only happen on Windows, randomly, when testing consumer (a gRPC mock server is started and a request is made to that server):

Script phpunit --no-coverage handling the test event returned with error code -1073741819

According to this comment, the error code -1073741819 is an access violation.

  • I only guess it's gRPC mock server. I'm not sure

  • PHPUnit reported that test is OK, so I assume this error code is not coming from PHP side

  • Nothing's suspicious in the log log.txt

  • There are no big different between failed test's log and passed test's log

  • All logs from protobuf plugin (C:\\Users\\runneradmin\\.pact/plugins\\protobuf-0.3.13\\log) are empty, so it doesn't provide any useful information (I think it's an issue, because it happen on linux and mac too) protobuf-plugin-log-windows-8.3-lowest.zip

  • It did appear once on my local Windows machine (not just Github Actions)

Information:

{
  "consumer": {
    "name": "protobufSyncMessageConsumer"
  },
  "interactions": [
    {
      "description": "request for calculate shape area",
      "interactionMarkup": {
        "markup": "```protobuf\nmessage AreaResponse {\n    float value = 1;\n}\n```\n",
        "markupType": "COMMON_MARK"
      },
      "pending": false,
      "pluginConfiguration": {
        "protobuf": {
          "descriptorKey": "6b90c212dfe22dc3c119d1c3fe42b5e1",
          "service": "Calculator/calculate"
        }
      },
      "request": {
        "contents": {
          "content": "EgoNAABAQBUAAIBA",
          "contentType": "application/protobuf;message=ShapeMessage",
          "contentTypeHint": "BINARY",
          "encoded": "base64"
        },
        "matchingRules": {
          "body": {
            "$.rectangle.length": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "number"
                }
              ]
            },
            "$.rectangle.width": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "number"
                }
              ]
            }
          }
        },
        "metadata": {
          "contentType": "application/protobuf;message=ShapeMessage"
        }
      },
      "response": [
        {
          "contents": {
            "content": "DQAAQEE=",
            "contentType": "application/protobuf;message=AreaResponse",
            "contentTypeHint": "BINARY",
            "encoded": "base64"
          },
          "matchingRules": {
            "body": {
              "$.value": {
                "combine": "AND",
                "matchers": [
                  {
                    "match": "number"
                  }
                ]
              }
            }
          },
          "metadata": {
            "contentType": "application/protobuf;message=AreaResponse"
          }
        }
      ],
      "transport": "grpc",
      "type": "Synchronous/Messages"
    }
  ],
  "metadata": {
    "pactRust": {
      "ffi": "0.4.14",
      "mockserver": "1.2.5",
      "models": "1.1.17"
    },
    "pactSpecification": {
      "version": "4.0"
    },
    "plugins": [
      {
        "configuration": {
          "6b90c212dfe22dc3c119d1c3fe42b5e1": {
            "protoDescriptors": "CtYFChVhcmVhX2NhbGN1bGF0b3IucHJvdG8SB3BsdWdpbnMikgIKDFNoYXBlTWVzc2FnZRIpCgZzcXVhcmUYASABKAsyDy5wbHVnaW5zLlNxdWFyZUgAUgZzcXVhcmUSMgoJcmVjdGFuZ2xlGAIgASgLMhIucGx1Z2lucy5SZWN0YW5nbGVIAFIJcmVjdGFuZ2xlEikKBmNpcmNsZRgDIAEoCzIPLnBsdWdpbnMuQ2lyY2xlSABSBmNpcmNsZRIvCgh0cmlhbmdsZRgEIAEoCzIRLnBsdWdpbnMuVHJpYW5nbGVIAFIIdHJpYW5nbGUSPgoNcGFyYWxsZWxvZ3JhbRgFIAEoCzIWLnBsdWdpbnMuUGFyYWxsZWxvZ3JhbUgAUg1wYXJhbGxlbG9ncmFtQgcKBXNoYXBlIikKBlNxdWFyZRIfCgtlZGdlX2xlbmd0aBgBIAEoAlIKZWRnZUxlbmd0aCI5CglSZWN0YW5nbGUSFgoGbGVuZ3RoGAEgASgCUgZsZW5ndGgSFAoFd2lkdGgYAiABKAJSBXdpZHRoIiAKBkNpcmNsZRIWCgZyYWRpdXMYASABKAJSBnJhZGl1cyJPCghUcmlhbmdsZRIVCgZlZGdlX2EYASABKAJSBWVkZ2VBEhUKBmVkZ2VfYhgCIAEoAlIFZWRnZUISFQoGZWRnZV9jGAMgASgCUgVlZGdlQyJICg1QYXJhbGxlbG9ncmFtEh8KC2Jhc2VfbGVuZ3RoGAEgASgCUgpiYXNlTGVuZ3RoEhYKBmhlaWdodBgCIAEoAlIGaGVpZ2h0IiQKDEFyZWFSZXNwb25zZRIUCgV2YWx1ZRgBIAEoAlIFdmFsdWUySQoKQ2FsY3VsYXRvchI7CgljYWxjdWxhdGUSFS5wbHVnaW5zLlNoYXBlTWVzc2FnZRoVLnBsdWdpbnMuQXJlYVJlc3BvbnNlIgBCA9ACAWIGcHJvdG8z",
            "protoFile": "syntax = \"proto3\";\n\npackage plugins;\n\noption php_generic_services = true;\n\nservice Calculator {\n    rpc calculate (ShapeMessage) returns (AreaResponse) {}\n}\n\nmessage ShapeMessage {\n  oneof shape {\n    Square square = 1;\n    Rectangle rectangle = 2;\n    Circle circle = 3;\n    Triangle triangle = 4;\n    Parallelogram parallelogram = 5;\n  }\n}\n\nmessage Square {\n  float edge_length = 1;\n}\n\nmessage Rectangle {\n  float length = 1;\n  float width = 2;\n}\n\nmessage Circle {\n  float radius = 1;\n}\n\nmessage Triangle {\n  float edge_a = 1;\n  float edge_b = 2;\n  float edge_c = 3;\n}\n\nmessage Parallelogram {\n  float base_length = 1;\n  float height = 2;\n}\n\nmessage AreaResponse {\n    float value = 1;\n}\n"
          }
        },
        "name": "protobuf",
        "version": "0.3.13"
      }
    ]
  },
  "provider": {
    "name": "protobufSyncMessageProvider"
  }
}
@tienvx tienvx changed the title gRPC mock server return access violation error randomly on Windows gRPC mock server return (-1073741819) access violation error randomly on Windows Feb 21, 2024
@tienvx
Copy link
Contributor Author

tienvx commented Feb 21, 2024

Switch from powershell to bash and I can see an extra error line below:

Script phpunit --no-coverage handling the test event returned with error code -1073741819
D:\a\_temp\ad6416d5-3f24-46c4-b4ed-876eaa522037.sh: line 1:  1826 Segmentation fault      composer test
Error: Process completed with exit code 139.

The number 1826 is not fixed. It look like a random number

@tienvx
Copy link
Contributor Author

tienvx commented Mar 7, 2024

I have a work around for this: Run tests in different jobs for Windows on Github Actions.

pact-foundation/pact-php#497

@rholshausen
Copy link
Contributor

Looks like there is some issue on Windows with the integration tests as well. They are taking over 5 mins each to run.

running 1 test
test repeated_enum_test has been running for over 60 seconds
test repeated_enum_test ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 610.03s

     Running tests\mock_server_tests.rs (target\debug\deps\mock_server_tests-cac5d069ab2d137b.exe)

running 2 tests
test mock_server_with_no_requests ... ok
test each_value_matcher has been running for over 60 seconds
test each_value_matcher ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 610.04s

@tienvx
Copy link
Contributor Author

tienvx commented May 14, 2024

This error happen to csv plugin as well recently, quite frequently. If it's not related, I can create new ticket for it on pact-foundation/pact-plugins repo.

@tienvx
Copy link
Contributor Author

tienvx commented Sep 24, 2024

Weird. This issue is suddenly gone from Pact-PHP side. I will close this issue for now.

@tienvx tienvx closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants