Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upReloading M4 with empty STANAG mag crashes game #15450
Comments
This comment has been minimized.
This comment has been minimized.
|
On line 171 of item_location.cpp:
But on line 133:
|
This comment has been minimized.
This comment has been minimized.
|
I am unable to reproduce this, using same version/build in an unmodded world on a windows 7 64bit system. My guy just reloads his stuff and then ran outside and found a hulk, who violated him with a brick wall. Poor random guy. P.S. I'm a derp. But hey, at least I covered all the cases, neh? |
This comment has been minimized.
This comment has been minimized.
|
ejseto, doesn't line 172 check whether obj is null and do stuff if it is? |
This comment has been minimized.
This comment has been minimized.
|
That's too late, you've already dereferenced a null pointer by that point. |
This comment has been minimized.
This comment has been minimized.
|
hmm..Maybe he meant to use 'it' there, since he sets it = what on 132. I get lost when people use incredibly general variable names and don't comment. edit: |
This comment has been minimized.
This comment has been minimized.
|
@Malkeus that's odd, I'm getting this error on 64 bit win7 with an unmodded world. One difference I can see is that you seem to have your config set up while I'm getting the error on a completely default install. |
This comment has been minimized.
This comment has been minimized.
|
@ejseto that looks a very likely candidate |
This was referenced Feb 18, 2016
This comment has been minimized.
This comment has been minimized.
|
Tested:
Seems to affect more than just magazine-fed guns. |
This comment has been minimized.
This comment has been minimized.
Affects all reloading from inventory |
This comment has been minimized.
This comment has been minimized.
|
To clarify, I tested wielding a crossbow and reload that way, it crashed in that instance too. Not just from inventory. Unless you're referring to whether the AMMO is in inventory versus on the ground, and I can't think of any reason why that'd be the cause. o.O |
Coolthulhu
closed this
in
#15465
Feb 19, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
You need to resolve your doubt about whether you are testing against #15465 before I can look into this any further |
This comment has been minimized.
This comment has been minimized.
|
Can't replicate |
This comment has been minimized.
This comment has been minimized.
|
It's been an hour, I've tested the last several, most recent builds. That PR should already be in the build by now. |
This comment has been minimized.
This comment has been minimized.
|
that commit landed in 4434 |
This comment has been minimized.
This comment has been minimized.
|
And this is still present in 4436. -_- |
This comment has been minimized.
This comment has been minimized.
Neither can I
Yes, can you test this with ammo from the ground or a vehicle |
This comment has been minimized.
This comment has been minimized.
|
I just tested this with a crossbow, with ammo in inventory. In both tiles build and ASCII. Again, 4436. And then I dropped the bolts on the ground and tried it. Same thing, both when right underfoot and in an adjacent space. I'll double-check with AR-15s or other magazine-fed firearms. I'm now confused as to whether this issue needs to be re-opened, or if it's just #15462 instead. |
This comment has been minimized.
This comment has been minimized.
|
@mightyagrippa unfortunately that stacktrace isn't going to be helpful. It would be useful if you could try the fix from #15465 @chaosvolt a segfault is always a valid bug. there is no need to post screenshots. |
This comment has been minimized.
This comment has been minimized.
|
Ah. Still, I'm wondering how this can't be replicated. In any case, it seems magazine-fed weapons are also subject to this bug. When you attempted to replicate this, did you use the latest build from the site after this was merged, or something else? |
This comment has been minimized.
This comment has been minimized.
|
I'm compiling from source and neither myself nor @Coolthulhu are building for windows. What is the last build that doesn't have the fault for you? |
This comment has been minimized.
This comment has been minimized.
|
Hmm. Which suggests a Windows-specific issue then? And I'd need to start testing to see how far back this goes. @_@ |
This comment has been minimized.
This comment has been minimized.
|
Could be a compiler thing. Does it happen before or after selecting ammo (when more than one option is available)? |
Coolthulhu
reopened this
Feb 19, 2016
This comment has been minimized.
This comment has been minimized.
|
On the plus side, I've found that build 4419 seems to be the latest build without this issue. Not sure if this would prove useful. EDIT: And finally tested with multiple sorts of ammo of the same type. Crashes on hitting reload, rather than prompting the ammo-select screen. |
This comment has been minimized.
This comment has been minimized.
|
Odd. I've been quick-testing this with pure defaults, yeah. Not sure what would be the cause. This bug is getting weirder and weirder. |
This comment has been minimized.
This comment has been minimized.
|
It's caused by the window size. Default 80x25 crashes. 180x65 doesn't. |
This comment has been minimized.
This comment has been minimized.
|
This sounds familiar. Wasn't there a similar crash a few months back?
|
This comment has been minimized.
This comment has been minimized.
|
Oh for the love of...yeah, there was an issue like that. Trying to recall which it was. And yep, setting it to my favored 100x40 causes no problem with crossbows. Gonna check magazines though. |
This comment has been minimized.
This comment has been minimized.
|
Ah,I remember now.that bug crashed on startup with default screen settings
|
This comment has been minimized.
This comment has been minimized.
|
Still related, in that both issues had the same absurdly arcane cause. EDIT: Magazines and magazine-fed guns likewise cause no problems if window size is bumped up. Have I mentioned how WEIRD this issue is? XP |
This comment has been minimized.
This comment has been minimized.
|
If the window isn't at least 94 wide, it's not big enough for the pick ammo dialog. Presumably there's some check where the ammo dialog window doesn't get created if the game window isn't wide enough, and instead the game just passes around a null pointer assuming it's ammo dialog window pointer until it finally gets dereferenced. On line 488 of ui.cpp:
Using the default window size of 80, w_x == -7. Since w_x is the x coordinate of the window, newwin() returns NULL. On line 56 of cursesport.cpp:
Gotta love that comment. |
This comment has been minimized.
This comment has been minimized.
|
Ah, that explains it. |
This comment has been minimized.
This comment has been minimized.
|
@ejseto What an excellent comment. Sorry I wasn't here during the discovery, will check in tomorrow to see if more testing is needed. |
This comment has been minimized.
This comment has been minimized.
I haven't looked into this but if indeed no debug symbols are being provided you should consider reporting this as a separate issue.
Well identified @ejseto. I'm going to patch the reloading dialog but would be surprised if this bug can't be reproduced in other dialogs at arbitrary screen sizes. |
This comment has been minimized.
This comment has been minimized.
|
Can reproduce at 80x25 |
This comment has been minimized.
This comment has been minimized.
|
The code that calculates the window size and position is in uimenu::setup() so I'd expect it to happen anywhere you try to make a window larger than the game window. |
This comment has been minimized.
This comment has been minimized.
Moonsabrt
commented
Feb 19, 2016
|
Yeah this issue is happening with me to i posted a forum bug at the garage in the cataclysm forums..But its not with an m4 its with any gun. As choasvolt said any reloading causes an error. |
This comment has been minimized.
This comment has been minimized.
Yes, I'm just checking now but I think the reload code actually constraints |
This comment has been minimized.
This comment has been minimized.
Moonsabrt
commented
Feb 19, 2016
|
Oh gawd what is happening, welp the bug crashed my save file and world, and yes same thing any world and any game whether a folder freshly downloaded or one that i have been using for a while. |
This comment has been minimized.
This comment has been minimized.
Actually it doesn't, see #15477 |
This comment has been minimized.
This comment has been minimized.
Is there any reason this code couldn't constrain x and y >= 0 and issue a |
This comment has been minimized.
This comment has been minimized.
|
Dunno, but I'd guess it's because it's not whoever-wrote-that-code's problem. There doesn't really seem to be an easy way to fix it though. You could say, "Well, why doesn't it create the window anyway, and just push the text off screen?" But who knows what that text is or how important it is, and you could just turn around and say, "Well don't try to create a window bigger than the game window, duh." You could also say, "Well what about word-wrap?" But that could just shift the problem from x to y. It'd also ruin your formatting. I'd guess the official response would probably be to not make such (big text requiring such) big windows since they want the game playable in 80x25. |
This comment has been minimized.
This comment has been minimized.
|
Could we have a note on 80x25 requirement in the contributing docs? Also I think I remember Rivet saying that most players play on larger sizes and that we're slowly moving away from having to support 80x25... |
This comment has been minimized.
This comment has been minimized.
It's fairly challenging to play at 80x25 in any case. That said the game shouldn't crash at any screen size. |
This comment has been minimized.
This comment has been minimized.
Or I could save you some time and specify this is working as intended. Making Jenkins builds with debug symbols would be both slower and result in much larger binaries. |
This comment has been minimized.
This comment has been minimized.
Moonsabrt
commented
Feb 19, 2016
|
...I am so confused by reading this. |
This comment has been minimized.
This comment has been minimized.
Behold the bug that will not die. ;w; EDIT: Oh wait no, that was replying to a statement suggested that a small tweak wouldn't fix this, which means this will be fixed by that PR. I hope? |
This comment has been minimized.
This comment has been minimized.
|
Can't get much smaller than changing a single character. C++ is !FUN! |
This comment has been minimized.
This comment has been minimized.
|
And by that you mean !!FUN!! of course. |
This comment has been minimized.
This comment has been minimized.
Moonsabrt
commented
Feb 20, 2016
|
........IS THERE A CONCLUSION TO THIS...SERIOUSLY ANYONE!!?!?!? |
This comment has been minimized.
This comment has been minimized.
|
A fix was PRd in #15477. Not sure if it's been merged yet, but it will be
|
This comment has been minimized.
This comment has been minimized.
|
Yeah, that PR is still open. Until then? Beef up your window width. |



