P403n1x87 / austin

Python frame stack sampler for CPython
https://pypi.org/project/austin-dist/
GNU General Public License v3.0
1.71k stars 51 forks source link

fix: propagate signals to spawned process #201

Closed P403n1x87 closed 1 year ago

P403n1x87 commented 1 year ago

Description of the Change

When Austin is given a command to launch, we make sure that any termination signal that Austin receives is propagated to the spawned process to prevent it from running potentially indefinitely in the background.

Regressions

We don't expect any tools based on Austin to rely on the previous behaviour, so we do not expect any regressions.

Verification Process

This bug was caught with the austin-python test suite.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 72.72% and project coverage change: -0.09% :warning:

Comparison is base (7dbb39a) 68.38% compared to head (75246e4) 68.29%. Report is 1 commits behind head on devel.

:exclamation: Current head 75246e4 differs from pull request most recent head ce3c2de. Consider uploading reports for the commit ce3c2de to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## devel #201 +/- ## ========================================== - Coverage 68.38% 68.29% -0.09% ========================================== Files 27 27 Lines 2508 2514 +6 Branches 766 769 +3 ========================================== + Hits 1715 1717 +2 - Misses 461 464 +3 - Partials 332 333 +1 ``` | [Files Changed](https://app.codecov.io/gh/P403n1x87/austin/pull/201?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Gabriele+N.+Tornetta) | Coverage Δ | | |---|---|---| | [src/austin.c](https://app.codecov.io/gh/P403n1x87/austin/pull/201?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Gabriele+N.+Tornetta#diff-c3JjL2F1c3Rpbi5j) | `67.98% <50.00%> (-0.87%)` | :arrow_down: | | [src/py\_proc.c](https://app.codecov.io/gh/P403n1x87/austin/pull/201?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Gabriele+N.+Tornetta#diff-c3JjL3B5X3Byb2MuYw==) | `65.58% <100.00%> (+0.86%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/P403n1x87/austin/pull/201/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Gabriele+N.+Tornetta)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 year ago

Austin Benchmarks

Running Austin benchmarks with Python 3.10.13

Benchmark Summary

Comparison of dev against 3.5.0.

The following scenarios show a statistically significant difference in performance between the two versions.

Sample Rate Saturation Error Rate Sampling Speed
RSA keygen [sampling interval: 1] :green_circle: :yellow_circle: :yellow_circle: :green_circle:
Full metrics [sampling interval: 1] :yellow_circle: :yellow_circle: :green_circle: :yellow_circle:
Multiprocess wall time [sampling interval: 1] :red_circle: :yellow_circle: :yellow_circle: :red_circle:
Multiprocess wall time [sampling interval: 10] :red_circle: :yellow_circle: :yellow_circle: :red_circle:

Benchmark Results

