Invalid bounds arguments passed to std::clamp

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Invalid bounds arguments passed to std::clamp

Postby Player701 » Thu Nov 25, 2021 9:08 am

In debug builds, it is possible to get an assertion failure error with the following message: "Invalid bounds arguments passed to std::clamp". This seems to depend on the screen size, so I'm attaching my ini file to help reproduce the issue.

To reproduce, start GZDoom and select the Heretic, Hexen, or Strife IWAD (for some reason this error does not appear when using a Doom IWAD). There is no need to fire up a level.

Tested in GZDoom g4.8pre-84-gaf54991c2.
You do not have the required permissions to view the files attached to this post.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Invalid bounds arguments passed to std::clamp

Postby Graf Zahl » Thu Nov 25, 2021 9:20 am

A stack trace would be more helpful. We got a similar report for Raze but are unable to reproduce it on any of the development systems.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Invalid bounds arguments passed to std::clamp

Postby Player701 » Thu Nov 25, 2021 9:56 am

I've been able to successfully reproduce the issue on my laptop with the same INI file. The call stack is the following in all cases (regardless of the IWAD that is being used or whether or not -warp is specified):

Code: Select allExpand view
>   gzdoom.exe!std::clamp<int,std::less<void>>(const int & _Val, const int & _Min_val, const int & _Max_val, std::less<void> _Pred) Line 10170   C++
    gzdoom.exe!std::clamp<int>(const int & _Val, const int & _Min_val, const int & _Max_val) Line 10190   C++
    gzdoom.exe!GetConScale(F2DDrawer * drawer, int altval) Line 168   C++
    gzdoom.exe!active_con_scale(F2DDrawer * drawer) Line 255   C++
    gzdoom.exe!C_DrawConsole() Line 579   C++
    gzdoom.exe!D_Display() Line 1086   C++
    gzdoom.exe!D_DoomLoop() Line 1219   C++
    gzdoom.exe!D_DoomMain_Internal() Line 3591   C++
    gzdoom.exe!GameMain() Line 3616   C++
    gzdoom.exe!DoMain(HINSTANCE__ * hInstance) Line 981   C++
    gzdoom.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * nothing, wchar_t * cmdline, int nCmdShow) Line 1270   C++
    [External Code]

However, when I was using debug builds to test my mod (which has a custom HUD) on my PC, the error happened in a different place, namely, when calling DStatusBarCore::SetClipRect. I am unable to reproduce this stack trace with a release build of the mod, and I don't have the current testing version here on my laptop. But if necessary, I can get it from my PC and test again - it will take some time though.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Invalid bounds arguments passed to std::clamp

Postby Graf Zahl » Thu Nov 25, 2021 10:05 am

It looks lilke these are ancient bugs that were silently accepted by our internal clamp function but seem to trip over the one from the STL...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest