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

File details gets stripped out of call stack in Linux and Mac while logging error telemetry #12694

Closed
ramya-rao-a opened this issue Sep 26, 2016 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@ramya-rao-a
Copy link
Contributor

Linux/Mac:

TypeError: Cannot read property 'length' of null
at t.i.getLinesContent (
at t.i.toRawText (
at t._beginModelSync (
at t.esureSyncedResources (
at
at then (
at t._withSyncedResources (
at t.computeDirtyDiff (
at
at then (

Windows:

TypeError: Cannot read property 'length' of null
at t.i.getLinesContent (out/vs/workbench/workbench.main.js:56:3263)
at t.i.toRawText (out/vs/workbench/workbench.main.js:55:31077)
at t._beginModelSync (out/vs/workbench/workbench.main.js:58:1255)
at t.esureSyncedResources (out/vs/workbench/workbench.main.js:58:726)
at out/vs/workbench/workbench.main.js:58:3183
at then (out/vs/workbench/workbench.main.js:31:14808)
at t._withSyncedResources (out/vs/workbench/workbench.main.js:58:3129)
at t.computeDirtyDiff (out/vs/workbench/workbench.main.js:58:3419)
at out/vs/workbench/workbench.main.js:57:30943
at then (out/vs/workbench/workbench.main.js:31:14808)

@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented Nov 2, 2016

Root cause:
The telemetry service strips PII of of callstacks before logging them as a telemetry event.
Following regex matches are used in the process

  • the app root (eg: /Users/me/Downloads/Visual Studio Code/.app/Contents/Resources/app)
  • the extensions folder (eg: /Users/me/.vscode/extensions)
  • /file:///.*?/resources/app//gi
  • /file:///.*/gi

A sample call stack is as follows:

TypeError: Cannot read property 'length' of null
at t.i.getLinesContent (files:////Users/me/Downloads/Visual Studio Code/.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:56:3263)
at t.i.toRawText (files:////Users/me/Downloads/Visual Studio Code/.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:55:31077)
........

After the first regex replace, we have

TypeError: Cannot read property 'length' of null
at t.i.getLinesContent (files:////out/vs/workbench/workbench.main.js:56:3263)
at t.i.toRawText (files:////out/vs/workbench/workbench.main.js:55:31077)
........

Second and Third in this case do not have any net change

The Fourth regex replace removes the important filepath info leaving us with

TypeError: Cannot read property 'length' of null
at t.i.getLinesContent (
at t.i.toRawText (
........

This doesn't happen in Windows because the first regex never gets any match due to conflicts between forward and back slashes, the third regex does the real job of stripping out PII along with the files:/// prefix

The unit tests didnt catch this because only the last 2 regex get applied by default. The first 2 are passed as config which is done by production code but not the unit tests.

So we just got lucky.

Errors from extensions do not have this problem, they don't have the files:/// prefix

@jrieken jrieken closed this as completed in e81d70a Nov 7, 2016
jrieken added a commit that referenced this issue Nov 7, 2016
Fixes #12694 regex replace strips filepath when approot is PIIPath
@ramya-rao-a ramya-rao-a added the bug Issue identified by VS Code Team member as probable bug label Nov 7, 2016
@ramya-rao-a ramya-rao-a added this to the November 2016 milestone Nov 7, 2016
@ramya-rao-a ramya-rao-a added the verified Verification succeeded label Dec 8, 2016
@egamma egamma mentioned this issue Dec 20, 2016
56 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

1 participant