-
-
Notifications
You must be signed in to change notification settings - Fork 16.9k
Сompiler can't remove panic locations if they are not used in panic handler #129330
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-panicArea: Panicking machineryArea: Panicking machineryC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-panicArea: Panicking machineryArea: Panicking machineryC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Code
Code is minimized as much as possible and here is a demo repository: https://github.com/StackOverflowExcept1on/rust-regression
program- this is smart contract that panics and terminates with an errorproject- some intermediate directory that is generated by our utilitygit clone https://github.com/StackOverflowExcept1on/rust-regression.git cd rust-regression/project ./check.shI expected to see this happen:
/home/user/...removed from wasmInstead, this happened:
/home/user/...is not removed from wasmWe want
/home/user/...to always be removed from smart contracts, otherwise it reveals some information about creator name and also increases cost of uploading to blockchain. We tried using--remap-path-prefix, but it results in longer build times. On the old version, rustc compiler was so smart that it figured out how to remove all panic locations from the binary file.Maybe related to #115974, but I haven't checked every commit. Although it is worth noting that #115974 is very useful as we can get panic message and remove panic location in stable rust.
Version it worked on
It most recently worked on:
nightly-2024-06-12Version with regression
Starting from
nightly-2024-06-13, behavior has changed