sirjuddington / SLADE

It's a Doom editor
https://slade.mancubus.net
GNU General Public License v2.0
699 stars 108 forks source link

DirAtPath crash #1616

Closed Username-N00b-is-not-available closed 9 months ago

Username-N00b-is-not-available commented 10 months ago

SLADE Version: 3.2.4 Operating System: Windows

Issue Details: Execute the following code in the Script Manager with an open WAD or directory and get a crash:

a = Archives.All()[1]
App.LogMessage("1")
a.DirAtPath("sprites")
App.LogMessage("2")
Version: 3.2.4 (x64)
No current action

Operating System: Windows 10 (build 19045), 64-bit edition
Graphics Vendor: OpenGL not initialised
Graphics Hardware: OpenGL not initialised
OpenGL Version: OpenGL not initialised

Stack Trace:
0: [unknown location] [unknown:1408175622]
1: [unknown location] [unknown:1407622704]
2: [unknown location] [unknown:1407619915]
3: [unknown location] [unknown:1408178091]
4: [unknown location] [unknown:1414607458]
5: [unknown location] [unknown:1414603486]
6: [unknown location] [unknown:1414648866]
7: [unknown location] [unknown:1414601461]
8: [unknown location] [unknown:1414604899]
9: [unknown location] [unknown:1414602960]
10: [unknown location] [unknown:1414521837]
11: [unknown location] [unknown:1412804674]
12: [unknown location] [unknown:1412800763]
13: [unknown location] [unknown:1412804275]
14: [unknown location] [unknown:1412815462]
15: [unknown location] [unknown:1412838307]
16: [unknown location] [unknown:1407523396]
17: [unknown location] [unknown:1413267975]
18: [unknown location] [unknown:1416502964]
19: [unknown location] [unknown:1416668335]
20: [unknown location] [unknown:1416671235]
21: [unknown location] [unknown:1416672097]
22: [unknown location] [unknown:1416668122]
23: [unknown location] [unknown:1416671082]
24: [unknown location] [unknown:1417729443]
25: [unknown location] [unknown:1417755891]
26: [unknown location] [unknown:1417766536]
27: [unknown location] [unknown:1417791701]
28: [unknown location] CallWindowProcW
29: [unknown location] DispatchMessageW
30: [unknown location] IsDialogMessageW
31: [unknown location] [unknown:1417763103]
32: [unknown location] [unknown:1419099599]
33: [unknown location] [unknown:1419099682]
34: [unknown location] [unknown:1419097772]
35: [unknown location] [unknown:1417155587]
36: [unknown location] [unknown:1417156122]
37: [unknown location] [unknown:1416508439]
38: [unknown location] [unknown:1417193916]
39: [unknown location] [unknown:1416657032]
40: [unknown location] [unknown:1421488350]
41: [unknown location] BaseThreadInitThunk
42: [unknown location] RtlUserThreadStart

Last Log Messages:
SLADE Initialisation OK
Checking for updates...
Latest stable release: v3.2.4
Latest beta release: v3.2.0 beta 4
Already up-to-date
Opening archive D:/doom/DOOM2.WAD
Opening took 656 ms
1
sirjuddington commented 9 months ago

It looks like it's because that script is wrong, the third line should be a:DirAtPath("sprites")

It really shouldn't crash though but I'm not sure I can do much about it as the crash was happening within sol (the c++ <-> lua binding library SLADE uses)

Username-N00b-is-not-available commented 9 months ago

Thank you! So, in Lua, only the static methods are called using the dot? Now txl1 = TextureXList.new(FORMAT_TEXTURES) also gives a crash, while the same tried with 3 instead of the constant doesn't.

sirjuddington commented 9 months ago

The FORMAT_TEXTURES constant is part of the TextureXList class, so you need to do TextureXList.new(TextureXList.FORMAT_TEXTURES) (or just use the number 3 directly)

Also, these issues should no longer crash SLADE in 3.2.5 and instead just error out of the script, so I'm going to close this issue