Commit af56a61
authored
Fix fpmsyncd crash during pfcwd/test_pfcwd_warm_reboot.py worm reboot issue (#3746)
Fix fpmsyncd crash during warm reboot issue
Why I did it
The SONiC management test case pfcwd/test_pfcwd_warm_reboot.py failed due to a crash in fpmsyncd during the warm reboot process.
The crash occurred when fpmsyncd received the warm reboot signal and invoked the WarmStartHelper::checkAndStart() method. At that moment, the m_syncTable inside WarmStartHelper pointed to an invalid route table, which triggered a segmentation fault (SIGSEGV).
Root Cause:
In the constructor of RouteSync, the initialization of m_warmStartHelper depends on m_routeTable being initialized first. However, in the class declaration, m_warmStartHelper is listed before m_routeTable.
In C++, member variables are initialized in the order they are declared in the class—not in the order specified in the constructor’s initializer list. As a result, m_warmStartHelper is initialized before m_routeTable, leading to m_warmStartHelper referencing an uninitialized route table.1 parent 80932db commit af56a61
4 files changed
Lines changed: 30 additions & 21 deletions
File tree
- fpmsyncd
- tests
- mock_tests/fpmsyncd
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | 1029 | | |
1043 | 1030 | | |
1044 | 1031 | | |
| |||
1057 | 1044 | | |
1058 | 1045 | | |
1059 | 1046 | | |
1060 | | - | |
| 1047 | + | |
1061 | 1048 | | |
1062 | 1049 | | |
1063 | 1050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2475 | 2475 | | |
2476 | 2476 | | |
2477 | 2477 | | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
2478 | 2495 | | |
2479 | 2496 | | |
2480 | 2497 | | |
| |||
0 commit comments