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

Bug 1631506 - Add some more fields from crash annotations #546

Merged
merged 4 commits into from
May 12, 2020

Conversation

wlach
Copy link
Contributor

@wlach wlach commented May 11, 2020

Also add a small script, extract_crash_annotation_fields for
automatically grabbing this type of information in the future.

Checklist for reviewer:

  • Commits should reference a bug or github issue, if relevant (if a bug is referenced, the pull request should include the bug number in the title)
  • Scan the PR and verify that no changes (particularly to .circleci/config.yml) will cause environment variables (particularly credentials) to be exposed in test logs
  • If the PR comes from a fork, trigger the integration CI test by pushing this revision as discussed in the README and review the report posted in the comments.

For glean changes:

  • Update include/glean/CHANGELOG.md

@auto-assign auto-assign bot requested a review from relud May 11, 2020 20:50
@dataops-ci-bot
Copy link

Integration report for "Bug 1631506 - Add some more fields from crash annotations"

Report for upstream
Report for latest commit

175795c-c77cdd6.diff

No content detected.

bq_schema_175795c-c77cdd6.diff

Click to expand!
Only in integration/175795c: pioneer-debug.debug.1.bq
diff integration/175795c/telemetry.crash.4.bq integration/c77cdd6/telemetry.crash.4.bq
1434a1435,1440
>             "description": "Amount of free swap space in bytes. - Under macOS, populated with the contents of\n  sysctl \"vm.swapusage\" :: xsu_avail.\n- Under Linux, populated with /proc/meminfo's SwapFree. - Not available on other platforms.",
>             "mode": "NULLABLE",
>             "name": "available_swap_memory",
>             "type": "STRING"
>           },
>           {
1470a1477,1482
>             "description": "Set to 1 when DOM fission is enabled, and subframes are potentially loaded in a separate process.",
>             "mode": "NULLABLE",
>             "name": "dom_fission_enabled",
>             "type": "BOOL"
>           },
>           {
1476a1489,1494
>             "description": "This annotation is present if IndexedDB shutdown was not finished in time and the browser was crashed instead of waiting for IndexedDB shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked IndexedDB shutdown. Objects are divided into three groups: FactoryOperations, LiveDatabases and DatabaseMaintenances. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "indexed_db_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1488a1507,1512
>             "description": "This annotation is present if LocalStorage shutdown was not finished in time and the browser was crashed instead of waiting for LocalStorage shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked LocalStorage shutdown. Objects are divided into three groups: PrepareDatastoreOperations, Datastores and LiveDatabases. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "local_storage_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1494a1519,1524
>             "description": "Name of the currently executing nsIRunnable on the main thread.",
>             "mode": "NULLABLE",
>             "name": "main_thread_runnable_name",
>             "type": "STRING"
>           },
>           {
1524a1555,1560
>             "description": "macOS only. Amount of physical memory currently allocated but which may be deallocated by the system in case of memory pressure. Populated from vm_statistics64_data_t::purgeable_count * vm_page_size.",
>             "mode": "NULLABLE",
>             "name": "purgeable_physical_memory",
>             "type": "STRING"
>           },
>           {
1708,1729d1743
<               {
<                 "fields": [
<                   {
<                     "mode": "NULLABLE",
<                     "name": "ip",
<                     "type": "STRING"
<                   },
<                   {
<                     "mode": "NULLABLE",
<                     "name": "module_index",
<                     "type": "INT64"
<                   },
<                   {
<                     "mode": "NULLABLE",
<                     "name": "trust",
<                     "type": "STRING"
<                   }
<                 ],
<                 "mode": "REPEATED",
<                 "name": "frames",
<                 "type": "RECORD"
<               },
Only in integration/175795c: telemetry.installation.1.bq

@wlach wlach force-pushed the Bug-1631506-missing-crash-fields branch from c77cdd6 to 2c2d351 Compare May 11, 2020 20:57
@wlach wlach requested a review from acmiyaguchi May 11, 2020 21:00
@wlach
Copy link
Contributor Author

wlach commented May 11, 2020

I wouldn't mind getting @acmiyaguchi to look at this one, since he's handled this type of case before. Would welcome @relud's opinion on some of the overly-long description fields in this schema though -- not sure how those will translate to e.g. bigquery's schema browser (some of them have e.g. newlines)

@dataops-ci-bot
Copy link

Integration report for "Bug 1631506 - Add some more fields from crash annotations"

Report for upstream
Report for latest commit

175795c-2c2d351.diff

No content detected.

bq_schema_175795c-2c2d351.diff

Click to expand!
diff integration/175795c/telemetry.crash.4.bq integration/2c2d351/telemetry.crash.4.bq
1434a1435,1440
>             "description": "Amount of free swap space in bytes. - Under macOS, populated with the contents of\n  sysctl \"vm.swapusage\" :: xsu_avail.\n- Under Linux, populated with /proc/meminfo's SwapFree. - Not available on other platforms.",
>             "mode": "NULLABLE",
>             "name": "available_swap_memory",
>             "type": "STRING"
>           },
>           {
1470a1477,1482
>             "description": "Set to 1 when DOM fission is enabled, and subframes are potentially loaded in a separate process.",
>             "mode": "NULLABLE",
>             "name": "dom_fission_enabled",
>             "type": "BOOL"
>           },
>           {
1476a1489,1494
>             "description": "This annotation is present if IndexedDB shutdown was not finished in time and the browser was crashed instead of waiting for IndexedDB shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked IndexedDB shutdown. Objects are divided into three groups: FactoryOperations, LiveDatabases and DatabaseMaintenances. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "indexed_db_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1488a1507,1512
>             "description": "This annotation is present if LocalStorage shutdown was not finished in time and the browser was crashed instead of waiting for LocalStorage shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked LocalStorage shutdown. Objects are divided into three groups: PrepareDatastoreOperations, Datastores and LiveDatabases. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "local_storage_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1494a1519,1524
>             "description": "Name of the currently executing nsIRunnable on the main thread.",
>             "mode": "NULLABLE",
>             "name": "main_thread_runnable_name",
>             "type": "STRING"
>           },
>           {
1521a1552,1557
>             "type": "STRING"
>           },
>           {
>             "description": "macOS only. Amount of physical memory currently allocated but which may be deallocated by the system in case of memory pressure. Populated from vm_statistics64_data_t::purgeable_count * vm_page_size.",
>             "mode": "NULLABLE",
>             "name": "purgeable_physical_memory",

@relud
Copy link
Member

relud commented May 11, 2020

Would welcome @relud's opinion on some of the overly-long description fields in this schema though -- not sure how those will translate to e.g. bigquery's schema browser (some of them have e.g. newlines)

looks like the console's schema browser just renders any group of whitespace as a single space:

# bq show --schema relud-17123:test.test_desc | jq .
[
  {
    "type": "STRING",
    "name": "field1",
    "description": "<levels>, Optional, present only if >0,\n\nstuff in another couple lines\nthat spans it's own two lines."
  }
]

image

@relud relud removed their request for review May 11, 2020 21:29
scripts/extract_crash_annotation_fields Outdated Show resolved Hide resolved
@@ -1296,18 +1300,34 @@
"description": "<time>, Seconds since the Epoch (see also: `payload.crashTime`)",
"type": "string"
},
"DOMFissionEnabled": {
"description": "Set to 1 when DOM fission is enabled, and subframes are potentially loaded in a separate process.",
"type": "boolean"
Copy link
Contributor

Choose a reason for hiding this comment

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

I have reason to believe this is not the correct type, and that all types within the metadata field should be a string. Let me put together a query to confirm this.

Copy link
Contributor

@acmiyaguchi acmiyaguchi left a comment

Choose a reason for hiding this comment

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

All of the types reported by payload.metadata should be a string, as per this query: https://sql.telemetry.mozilla.org/queries/71019/source. If you extract the value on DOMFissionEnabled, the values within are actually integers (1/0), and not booleans (true/false), so this would cause an increase in validation errors.

Adding the original type to the description would be helpful as a prefix e.g.[{type}]: {description}.

@dataops-ci-bot
Copy link

Integration report for "Update scripts/extract_crash_annotation_fields"

Report for upstream
Report for latest commit

175795c-f2e601b.diff

No content detected.

bq_schema_175795c-f2e601b.diff

Click to expand!
diff integration/175795c/telemetry.crash.4.bq integration/f2e601b/telemetry.crash.4.bq
1434a1435,1440
>             "description": "Amount of free swap space in bytes. - Under macOS, populated with the contents of\n  sysctl \"vm.swapusage\" :: xsu_avail.\n- Under Linux, populated with /proc/meminfo's SwapFree. - Not available on other platforms.",
>             "mode": "NULLABLE",
>             "name": "available_swap_memory",
>             "type": "STRING"
>           },
>           {
1470a1477,1482
>             "description": "Set to 1 when DOM fission is enabled, and subframes are potentially loaded in a separate process.",
>             "mode": "NULLABLE",
>             "name": "dom_fission_enabled",
>             "type": "BOOL"
>           },
>           {
1476a1489,1494
>             "description": "This annotation is present if IndexedDB shutdown was not finished in time and the browser was crashed instead of waiting for IndexedDB shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked IndexedDB shutdown. Objects are divided into three groups: FactoryOperations, LiveDatabases and DatabaseMaintenances. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "indexed_db_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1488a1507,1512
>             "description": "This annotation is present if LocalStorage shutdown was not finished in time and the browser was crashed instead of waiting for LocalStorage shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked LocalStorage shutdown. Objects are divided into three groups: PrepareDatastoreOperations, Datastores and LiveDatabases. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "local_storage_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1494a1519,1524
>             "description": "Name of the currently executing nsIRunnable on the main thread.",
>             "mode": "NULLABLE",
>             "name": "main_thread_runnable_name",
>             "type": "STRING"
>           },
>           {
1521a1552,1557
>             "type": "STRING"
>           },
>           {
>             "description": "macOS only. Amount of physical memory currently allocated but which may be deallocated by the system in case of memory pressure. Populated from vm_statistics64_data_t::purgeable_count * vm_page_size.",
>             "mode": "NULLABLE",
>             "name": "purgeable_physical_memory",

wlach and others added 3 commits May 12, 2020 10:54
Also add a small script, extract_crash_annotation_fields for
automatically grabbing this type of information in the future.
Co-authored-by: Anthony Miyaguchi <acmiyaguchi@gmail.com>
@wlach wlach force-pushed the Bug-1631506-missing-crash-fields branch from f2e601b to aa03913 Compare May 12, 2020 14:54
@wlach
Copy link
Contributor Author

wlach commented May 12, 2020

Thanks @acmiyaguchi! Great suggestions and good catch on the types. I've updated both the generation script and the schemas per your suggestions

@wlach wlach requested a review from acmiyaguchi May 12, 2020 14:55
@@ -1272,6 +1272,10 @@
"description": "<size>, Windows-only, available physical memory in bytes",
"type": "string"
},
"AvailableSwapMemory": {
"description": "<size>, Amount of free swap space in bytes. - Under macOS, populated with the contents of\n sysctl \"vm.swapusage\" :: xsu_avail.\n- Under Linux, populated with /proc/meminfo's SwapFree. - Not available on other platforms.",
Copy link
Contributor Author

@wlach wlach May 12, 2020

Choose a reason for hiding this comment

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

I modified these from the output of my script to correspond with other fields of similar kind in the file.

@dataops-ci-bot
Copy link

Integration report for "Regenerate schemas"

Report for upstream
Report for latest commit

175795c-4c84770.diff

No content detected.

bq_schema_175795c-4c84770.diff

Click to expand!
diff integration/175795c/telemetry.crash.4.bq integration/4c84770/telemetry.crash.4.bq
1434a1435,1440
>             "description": "<size>, Amount of free swap space in bytes. - Under macOS, populated with the contents of\n  sysctl \"vm.swapusage\" :: xsu_avail.\n- Under Linux, populated with /proc/meminfo's SwapFree. - Not available on other platforms.",
>             "mode": "NULLABLE",
>             "name": "available_swap_memory",
>             "type": "STRING"
>           },
>           {
1470a1477,1482
>             "description": "<boolean>, Set to 1 when DOM fission is enabled, and subframes are potentially loaded in a separate process.",
>             "mode": "NULLABLE",
>             "name": "dom_fission_enabled",
>             "type": "STRING"
>           },
>           {
1476a1489,1494
>             "description": "<json>, This annotation is present if IndexedDB shutdown was not finished in time and the browser was crashed instead of waiting for IndexedDB shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked IndexedDB shutdown. Objects are divided into three groups: FactoryOperations, LiveDatabases and DatabaseMaintenances. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "indexed_db_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1488a1507,1512
>             "description": "<json>, This annotation is present if LocalStorage shutdown was not finished in time and the browser was crashed instead of waiting for LocalStorage shutdown to finish. The condition that caused the hang is contained in the annotation. The condition is constructed by stringifying status of objects which blocked LocalStorage shutdown. Objects are divided into three groups: PrepareDatastoreOperations, Datastores and LiveDatabases. Each group is reported separately and contains the number of objects in the group and status of individual objects in the group (duplicit entries are removed): \"GroupName: N (objectStatus1, objectStatus2, ...)\" where N is the number of objects in the group. Status of individual objects is constructed by taking selected object properties. Properties which contain origin strings are anonymized.",
>             "mode": "NULLABLE",
>             "name": "local_storage_shutdown_timeout",
>             "type": "STRING"
>           },
>           {
1494a1519,1524
>             "description": "<string>, Name of the currently executing nsIRunnable on the main thread.",
>             "mode": "NULLABLE",
>             "name": "main_thread_runnable_name",
>             "type": "STRING"
>           },
>           {
1521a1552,1557
>             "type": "STRING"
>           },
>           {
>             "description": "<size>, macOS only. Amount of physical memory currently allocated but which may be deallocated by the system in case of memory pressure. Populated from vm_statistics64_data_t::purgeable_count * vm_page_size.",
>             "mode": "NULLABLE",
>             "name": "purgeable_physical_memory",

Copy link
Contributor

@acmiyaguchi acmiyaguchi left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@wlach wlach merged commit 22ce6d8 into master May 12, 2020
@wlach wlach deleted the Bug-1631506-missing-crash-fields branch May 12, 2020 18:31
acmiyaguchi pushed a commit that referenced this pull request May 12, 2020
11d3fa2	2020-05-12 14:59:44 -0400	Optimize Dockerfile
22ce6d8	2020-05-12 14:31:31 -0400	Bug 1631506 - Add some more fields from crash annotations (#546)
dataops-pipeline-schemas added a commit that referenced this pull request May 13, 2020
0e9517a	2020-05-12 15:37:16 -0700	Bug 1636317 - Add metadata schema for Pioneer ingestion (#544)
2832433	2020-05-12 13:29:06 -0700	Update README.pioneer.md (#548)
11d3fa2	2020-05-12 14:59:44 -0400	Optimize Dockerfile
22ce6d8	2020-05-12 14:31:31 -0400	Bug 1631506 - Add some more fields from crash annotations (#546)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants