Skip to content

Extensions - Fix Longley-Rice segfault#1398

Closed
PabstMirror wants to merge 1 commit intomasterfrom
ricef
Closed

Extensions - Fix Longley-Rice segfault#1398
PabstMirror wants to merge 1 commit intomasterfrom
ricef

Conversation

@PabstMirror
Copy link
Copy Markdown
Collaborator

3 Crashdumps from dedman
Different maps, but all using long rice, crashing in same spot

Untitled

in all 3 cases elev is only size 3 and i is going off the end

This PR should fix the overrun (and keep the average correct)
But I couldn't replicate issue locally, so I can't be positive it will fully solve root issue

@jonpas jonpas added this to the 2.14.0 milestone Jul 7, 2025
@PabstMirror
Copy link
Copy Markdown
Collaborator Author

Tested in-game with extensions\src\ACRE2Arma\signal\models\longleyRice.cpp:75

    itmElevations.reserve(3);
    itmElevations.push_back(0.0);                                             // ITM: Number of points in the data - 1
    itmElevations.push_back(static_cast<float64_t>(sampleSize));           // ITM: Distance between points
    itmElevations.push_back(10.2);      // dummy
    //_map->terrain_profile(tx_pos, rx_pos, sampleSize, itmElevations);      // Get Terrain elevations
    itmElevations[0] = static_cast<float64_t>(itmElevations.size() - 1u);  // ITM: Update the number of points

to manually get a 3 capacity array
gave no crash and reasonable rx values

@TheMagnetar
Copy link
Copy Markdown
Member

Hmm. While this would indeed fix the crash, this is not fixing the root problem. Why does it happen in the first place? LR is one of the must fucked up codes i have ever seen, partly due to being a port of FORTRAN. So any code modification must be tested with different combination of paths and compare it with the original implementation.

@jonpas
Copy link
Copy Markdown
Member

jonpas commented Dec 30, 2025

Replaced by #1407.

@jonpas jonpas closed this Dec 30, 2025
@jonpas jonpas deleted the ricef branch December 30, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants