A.k.a. crashes to desktop without any errors.
Is it possible to run it through visual studio debugger or something?
Any other debuggers that might help with this?
It's really frustrating when it crashes after 10-20 min of playing, and you can't determine what exactly caused it.
I'm using ffi, so I think that may be the source, but it is possible to at least give me a clue that, yes, the crash happened there?
How does one debug silent crashes?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Party member
- Posts: 234
- Joined: Mon Aug 29, 2016 8:51 am
Re: How does one debug silent crashes?
These are the worst. I don't think you can do much more than take a look at the disassembly around the generated code that causes the crash, to try to match it to the real code, but that's hard work. I know how to do that with gdb, though, not with VS.
FFI issues can be subtle. See https://github.com/gvx/bitser/issues/9# ... -436060611
FFI issues can be subtle. See https://github.com/gvx/bitser/issues/9# ... -436060611
-
- Party member
- Posts: 234
- Joined: Mon Aug 29, 2016 8:51 am
Re: How does one debug silent crashes?
Hah, coincidentally I also had to solve a silent crash with bitser - the buffer size was too small and overflowed causing a segmentation fault. It was painful to debug.
But doesn't Lua run embedded on C/C++ (Love2d)? If so, is it possible to run love2d with the project in Visual Studio's C\C++ debugger?
But doesn't Lua run embedded on C/C++ (Love2d)? If so, is it possible to run love2d with the project in Visual Studio's C\C++ debugger?
Re: How does one debug silent crashes?
If you favor speed over serialized size, you could take a look at my moonblob library. It's cleaner, well tested code, easier to debug in case of errors and much faster than bitser and bitser - but creates less compact results in the general case. Simple LÖVE example.KayleMaster wrote: ↑Mon Dec 02, 2019 3:54 pm Hah, coincidentally I also had to solve a silent crash with bitser - the buffer size was too small and overflowed causing a segmentation fault. It was painful to debug.
You can run any executable in a debugger, but the stacktrace you're getting from a crash in LuaJIT is ususally not very helpful; at least it was never helpful to me. Been in that situation a couple times myself.But doesn't Lua run embedded on C/C++ (Love2d)? If so, is it possible to run love2d with the project in Visual Studio's C\C++ debugger?
Re: How does one debug silent crashes?
No, a stack trace won't help, unfortunately. Examining the disassembly is the best bet, and then there's the problem that you have no symbols whatsoever.
I remember a thread dedicated to one of those. Did you find the issue?
Re: How does one debug silent crashes?
I can't remember details anymore, just that examining my own code thoroughly in these situations always led me to the cause - usually off-by-one errors when accessing ffi-allocated memory - faster than trying to make sense of the crash context and disassembly in a debugger, which can be a pretty frustrating experience, at least for me.
Who is online
Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot] and 50 guests