Commit 5291096
authored
bootstrap: check more metadata when loading the snapshot
This patch stores the metadata about the Node.js binary
into the SnapshotData and adds fields denoting how the
snapshot was generated, on what platform it was
generated as well as the V8 cached data version flag.
Instead of simply crashing when the metadata doesn't
match, Node.js now prints an error message and exit with
1 for the customized snapshot, or ignore the snapshot
and start from scratch if it's the default one.
PR-URL: #44132
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>1 parent b427924 commit 5291096Copy full SHA for 5291096
File tree
Expand file treeCollapse file tree
7 files changed
+260
-17
lines changedOpen diff view settings
Filter options
- doc/api
- src
- test/parallel
Expand file treeCollapse file tree
7 files changed
+260
-17
lines changedOpen diff view settings
Collapse file
+9Lines changed: 9 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1198 | 1198 | |
1199 | 1199 | |
1200 | 1200 | |
| 1201 | + |
| 1202 | + |
| 1203 | + |
| 1204 | + |
| 1205 | + |
| 1206 | + |
| 1207 | + |
| 1208 | + |
| 1209 | + |
1201 | 1210 | |
1202 | 1211 | |
1203 | 1212 | |
|
Collapse file
+15Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
261 | 261 | |
262 | 262 | |
263 | 263 | |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
264 | 279 | |
265 | 280 | |
266 | 281 | |
|
Collapse file
+19-1Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
984 | 984 | |
985 | 985 | |
986 | 986 | |
| 987 | + |
| 988 | + |
| 989 | + |
| 990 | + |
| 991 | + |
| 992 | + |
| 993 | + |
| 994 | + |
| 995 | + |
| 996 | + |
| 997 | + |
| 998 | + |
| 999 | + |
987 | 1000 | |
988 | 1001 | |
989 | 1002 | |
| ||
993 | 1006 | |
994 | 1007 | |
995 | 1008 | |
| 1009 | + |
| 1010 | + |
996 | 1011 | |
997 | 1012 | |
998 | 1013 | |
| ||
1009 | 1024 | |
1010 | 1025 | |
1011 | 1026 | |
1012 | | - |
| 1027 | + |
| 1028 | + |
| 1029 | + |
| 1030 | + |
1013 | 1031 | |
1014 | 1032 | |
1015 | 1033 | |
|
Collapse file
+12-2Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1254 | 1254 | |
1255 | 1255 | |
1256 | 1256 | |
1257 | | - |
| 1257 | + |
| 1258 | + |
| 1259 | + |
| 1260 | + |
| 1261 | + |
1258 | 1262 | |
1259 | 1263 | |
1260 | 1264 | |
1261 | 1265 | |
1262 | 1266 | |
1263 | | - |
| 1267 | + |
| 1268 | + |
| 1269 | + |
| 1270 | + |
| 1271 | + |
| 1272 | + |
| 1273 | + |
1264 | 1274 | |
1265 | 1275 | |
1266 | 1276 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
414 | 414 | |
415 | 415 | |
416 | 416 | |
| 417 | + |
417 | 418 | |
418 | 419 | |
419 | 420 | |
|
Collapse file
+128-14Lines changed: 128 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
679 | 679 | |
680 | 680 | |
681 | 681 | |
| 682 | + |
| 683 | + |
| 684 | + |
| 685 | + |
| 686 | + |
| 687 | + |
| 688 | + |
| 689 | + |
| 690 | + |
| 691 | + |
| 692 | + |
| 693 | + |
| 694 | + |
| 695 | + |
| 696 | + |
| 697 | + |
| 698 | + |
| 699 | + |
| 700 | + |
| 701 | + |
| 702 | + |
| 703 | + |
| 704 | + |
| 705 | + |
| 706 | + |
| 707 | + |
| 708 | + |
| 709 | + |
| 710 | + |
| 711 | + |
| 712 | + |
| 713 | + |
| 714 | + |
| 715 | + |
| 716 | + |
| 717 | + |
| 718 | + |
| 719 | + |
| 720 | + |
| 721 | + |
| 722 | + |
| 723 | + |
| 724 | + |
| 725 | + |
| 726 | + |
| 727 | + |
| 728 | + |
| 729 | + |
| 730 | + |
| 731 | + |
| 732 | + |
682 | 733 | |
683 | 734 | |
684 | 735 | |
| ||
695 | 746 | |
696 | 747 | |
697 | 748 | |
| 749 | + |
698 | 750 | |
699 | 751 | |
700 | 752 | |
701 | | - |
702 | | - |
703 | | - |
704 | | - |
| 753 | + |
| 754 | + |
705 | 755 | |
706 | 756 | |
707 | 757 | |
| ||
712 | 762 | |
713 | 763 | |
714 | 764 | |
715 | | - |
| 765 | + |
716 | 766 | |
717 | 767 | |
718 | 768 | |
| 769 | + |
| 770 | + |
719 | 771 | |
720 | 772 | |
721 | | - |
| 773 | + |
722 | 774 | |
723 | | - |
724 | | - |
725 | | - |
726 | | - |
727 | | - |
728 | | - |
| 775 | + |
| 776 | + |
| 777 | + |
| 778 | + |
| 779 | + |
729 | 780 | |
730 | | - |
731 | 781 | |
732 | 782 | |
733 | 783 | |
| ||
736 | 786 | |
737 | 787 | |
738 | 788 | |
| 789 | + |
| 790 | + |
| 791 | + |
| 792 | + |
| 793 | + |
| 794 | + |
| 795 | + |
| 796 | + |
| 797 | + |
| 798 | + |
| 799 | + |
| 800 | + |
| 801 | + |
| 802 | + |
| 803 | + |
| 804 | + |
| 805 | + |
| 806 | + |
| 807 | + |
| 808 | + |
| 809 | + |
| 810 | + |
| 811 | + |
| 812 | + |
| 813 | + |
| 814 | + |
| 815 | + |
| 816 | + |
| 817 | + |
| 818 | + |
| 819 | + |
| 820 | + |
| 821 | + |
| 822 | + |
| 823 | + |
| 824 | + |
| 825 | + |
| 826 | + |
| 827 | + |
| 828 | + |
| 829 | + |
| 830 | + |
| 831 | + |
| 832 | + |
| 833 | + |
| 834 | + |
| 835 | + |
| 836 | + |
739 | 837 | |
740 | 838 | |
741 | 839 | |
| ||
822 | 920 | |
823 | 921 | |
824 | 922 | |
| 923 | + |
| 924 | + |
| 925 | + |
| 926 | + |
825 | 927 | |
826 | 928 | |
827 | 929 | |
| ||
908 | 1010 | |
909 | 1011 | |
910 | 1012 | |
| 1013 | + |
| 1014 | + |
| 1015 | + |
| 1016 | + |
| 1017 | + |
| 1018 | + |
911 | 1019 | |
912 | 1020 | |
913 | 1021 | |
| ||
956 | 1064 | |
957 | 1065 | |
958 | 1066 | |
959 | | - |
| 1067 | + |
960 | 1068 | |
961 | 1069 | |
962 | 1070 | |
| ||
1020 | 1128 | |
1021 | 1129 | |
1022 | 1130 | |
| 1131 | + |
| 1132 | + |
| 1133 | + |
| 1134 | + |
| 1135 | + |
| 1136 | + |
1023 | 1137 | |
1024 | 1138 | |
1025 | 1139 | |
|
Collapse file
test/parallel/test-snapshot-incompatible.js
Copy file name to clipboard+76Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
0 commit comments