Skip to content

fix: move the Windows C++ redistributable warning so it is only shown if there is an actual access violation#6508

Merged
petebacondarwin merged 1 commit intomainfrom
better-access-violation-warnings
Aug 16, 2024
Merged

fix: move the Windows C++ redistributable warning so it is only shown if there is an actual access violation#6508
petebacondarwin merged 1 commit intomainfrom
better-access-violation-warnings

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

What this PR solves / how to test

Replaces #6471, which was too verbose.

Fixes #6170

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Included
    • Not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required / Maybe required
    • Not required because:
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Included
    • Not necessary because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Not necessary because: bug fix

@petebacondarwin petebacondarwin requested a review from a team as a code owner August 16, 2024 12:09
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 16, 2024

🦋 Changeset detected

Latest commit: aef71c3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@petebacondarwin petebacondarwin added the e2e Run wrangler + vite-plugin e2e tests on a PR label Aug 16, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 16, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-wrangler-6508

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6508/npm-package-wrangler-6508

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-wrangler-6508 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-create-cloudflare-6508 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-cloudflare-kv-asset-handler-6508
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-miniflare-6508
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-cloudflare-pages-shared-6508
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-cloudflare-vitest-pool-workers-6508
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-cloudflare-workers-editor-shared-6508
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10419848511/npm-package-cloudflare-workers-shared-6508

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.72.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240806.1
workerd 1.20240806.0 1.20240806.0
workerd --version 1.20240806.0 2024-08-06

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

… if there is an actual access violation

Replaces #6471, which was too verbose.

Fixes #6170
@petebacondarwin petebacondarwin force-pushed the better-access-violation-warnings branch from 57d464f to aef71c3 Compare August 16, 2024 12:23
return /CODE_MOVED for unknown code block/.test(chunk);
},
isAccessViolation(chunk: string) {
return chunk.includes("access violation;");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be a bit more specific here

Suggested change
return chunk.includes("access violation;");
return /Received structured exception .+? access violation;/.test(chunk);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about making it more strict but I am more concerned about false negatives than false positives in this case. And making it too strict might mean that we miss this going forward if the messaging changes slightly.
This check is already gated on there being a stack trace which implies a catastrophic workerd error already.

Comment on lines -786 to +807
logger.debug(chunk);
else {
logger.debug(chunk);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intended to make sure we never forget to log to the debug stream.

nit but now we have to remember to call logger.debug(chunk) in every branch added above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I realise that was the case. But actually the way the code was laid out (especially with the IGNORABLE comment it wasn't immediately apparent that this logger.debug() would be called for all branches above, which is actually probably why we had the comment to explain that we were falling out of the branch above in the first place.

I think it is reasoanable for each case to decide whether or not it wants to also log the original error.

@petebacondarwin petebacondarwin merged commit 56a3de2 into main Aug 16, 2024
@petebacondarwin petebacondarwin deleted the better-access-violation-warnings branch August 16, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run wrangler + vite-plugin e2e tests on a PR

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

🐛 BUG: Received structured exception #0xc0000005: access violation;

3 participants