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

HTMLRewriter: segfault when reusing a rewriter #7827

Closed
georgpukk opened this issue Dec 25, 2023 · 0 comments · Fixed by #7858
Closed

HTMLRewriter: segfault when reusing a rewriter #7827

georgpukk opened this issue Dec 25, 2023 · 0 comments · Fixed by #7858
Labels
bug Something isn't working crash An issue that could cause a crash

Comments

@georgpukk
Copy link

What version of Bun is running?

1.0.20+09d51486e

What platform is your computer?

Darwin 23.2.0 arm64 arm

What steps can reproduce the bug?

const rewriter = new HTMLRewriter().on('p', {
	element(element) {
		console.log(element.tagName)
	}
})

const content = '<p>Lorem ipsum!</p>'

rewriter.transform(new Response(content))
rewriter.transform(new Response(content))

What is the expected behavior?

p
p

What do you see instead?

p
segmentation fault

Additional information

Worked fine in previous Bun versions.

@georgpukk georgpukk added the bug Something isn't working label Dec 25, 2023
@Electroid Electroid added the crash An issue that could cause a crash label Dec 25, 2023
Jarred-Sumner added a commit that referenced this issue Dec 27, 2023
Jarred-Sumner added a commit that referenced this issue Dec 28, 2023
* Fixes #7827

* Add some assertions and errors

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
ryoppippi pushed a commit to ryoppippi/bun that referenced this issue Feb 1, 2024
* Fixes oven-sh#7827

* Add some assertions and errors

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash An issue that could cause a crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants