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

Error messages are garbled and truncated in firefox console log #4459

Closed
glalonde opened this issue Jan 22, 2022 · 5 comments
Closed

Error messages are garbled and truncated in firefox console log #4459

glalonde opened this issue Jan 22, 2022 · 5 comments
Labels
naga Shader Translator type: bug Something isn't working

Comments

@glalonde
Copy link
Contributor

image

Not sure if this is a naga issue or something with my console_log setup, but it looks like it is naga. The truncation is the frustrating part.

@jimblandy
Copy link
Member

I think part of the problem is here: https://github.com/gfx-rs/wgpu/blob/master/wgpu-core/src/pipeline.rs#L84

The implementation of std::fmt::Display for ShaderError is using ANSI color escape codes by default. The Firefox console isn't prepared for that. wgpu-core should somehow let its user indicate whether color is appropriate, and Firefox should decline.

The truncation is probably an arbitrary limit imposed somewhere to prevent denial-of-service attacks. Removing the escape codes will reduce the length of the message, but now that Naga produces more detailed error messages in general (with the span feature), we may need to simply raise the limit to accommodate the new typical error message length.

@kvark
Copy link
Member

kvark commented Jan 22, 2022

What firefox version is this? At least truncation is something I fixed a few weeks ago.

@glalonde
Copy link
Contributor Author

I think it was a nightly build from 1/03/22? updated it to get around the error, so I'm not sure anymore.

@kvark
Copy link
Member

kvark commented Jan 24, 2022

hmm, the fix I'm thinking was done much earlier - https://hg.mozilla.org/mozilla-central/rev/469124ce89e9

@cwfitzgerald cwfitzgerald transferred this issue from gfx-rs/naga Oct 25, 2023
@cwfitzgerald cwfitzgerald added naga Shader Translator type: bug Something isn't working and removed kind: bug labels Oct 25, 2023
@teoxoy
Copy link
Member

teoxoy commented Nov 3, 2023

#3591 fixed the ANSI color escape codes being embedded in the messages.

Let's track further improvements in #4494.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
naga Shader Translator type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants