namreeb / namigator

An intelligent navigation API for World of Warcraft Alpha, Vanilla, TBC and WotLK
MIT License
49 stars 32 forks source link

Loading `BlackRockSpire` for 1.12 trips assertion #63

Closed gtker closed 4 months ago

gtker commented 1 year ago

Loading BlackRockSpire for vanilla trips the following assertion:

.//vendor/pathfind/Tile.cpp:58: pathfind::Tile::Tile(pathfind::Map*, utility::BinaryStream&, const std::filesystem::__cxx11::path&, bool): Assertion 'quadHeight == 0 || quadHeight == 1' failed.

SHA256sum of generated files:

7b48817c573db9d9bfc697728b0e059e6c1ba86d855d51fbaf18d0001a391cda  BlackRockSpire.map
367bb1b45dc73a067fb4290d0d95961f6cab8181b059446316804c3ec06b2571  BlackRockSpire/Map.nav

quadHeight = 120 for all maps.

Let me know if you need backtraces or any further info.

Backtrace from Rust (ignore anything below pathfind_new_map:

__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352607872) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352607872)
    at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737352607872) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737352607872, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7842476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff78287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff782871b in __assert_fail_base (
    fmt=0x7ffff79dd150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x55555565a7c0 "quadHeight == 0 || quadHeight == 1",
    file=0x55555565a6b0 "./pathfind/Tile.cpp",
    line=58, function=<optimized out>) at ./assert/assert.c:92
#6  0x00007ffff7839e96 in __GI___assert_fail (
    assertion=0x55555565a7c0 "quadHeight == 0 || quadHeight == 1",
    file=0x55555565a6b0 "./pathfind/Tile.cpp",
    line=58,
    function=0x55555565a750 "pathfind::Tile::Tile(pathfind::Map*, utility::BinaryStream&, const std::filesystem::__cxx11::path&, bool)") at ./assert/assert.c:101
#7  0x00005555555d84bf in pathfind::Tile::Tile (this=this@entry=0x5555558ef690,
    map=map@entry=0x55555569ed50, in=...,
    navPath=filesystem::path "/tmp/outputtest/Nav/BlackRockSpire/Map.nav" = {...},
    load_heightfield=load_heightfield@entry=false)
    at ./pathfind/Tile.cpp:58
#8  0x00005555555d53cb in std::make_unique<pathfind::Tile, pathfind::Map*, utility::BinaryStream&, std::filesystem::__cxx11::path const&> () at /usr/include/c++/11/bits/unique_ptr.h:961
#9  pathfind::Map::Map (this=this@entry=0x55555569ed50,
    dataPath=filesystem::path "/tmp/outputtest" = {...}, mapName="BlackRockSpire")
    at ./pathfind/Map.cpp:265
#10 0x000055555556dae4 in pathfind_new_map (data_path=<optimized out>, map_name=<optimized out>,
    result=0x7fffffffdddf "")
    at ./pathfind/pathfind_c_bindings.cpp:13
#11 0x000055555556d2e0 in namigator::pathfind::{impl#0}::new::inner (data_path=..., map_name=...)
    at src/pathfind.rs:39
#12 0x000055555556d058 in namigator::pathfind::PathfindMap::new<&std::path::Path> (data_path=...,
    map_name=...) at src/pathfind.rs:61
#13 namigator::vanilla::{impl#0}::new::inner (data_path=..., map_name=...) at src/util.rs:35
#14 namigator::vanilla::VanillaMap::new<&std::path::Path> (data_path=..., map=<optimized out>)
    at src/util.rs:39
#15 namigator::vanilla::{impl#0}::build_gameobjects_and_map::inner (data_path=..., output_path=...,
    map=<optimized out>, threads=<optimized out>) at src/util.rs:86
#16 0x000055555556bd53 in namigator::vanilla::VanillaMap::build_gameobjects_and_map<&str, &str> (
    data_path=..., output_path=..., threads=26, map=<optimized out>)
    at /home/daniel/gitas/namigator-rs/namigator/src/util.rs:89
#17 namigatortest::main () at src/main.rs:11
gtker commented 1 year ago

This also happens for BlackrockDepths and OnyxiaLairInstance.

quadHeight = 120

205faccc82957c9b0ec630696a8878fa2ca76c78c9e10504943821d40ee20576  BlackrockDepths.map
6d45bd720779aa7649757657f2370a2b37d6e84ca1b00e8a8e73f181b5533cf1  Nav/BlackrockDepths/Map.nav
a03ea383ab88951f6b16710b25cfc5d1455603af3004ffb09e05ee997594c14a  OnyxiaLairInstance.map
b7fcb7160bbe4d932ff2ed0108b1a72930d0ad304ec22adaeb849a4a474d07d3  Nav/OnyxiaLairInstance/Map.nav
gtker commented 1 year ago

Same error for DeeprunTram, OrgrimmarInstance, MoltenCore, DireMaul, AlliancePVPBarracks, and HordePVPBarracks:

quadHeight = 120 for all maps.

__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352607872) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352607872)
    at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737352607872) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737352607872, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7842476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff78287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff782871b in __assert_fail_base (
    fmt=0x7ffff79dd150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x55555565a7c0 "quadHeight == 0 || quadHeight == 1",
    file=0x55555565a6b0 "./pathfind/Tile.cpp",
    line=60, function=<optimized out>) at ./assert/assert.c:92
#6  0x00007ffff7839e96 in __GI___assert_fail (
    assertion=0x55555565a7c0 "quadHeight == 0 || quadHeight == 1",
    file=0x55555565a6b0 "./pathfind/Tile.cpp",
    line=60,
    function=0x55555565a750 "pathfind::Tile::Tile(pathfind::Map*, utility::BinaryStream&, const std::filesystem::__cxx11::path&, bool)") at ./assert/assert.c:101
#7  0x00005555555d8541 in pathfind::Tile::Tile (this=this@entry=0x555555778ed0,
    map=map@entry=0x55555569ed30, in=...,
    navPath=filesystem::path "./Nav/DeeprunTram/Map.nav" = {...},
    load_heightfield=load_heightfield@entry=false)
    at ./pathfind/Tile.cpp:60
#8  0x00005555555d53cb in std::make_unique<pathfind::Tile, pathfind::Map*, utility::BinaryStream&, std::filesystem::__cxx11::path const&> () at /usr/include/c++/11/bits/unique_ptr.h:961
#9  pathfind::Map::Map (this=this@entry=0x55555569ed30,
    dataPath=filesystem::path "." = {...}, mapName="DeeprunTram")
    at ./pathfind/Map.cpp:265
#10 0x000055555556dae4 in pathfind_new_map (data_path=<optimized out>, map_name=<optimized out>,
    result=0x7fffffffdddf "")
    at ./pathfind/pathfind_c_bindings.cpp:13
#11 0x000055555556d2e0 in namigator::pathfind::{impl#0}::new::inner (data_path=..., map_name=...)
    at src/pathfind.rs:39
#12 0x000055555556d058 in namigator::pathfind::PathfindMap::new<&std::path::Path> (data_path=...,
    map_name=...) at src/pathfind.rs:61
#13 namigator::vanilla::{impl#0}::new::inner (data_path=..., map_name=...) at src/util.rs:35
#14 namigator::vanilla::VanillaMap::new<&std::path::Path> (data_path=..., map=<optimized out>)
    at src/util.rs:39
#15 namigator::vanilla::{impl#0}::build_gameobjects_and_map::inner (data_path=..., output_path=...,
    map=<optimized out>, threads=<optimized out>) at src/util.rs:86
#16 0x000055555556bd53 in namigator::vanilla::VanillaMap::build_gameobjects_and_map<&str, &str> (
    data_path=..., output_path=..., threads=26, map=<optimized out>)
    at /home/daniel/gitas/namigator-rs/namigator/src/util.rs:89
#17 namigatortest::main () at src/main.rs:11

OrgrimmarInstance:

__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352607872) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352607872)
    at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737352607872) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737352607872, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7842476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff78287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff782871b in __assert_fail_base (
    fmt=0x7ffff79dd150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x55555565a7c0 "quadHeight == 0 || quadHeight == 1",
    file=0x55555565a6b0 "/home/daniel/gitas/namigator-rs/namigator-sys/vendor/pathfind/Tile.cpp",
    line=60, function=<optimized out>) at ./assert/assert.c:92
#6  0x00007ffff7839e96 in __GI___assert_fail (
    assertion=0x55555565a7c0 "quadHeight == 0 || quadHeight == 1",
    file=0x55555565a6b0 "/home/daniel/gitas/namigator-rs/namigator-sys/vendor/pathfind/Tile.cpp",
    line=60,
    function=0x55555565a750 "pathfind::Tile::Tile(pathfind::Map*, utility::BinaryStream&, const std::filesystem::__cxx11::path&, bool)") at ./assert/assert.c:101
#7  0x00005555555d8541 in pathfind::Tile::Tile (this=this@entry=0x55555572c6a0,
    map=map@entry=0x55555569ed70, in=...,
    navPath=filesystem::path "/tmp/outputtest/Nav/OrgrimmarInstance/Map.nav" = {...},
    load_heightfield=load_heightfield@entry=false)
    at /home/daniel/gitas/namigator-rs/namigator-sys/vendor/pathfind/Tile.cpp:60
#8  0x00005555555d53cb in std::make_unique<pathfind::Tile, pathfind::Map*, utility::BinaryStream&, std::filesystem::__cxx11::path const&> () at /usr/include/c++/11/bits/unique_ptr.h:961
#9  pathfind::Map::Map (this=this@entry=0x55555569ed70,
    dataPath=filesystem::path "/tmp/outputtest" = {...}, mapName="OrgrimmarInstance")
    at /home/daniel/gitas/namigator-rs/namigator-sys/vendor/pathfind/Map.cpp:265
#10 0x000055555556dae4 in pathfind_new_map (data_path=<optimized out>, map_name=<optimized out>,
    result=0x7fffffffdddf "")
    at /home/daniel/gitas/namigator-rs/namigator-sys/vendor/pathfind/pathfind_c_bindings.cpp:13
#11 0x000055555556d2e0 in namigator::pathfind::{impl#0}::new::inner (data_path=..., map_name=...)
    at src/pathfind.rs:39
#12 0x000055555556d058 in namigator::pathfind::PathfindMap::new<&std::path::Path> (data_path=...,
    map_name=...) at src/pathfind.rs:61
#13 namigator::vanilla::{impl#0}::new::inner (data_path=..., map_name=...) at src/util.rs:35
#14 namigator::vanilla::VanillaMap::new<&std::path::Path> (data_path=..., map=<optimized out>)
    at src/util.rs:39
#15 namigator::vanilla::{impl#0}::build_gameobjects_and_map::inner (data_path=..., output_path=...,
    map=<optimized out>, threads=<optimized out>) at src/util.rs:86
#16 0x000055555556bd53 in namigator::vanilla::VanillaMap::build_gameobjects_and_map<&str, &str> (
    data_path=..., output_path=..., threads=26, map=<optimized out>)
    at /home/daniel/gitas/namigator-rs/namigator/src/util.rs:89
#17 namigatortest::main () at src/main.rs:11
namreeb commented 1 year ago

Loading BlackrockSpire did produce an assertion, but a different one for me. https://github.com/namreeb/namigator/commit/7142566932b457d3a70f6ee39c9b3812e30b699f fixed that. Can you check if your assert still happens? I'm not able to reproduce it.

gtker commented 1 year ago

With the 7142566 change the following maps trip the assert with quadHeight == 120:

'Testing' (test)
'CashTest' (Test)
'Stormwind Stockade' (StormwindJail)
'Stormwind Prison' (StormwindPrison)
'Collin's Test' (Collin)
'Wailing Caverns' (WailingCaverns)
'<Unused> Monastery' (Monastery)
'Razorfen Kraul' (RazorfenKraulInstance)
'Blackfathom Deeps' (Blackfathom)
'Uldaman' (Uldaman)
'Gnomeregan' (GnomeragonInstance)
'Blackrock Spire' (BlackRockSpire)
'Blackrock Depths' (BlackrockDepths)
'Onyxia's Lair' (OnyxiaLairInstance)
'Maraudon' (Mauradon)
'Deeprun Tram' (DeeprunTram)
'Ragefire Chasm' (OrgrimmarInstance)
'Molten Core' (MoltenCore)
'Dire Maul' (DireMaul)
'Alliance PVP Barracks' (AlliancePVPBarracks)
'Horde PVP Barracks' (HordePVPBarracks)

While the following maps work:

