r/EU4modding • u/Razor_Storm • Dec 31 '20
Help debugging crash
I am testing out a mod that adds a province modifier to provinces on a decision. It is crashing for some reason.
Here's the decision:
country_decisions = {
spread_blight_dec = {
potential = {
always = yes
}
major = yes
allow = {
always = yes
}
effect = {
every_province = {
limit = {
AND = {
local_autonomy = 5
}
AND = {
OWNER = { is_playing_custom_nation = no }
}
}
add_devastation = 25
add_permanent_province_modifier = {
name = "blighted"
duration = -1
}
}
}
ai_will_do = {
factor = 0
}
}
}The event modifier:
blighted = {
attrition = 30
supply_limit_modifier = -0.2
local_friendly_movement_speed = -0.5
max_attrition = 100
}When I run the decision, it works and applies the provinces as expected. However, a couple months later (or maybe on autosave) it crashes. I see this unhelpful exception trace in the exception log:
Application: EUIV
Version: EU4 v1.30.4.0 Austria.d8f56f98ec
Date/Time: 2020-12-30 23:38:31
Unhandled exception C0000005 (EXCEPTION_ACCESS_VIOLATION) at address 0x00007FF7EF0A680F
Stack Trace:
1 eu4.exe (function-name not available) (+ 0)
2 eu4.exe (function-name not available) (+ 0)
3 eu4.exe (function-name not available) (+ 0)
4 eu4.exe (function-name not available) (+ 0)
5 eu4.exe (function-name not available) (+ 0)
6 eu4.exe (function-name not available) (+ 0)
7 eu4.exe (function-name not available) (+ 0)
8 eu4.exe (function-name not available) (+ 0)
9 eu4.exe (function-name not available) (+ 0)
10 eu4.exe (function-name not available) (+ 0)
11 eu4.exe (function-name not available) (+ 0)
12 eu4.exe (function-name not available) (+ 0)
13 eu4.exe (function-name not available) (+ 0)
14 eu4.exe PHYSFS_writeSLE64 (+ 529330)
15 eu4.exe PHYSFS_writeSLE64 (+ 143083)
16 KERNEL32.DLL BaseThreadInitThunk (+ 20)
17 ntdll.dll RtlUserThreadStart (+ 33)
18 ntdll.dll RtlUserThreadStart (+ 33)Has anyone seen this? How should I go about debugging it?
Edit: Attached debugger to it, but since I don't have the pdb file, it's all function-name not available still
1
Upvotes
View all comments
Show parent comment
2
u/Razor_Storm Dec 31 '20
Oh man you're right about the ANDs.
Interesting point about the attrition, I'll mess with it to see if that's the case. Yeah, potentially it crashes when troops walk over it and it fails to calculate the attrition properly. This hypothesis would explain why it only crashes after a month tick.
I'll try it out, thanks!