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

"Iterator past the end ..." panics #344

Closed
tienvx opened this issue Nov 21, 2023 · 1 comment
Closed

"Iterator past the end ..." panics #344

tienvx opened this issue Nov 21, 2023 · 1 comment

Comments

@tienvx
Copy link
Contributor

tienvx commented Nov 21, 2023

I got these panics while working with message's iterators:

Caught panic with error: iter past the end of metadata with:

  • pactffi_message_get_metadata_iter
  • pactffi_message_metadata_iter_next

and Caught panic with error: iter past the end of messages with:

  • pactffi_pact_handle_get_message_iter
  • pactffi_pact_message_iter_next

It's not a problem at least on PHP on normal condition, because the code is still running:

Feature: Message consumer
  Supports V3 message consumer interactions

  Scenario: Supports the use of generators with message metadata                   # compatibility-suite/pact-compatibility-suite/features/V3/message_consumer.feature:71
    Given a message integration is being defined for a consumer test               # PhpPactTest\CompatibilitySuite\Context\V3\Message\ConsumerContext::aMessageIntegrationIsBeingDefinedForAConsumerTest()
    And the message is configured with the following:                              # PhpPactTest\CompatibilitySuite\Context\V3\Message\ConsumerContext::theMessageIsConfiguredWithTheFollowing()
      | generators                                                                      | metadata                                  |
      | JSON: { "metadata": { "ID": { "type": "RandomInt", "min": 0,  "max": 1000 } } } | { "ID": "sjhdjkshsdjh", "weight": 100.5 } |
Caught panic with error: iter past the end of metadata
Caught panic with error: iter past the end of messages
Caught panic with error: iter past the end of messages
Caught panic with error: iter past the end of messages
Caught panic with error: iter past the end of messages
Caught panic with error: iter past the end of messages
    When the message is successfully processed                                     # PhpPactTest\CompatibilitySuite\Context\V3\Message\ConsumerContext::theMessageIsSuccessfullyProcessed()
    Then the received message metadata will contain "weight" == "JSON: 100.5"      # PhpPactTest\CompatibilitySuite\Context\V3\Message\ConsumerContext::theReceivedMessageMetadataWillContain()
    And the received message metadata will contain "ID" replaced with an "integer" # PhpPactTest\CompatibilitySuite\Context\V3\Message\ConsumerContext::theReceivedMessageMetadataWillContainReplacedWithAn()

1 scenario (1 passed)
5 steps (5 passed)
0m0.05s (13.76Mb)

But when I start debugging in PHP using XDebug, the code stop working:

@message
Feature: Message consumer
  Supports V3 message consumer interactions

  Scenario: Supports the use of generators with message metadata                   # compatibility-suite/pact-compatibility-suite/features/V3/message_consumer.feature:71
    Given a message integration is being defined for a consumer test               # PhpPactTest\CompatibilitySuite\Context\V3\Message\ConsumerContext::aMessageIntegrationIsBeingDefinedForAConsumerTest()
    And the message is configured with the following:                              # PhpPactTest\CompatibilitySuite\Context\V3\Message\ConsumerContext::theMessageIsConfiguredWithTheFollowing()
      | generators                                                                      | metadata                                  |
      | JSON: { "metadata": { "ID": { "type": "RandomInt", "min": 0,  "max": 1000 } } } | { "ID": "sjhdjkshsdjh", "weight": 100.5 } |
fish: Job 1, 'vendor/bin/behat compatibility-…' terminated by signal SIGSEGV (Address boundary error)
@tienvx tienvx changed the title Iterator past the end panics "Iterator past the end ..." panics Nov 21, 2023
@rholshausen
Copy link
Contributor

Hmm, printing that panic message is not helpful. It does that when it gets to the end of the iteration.

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