Wall time [sampling interval: 1] ## Wall time [sampling interval: 1] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 113000 ± 9000 | 1 ± 0 | 1.3e-05 ± 5e-06 | 14 ± 1 | | 3.5.0 | 117000 ± 6000 | 1 ± 0 | 1e-05 ± 4e-06 | 13.3 ± 0.8 | | dev | 115000 ± 6000 | 1 ± 0 | 1.2e-05 ± 4e-06 | 13.6 ± 0.7 |
Wall time [sampling interval: 10] ## Wall time [sampling interval: 10] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 112000 ± 8000 | 0.543 ± 0.002 | 1.2e-05 ± 5e-06 | 14 ± 1 | | 3.5.0 | 110000 ± 7000 | 0.544 ± 0.003 | 8e-06 ± 5e-06 | 13.9 ± 1.0 | | dev | 108000 ± 8000 | 0.544 ± 0.002 | 1e-05 ± 5e-06 | 14 ± 1 |
Wall time [sampling interval: 100] ## Wall time [sampling interval: 100] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 10200 ± 400 | 0.0007 ± 0.0001 | 2e-05 ± 2e-05 | 14.4 ± 0.5 | | 3.5.0 | 10200 ± 500 | 0.0008 ± 0.0002 | 4e-05 ± 4e-05 | 14.6 ± 0.5 | | dev | 10400 ± 600 | 0.0009 ± 0.0002 | 4e-05 ± 4e-05 | 14.3 ± 0.7 |
Wall time [sampling interval: 1000] ## Wall time [sampling interval: 1000] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 1850 ± 20 | 0.0001 ± 0.0002 | 0.0001 ± 0.0001 | 18.0 ± 0.8 | | 3.5.0 | 1860 ± 20 | 0.0002 ± 0.0003 | 0.0001 ± 0.0002 | 18 ± 1 | | dev | 1860 ± 20 | 0.0001 ± 0.0002 | 0 ± 0 | 18.3 ± 0.8 |
CPU time [sampling interval: 1] ## CPU time [sampling interval: 1] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 51000 ± 6000 | 1 ± 0 | 2e-05 ± 1e-05 | 23 ± 2 | | 3.5.0 | 47000 ± 5000 | 1 ± 0 | 1.8e-05 ± 9e-06 | 24 ± 2 | | dev | 51000 ± 5000 | 1 ± 0 | 1.1e-05 ± 9e-06 | 23 ± 1 |
CPU time [sampling interval: 10] ## CPU time [sampling interval: 10] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 52000 ± 4000 | 0.9976 ± 0.0002 | 1.6e-05 ± 9e-06 | 22 ± 1 | | 3.5.0 | 50000 ± 5000 | 0.9975 ± 0.0002 | 1.9e-05 ± 9e-06 | 23 ± 1 | | dev | 50000 ± 5000 | 0.997 ± 0.002 | 1.2e-05 ± 7e-06 | 23 ± 1 |
CPU time [sampling interval: 100] ## CPU time [sampling interval: 100] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 5300 ± 100 | 0.001 ± 0.0002 | 7e-05 ± 8e-05 | 21.6 ± 0.5 | | 3.5.0 | 5400 ± 200 | 0.0009 ± 0.0002 | 0.00011 ± 9e-05 | 21.7 ± 0.7 | | dev | 5320 ± 100 | 0.0011 ± 0.0004 | 4e-05 ± 6e-05 | 21.8 ± 0.4 |
CPU time [sampling interval: 1000] ## CPU time [sampling interval: 1000] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 948 ± 3 | 0.0003 ± 0.0005 | 0.0001 ± 0.0002 | 27 ± 2 | | 3.5.0 | 951 ± 3 | 0.0002 ± 0.0003 | 0.0 ± 0.0001 | 26.1 ± 1.0 | | dev | 950 ± 2 | 0.0003 ± 0.0005 | 0.0002 ± 0.0003 | 27 ± 2 |
RSA keygen [sampling interval: 1] ## RSA keygen [sampling interval: 1] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 41000 ± 1000 | 1 ± 0 | 0.0002 ± 0.0002 | 23.6 ± 0.7 | | 3.5.0 | 40000 ± 1000 | 1 ± 0 | 0.0002 ± 0.0001 | 24.1 ± 0.3 | | dev | 41000 ± 1000 | 1 ± 0 | 0.0002 ± 0.0001 | 23.7 ± 0.5 |
RSA keygen [sampling interval: 10] ## RSA keygen [sampling interval: 10] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 39000 ± 6000 | 0.98 ± 0.01 | 0.0003 ± 0.0004 | 26 ± 7 | | 3.5.0 | 40100 ± 600 | 0.99 ± 0.01 | 0.0002 ± 0.0003 | 24.2 ± 0.4 | | dev | 40400 ± 800 | 0.98 ± 0.01 | 0.0002 ± 0.0001 | 24.1 ± 0.6 |
RSA keygen [sampling interval: 100] ## RSA keygen [sampling interval: 100] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 6270 ± 40 | 0.002 ± 0.001 | 0.0004 ± 0.0004 | 28 ± 1 | | 3.5.0 | 6270 ± 60 | 0.002 ± 0.001 | 0.0007 ± 0.0009 | 28 ± 2 | | dev | 6230 ± 90 | 0.002 ± 0.002 | 0.0005 ± 0.0005 | 29 ± 1 |
RSA keygen [sampling interval: 1000] ## RSA keygen [sampling interval: 1000] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 942 ± 3 | 0 ± 0 | 0.001 ± 0.001 | 30 ± 1 | | 3.5.0 | 943 ± 2 | 0 ± 0 | 0.0002 ± 0.0006 | 30 ± 1 | | dev | 943 ± 2 | 0 ± 0 | 0.0006 ± 0.001 | 31 ± 1 |
Full metrics [sampling interval: 1] ## Full metrics [sampling interval: 1] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 51000 ± 2000 | 1 ± 0 | 3e-05 ± 1e-05 | 30 ± 2 | | 3.5.0 | 50000 ± 3000 | 1 ± 0 | 3e-05 ± 1e-05 | 31 ± 2 | | dev | 51000 ± 2000 | 1 ± 0 | 1.8e-05 ± 8e-06 | 30 ± 1 |
Full metrics [sampling interval: 10] ## Full metrics [sampling interval: 10] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 51000 ± 2000 | 1 ± 0 | 3e-05 ± 2e-05 | 31 ± 2 | | 3.5.0 | 51000 ± 2000 | 1 ± 0 | 2.5e-05 ± 9e-06 | 30 ± 2 | | dev | 52000 ± 2000 | 1 ± 0 | 2.4e-05 ± 1e-05 | 29.5 ± 0.7 |
Full metrics [sampling interval: 100] ## Full metrics [sampling interval: 100] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 9900 ± 200 | 0.0017 ± 0.0007 | 0.0003 ± 0.0008 | 31.9 ± 0.6 | | 3.5.0 | 9800 ± 100 | 0.0019 ± 0.0009 | 5e-05 ± 3e-05 | 32.3 ± 0.8 | | dev | 9800 ± 300 | 0.0015 ± 0.0003 | 3e-05 ± 4e-05 | 31.9 ± 0.7 |
Full metrics [sampling interval: 1000] ## Full metrics [sampling interval: 1000] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 1860 ± 20 | 0.0002 ± 0.0002 | 2e-05 ± 7e-05 | 37.6 ± 1.0 | | 3.5.0 | 1870 ± 20 | 0.0001 ± 0.0002 | 0.0001 ± 0.0002 | 37.6 ± 0.5 | | dev | 1860 ± 20 | 0.0002 ± 0.0003 | 0.0001 ± 0.0002 | 37.6 ± 1.0 |
Multiprocess wall time [sampling interval: 1] ## Multiprocess wall time [sampling interval: 1] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 3100 ± 200 | 1 ± 0 | 0.00014 ± 4e-05 | 300 ± 10 | | 3.5.0 | 3600 ± 200 | 1 ± 0 | 0.00014 ± 4e-05 | 270 ± 20 | | dev | 3400 ± 200 | 1 ± 0 | 0.00014 ± 3e-05 | 280 ± 10 |
Multiprocess wall time [sampling interval: 10] ## Multiprocess wall time [sampling interval: 10] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 3200 ± 100 | 1 ± 0 | 0.0002 ± 0.0002 | 290 ± 10 | | 3.5.0 | 3400 ± 400 | 1 ± 0 | 0.00013 ± 3e-05 | 280 ± 30 | | dev | 3000 ± 100 | 1 ± 0 | 0.00016 ± 4e-05 | 310 ± 10 |
Multiprocess wall time [sampling interval: 100] ## Multiprocess wall time [sampling interval: 100] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 2700 ± 200 | 0.05 ± 0.01 | 0.00012 ± 3e-05 | 340 ± 20 | | 3.5.0 | 3300 ± 200 | 0.05 ± 0.02 | 7e-05 ± 2e-05 | 290 ± 20 | | dev | 3400 ± 200 | 0.05 ± 0.02 | 6e-05 ± 6e-05 | 280 ± 10 |
Multiprocess wall time [sampling interval: 1000] ## Multiprocess wall time [sampling interval: 1000] | | Sample Rate | Saturation | Error Rate | Sampling Speed | | --- |:-----------:|:----------:|:----------:|:--------------:| | 3.4.1 | 2700 ± 100 | 0.015 ± 0.002 | 3e-05 ± 3e-05 | 110 ± 10 | | 3.5.0 | 3200 ± 100 | 0.005 ± 0.002 | 3e-05 ± 3e-05 | 57 ± 9 | | dev | 3200 ± 200 | 0.005 ± 0.002 | 1e-05 ± 1e-05 | 54 ± 8 |