Proposal: Inclusion of source file hashes in stack traces

45 views
Skip to first unread message

Rob Paveza

unread,
Oct 18, 2021, 6:35:52 PM10/18/21
to v8-...@googlegroups.com

Hello v8-dev:

 

I haven’t contributed to this group before. I’m Rob, an engineer on Microsoft Edge DevTools, and we’d like to offer a change to V8 which might improve developers’ abilities to work through post-hoc debugging scenarios. The explainer can be found here, but the long and short of it is: we would like to extend the printed stack trace from Error#stack to include a hex-formatted SHA-256 hash for each source. In principle, this should allow developers to index source maps similarly to how symbols are indexed for C++ code. Web applications can opt into this feature, once the feature is enabled, by setting Error.stackTraceSourceHash = true at runtime.

 

Developers have attempted to handle these issues in many ways over the years. A few that come to mind include:

  • Including a CRC or similar hash in the filename, e.g., index.c812abbc.js
  • As a variation of the above, including a build timestamp in the filename
  • Including the exact version of the application alongside error reports and indexing source maps by that version (at one point I used an Ionic service which did this)

 

However, this was all accomplished without having any specific runtime support. We believe that adding this runtime support will add more flexibility for developers.

 

The implementation here uses code from the Omaha Installer project as noted in sha-256.h for the hash computation.

 

Thanks,

Rob Paveza

 

Rob Paveza

unread,
Oct 20, 2021, 1:55:28 PM10/20/21
to v8-...@googlegroups.com

Hello v8-dev:

 

To expand the ability of the audience to leave comments easily, I’ve copied the content of the explainer into a Google doc. I’ll back-port any changes into the original explainer as we go.

 

Thanks,

Rob Paveza

Reply all
Reply to author
Forward
0 new messages