'Eastern Kingdoms' (Azeroth)
'Kalimdor' (Kalimdor)
'Scott Test' (ScottTest)
'Alterac Valley' (PVPZone01)
'Shadowfang Keep' (Shadowfang)
'Deadmines' (DeadminesInstance)
'Azshara Crater' (PVPZone02)
'Sunken Temple' (SunkenTemple)
'Razorfen Downs' (RazorfenDowns)
'Emerald Dream' (EmeraldDream)
'Scarlet Monastery' (MonasteryInstances)
'Zul'Farrak' (TanarisInstance)
'Opening of the Dark Portal' (CavernsOfTime)
'Scholomance' (SchoolofNecromancy)
'Zul'Gurub' (Zul'gurub)
'Stratholme' (Stratholme)
'Development Land' (development)
'Blackwing Lair' (BlackwingLair)
'Warsong Gulch' (PVPZone03)
'Ruins of Ahn'Qiraj' (AhnQiraj)
'Arathi Basin' (PVPZone04)
'Ahn'Qiraj Temple' (AhnQirajTemple)
'Naxxramas' (Stratholme Raid)

On the previous 8d67ec6 the result is identical, except the RazorfenKraulInstance map also seems to work.

With SHA256sums:

0bb2d6d370d825353eff5d9282c545a1b61980baaa5b7b65b1a7521e0ee8e27a  backup.MPQ
f648e4fae190abcb25749ddbe96454e7e0de7e9c7e955983ed9d0e73b6986009  base.MPQ
d9d5a290bdad848e177e2731c7ef221a1d7a6793e2c94e431488dd40816101e2  dbc.MPQ
511189160f091eeb9d7ee8c473c1422b7f1fadbd9b65bfbf7d0a2a344103312d  fonts.MPQ
6545dfbb3ef21a8b7f36b577419494cc292fec35585f9a1511d6c8b692b83191  interface.MPQ
13aee674db39fc605c8aabf964eda0bb7895c6f026fed6c508bf2f9d155db0f9  misc.MPQ
a7aa78c234bbdd450e00434e5939aa1a02383df1971cddcbfa181d68e9ab45a2  model.MPQ
84f506c9f049f1e35f6d0f7b2e6643d28856888680ae2593436be8b9a058aad6  patch-2.MPQ
a9ad25c9a32600dd3c71f97a0f95f9b9b629a9995988b928975c8871f1197683  patch.MPQ
6ba131da952aae8d1e061b54468fd6e5d2ef78616540e2746ed21255d6b959a7  sound.MPQ
a1564120452cd75c4c7b2002a668b12250a35dab658816a33b591ebb23004f52  speech.MPQ
68fda6fb4f57051a47a0a56ff1757d73ee5c2a870774ba60ee8b52d7b36bc61d  terrain.MPQ
7e5996d2a0a2de03c79dcf9ab78f3fce66264688eee56ca6dbc51c8ce4433dac  texture.MPQ
9933d9ca23d481647880c9798dc7c225cd926f51026d148f09cd5251fc56edb7  wmo.MPQ
namreeb commented 1 year ago

I tried BlackrockSpire and was not able to reproduce it (yes, assertions were enabled).

Thread # 75952 ERROR: rcBuildRegions: 1 overlapping regions.
Thread # 36220 ERROR: rcBuildRegions: 2 overlapping regions.
Thread # 36220 ERROR: rcBuildContours: Multiple outlines for region 13.
Thread #112936 ERROR: rcBuildRegions: 1 overlapping regions.
Thread #112936 WARNING: rcBuildPolyMesh: Bad triangulation Contour 6.
Thread # 17528 ERROR: rcBuildRegions: 1 overlapping regions.
Thread # 17528 ERROR: rcBuildContours: Multiple outlines for region 11.
Thread #110256 ERROR: rcBuildRegions: 1 overlapping regions.
Thread #112936 finished.
Thread #17528 finished.
Thread #101372 finished.
Thread #36220 finished.
Thread #84356 finished.
Thread #75952 finished.
Thread #54668 finished.
Thread #29064 finished.
Thread #110256 finished.
Thread #92216 finished.
Thread #50608 finished.
Thread #52284 finished.
Thread #84636 finished.
% Complete: 99.6241
Thread #108376 finished.
Thread #97148 finished.
% Complete: 100
Finished BlackrockSpire.
Thread #101140 finished.
Finished BlackrockSpire (798 tiles) in 42 seconds.

@gtker can you clarify when this is happening? You've built the mesh and now you're trying to load it?

Edit: Disregard, I see it now!

gtker commented 9 months ago

I'm preparing for an initial release of my downstream library, do you know if this is going to be fixed within the near future?

namreeb commented 4 months ago

Sorry for the delay. But can you try this again after https://github.com/namreeb/namigator/commit/f03d9f172f448cc86fe0051f630d76dd86b6718f?

gtker commented 4 months ago

This fixed all 1.12 maps for me. Thanks! :)