Comments (16)
Right, it's basically just critical bugfixes and very minor accessibility features from here on out. (Maybe making controller support a little better too?)
from vvvvvv.
Pretty much all the large variables are off the stack now - if someone on Win64 finds an overflow they can reopen this, otherwise I think this is covered.
from vvvvvv.
Flibit's comments are a bit outdated now. #129 made it so that the core classes are now allocated outside of any function, which should mean they're no longer on the stack. Furthermore, #188 got rid of all the reference passing entirely.
from vvvvvv.
All that's being done now is waiting for the original author (or anyone who has had this problem happen to them before) to report back and say "Yes, this is fixed now" or "No, it's still a problem".
from vvvvvv.
Could be related to how main
apparently uses over 16kB of stack...
C6262: Function uses '17264' bytes of stack: exceeds /analyze:stacksize '16384'. Consider moving some data to heap.
from vvvvvv.
I suppose this only happens with Win64? I don’t see this with Win32, Linux, or macOS.
from vvvvvv.
You may have to add something like this to the Win32 portion of the CMake exe line:
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:???")
Not sure what a good value would be.
from vvvvvv.
The game does appear to use a surprising amount of stack. It's something that should be looked at.
Currently, the main()
function keeps most game and asset related objects on the stack (which I assume to be pretty large in size), namely this block in main()
:
VVVVVV/desktop_version/src/main.cpp
Lines 94 to 103 in 8826f57
I assume this was done because these classes depend on some libraries already being initialized.
Some other game objects are in the data section (outside of any function):
VVVVVV/desktop_version/src/main.cpp
Lines 32 to 35 in 8826f57
from vvvvvv.
The game does appear to use a surprising amount of stack. It's something that should be looked at.
Currently, the
main()
function keeps most game and asset related objects on the stack (which I assume to be pretty large in size), namely this block inmain()
:VVVVVV/desktop_version/src/main.cpp
Lines 94 to 103 in 8826f57
I assume this was done because these classes depend on some libraries already being initialized.
Some other game objects are in the data section (outside of any function):
VVVVVV/desktop_version/src/main.cpp
Lines 32 to 35 in 8826f57
It's probably the array allocations you speak of later as there are no big stack allocations in the Graphics
or musicclass
as far as I can see. The large size objects are stored into std::vector
s. Likewise for the strings std::string
is used.
Perhaps the incredible amount of member fields used in these classes eventually add up too...
It could probably help getting rid of these array allocations and simply create an std::vector<T>
of the desired size or just malloc
it instead if you really want your raw pointers.
from vvvvvv.
I'd be up for one of two paths:
- Get all the core classes allocated with
new
instead of just having them on the stack. This is way easier said than done, as the game uses those classes absolutely everywhere, and they're passed by reference so you can't just fix the.
->->
in one function and call it a day. This is by far the most work you can do here, and doing it for individual members of the classes would be even worse. - Increase the stack size on Windows at link time. This is what I'm leaning towards, since every other platform I'm aware of has a MUCH bigger default stack size (except for one secret platform that can also fix this trivially), so doing a whole bunch of potentially breaking work for Win64 and only Win64 just seems like a bad idea.
from vvvvvv.
I'd be up for one of two paths:
* Get all the core classes allocated with `new` instead of just having them on the stack. This is _way_ easier said than done, as the game uses those classes absolutely _everywhere_, and they're passed by reference so you can't just fix the `.`->`->` in one function and call it a day. This is by far the most work you can do here, and doing it for individual members of the classes would be even worse. * Increase the stack size on Windows at link time. This is what I'm leaning towards, since every other platform I'm aware of has a MUCH bigger default stack size (except for one secret platform that can also fix this trivially), so doing a whole bunch of potentially breaking work for Win64 and _only_ Win64 just seems like a bad idea.
I'd say the latter is definitely the better option then, given that vvvvvv
isn't going to get major additions to it in the future?
from vvvvvv.
@flibitijibibo Yeah. Submitted an issue for that. #82
Including the built in SDL2 gamepad databaase and updating the button defs in Input.cpp may be all that's needed for updated support. I've been trying my hand locally but no luck as of yet.
from vvvvvv.
Just pushed a patch that moves the memory around quite a bit, does this still happen?
from vvvvvv.
- Get all the core classes allocated with
new
instead of just having them on the stack. This is way easier said than done, as the game uses those classes absolutely everywhere, and they're passed by reference so you can't just fix the.
->->
in one function and call it a day. This is by far the most work you can do here, and doing it for individual members of the classes would be even worse.
You can use std::unique_ptr
instead of raw pointers and, since every function requires a reference, just pass the reference func(*obj_ptr)
or even make a handle reference T& obj_ref = *obj_ptr
(obj_ptr
being std::unique_ptr<T>
or T*
)
from vvvvvv.
You can use
std::unique_ptr
instead of raw pointers
The target for this repo is pre C++11 so you can't, no
from vvvvvv.
Honestly, at this point the issue should be more-or-less fixed. I'd check for myself, but getting a compiling environment set up on Windows is more annoying than it is on Linux, so I don't have the patience for it right now. (Also, I'd need to compile an initial commit build, check that it stack overflows, and if it doesn't figure out why, and then compile a latest commit build with the same settings. I predict I'll have trouble with the "get the initial commit to stack overflow" part in the first place.)
I'd be very surprised if this was still a problem.
from vvvvvv.
Related Issues (20)
- Issues with new official controller layout settings on Steam HOT 16
- Change translation reload keybind from F12 HOT 2
- Indicate which modes are active when loading in to gameplay
- TAB keybinds in roomname translator mode and level debugger conflict
- gitmodules and release version HOT 13
- Tighter integration of custom levels HOT 5
- Add GameCube glyphs HOT 3
- Desktop build for Windows doesn't actually disable exceptions HOT 9
- confusing releases HOT 2
- Help: `vvvvvvmusic.vvv: Header 0's size value goes past end of file` HOT 5
- Wiimote support HOT 3
- Support for Windows XP 32-bit apparently dropped HOT 7
- If you mess with your controller bindings on steam deck, you can lock yourself out of being able to do anything HOT 4
- Unknown, possibly peripheral-related crash HOT 2
- 2.5 TODO
- v2.4.1 crashes on start with old settings file (out-of-range `<stretch>` value) HOT 5
- colored text boxes aren't properly positioned for rescuable crewmates anymore
- Audio dropout issue in 2.4.x (and possibly earlier) on Linux when using Pipewire HOT 2
- Additional Button prompts for additional Controller Types (Steam Controller, Xbox 360, DualShock 3) HOT 1
- The back button on Android does not close the application HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vvvvvv.