mightyagrippa commentedFeb 18, 2016
Version is ge27b38d. Windows tiles build 4425. To reproduce, start as an evacuee military recruit, put last 3 points in strength, start game, open inventory, select M4, attempt to reload.
Multiple players in IRC reported same issue. Stack trace was requested in IRC. Not sure if this is that, but save me stackoverflow:
ntoskrnl.exe+0x75daa
ntoskrnl.exe+0x2e980
ntoskrnl.exe+0x657a1
ntoskrnl.exe+0x66c57
ntoskrnl.exe+0x78a0d
ntoskrnl.exe+0x77d1a
ntoskrnl.exe+0x369a0f
ntoskrnl.exe+0x396739
ntoskrnl.exe+0x72853
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
wow64cpu.dll!TurboDispatchJumpAddressEnd+0xf5
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x42a
ntdll.dll!RtlUniform+0x6e6
ntdll.dll!EtwEventSetInformation+0x14e0c
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!NtWaitForMultipleObjects+0x15
kernel32.dll!WaitForMultipleObjectsEx+0x8e
kernel32.dll!WaitForMultipleObjects+0x18
kernel32.dll!GetApplicationRecoveryCallback+0x2a7
kernel32.dll!GetApplicationRecoveryCallback+0x166
kernel32.dll!UnhandledExceptionFilter+0x161
kernel32.dll!UnhandledExceptionFilter+0xe0
ntdll.dll!RtlKnownExceptionFilter+0xb7
ntdll.dll!RtlInitializeExceptionChain+0x36