WIP: Windows: Show popup after crash #129974
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#129974
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mano-wii/blender:crash_popup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements a crash dialog for Windows, showing what was discussed in
#128621
Windows: Show popup after crashto WIP: Windows: Show popup after crash@ -48,2 +48,3 @@
*/
void BLI_windows_handle_exception(void *exception);
void BLI_windows_exception_capture(void *exception);
void bli_windows_exception_message_get(char r_message[512]);
lower case functions do not go in public headers they are reserved for static local functions.
@ -479,6 +479,7 @@ if(WIN32)
)
list(APPEND SRC
intern/system_win32.c
intern/system_win32.cc
best to convert system_win32.c to C++ in a separate commit/PR.
Well, that's one point, in this case I created the two files because, for some reason, it was not possible to merge them into just
system_win32.cc
. There are linking errors. I could convertsystem_win32.c
to C++, but the new functions do not get along well if added to the same file.@ -384,6 +384,7 @@ void BLI_system_backtrace(FILE *fp)
SymInitialize(GetCurrentProcess(), NULL, TRUE);
bli_load_symbols();
if (current_exception) {
/* `BLI_windows_exception_log_start` should have been called before. */
BLI_windows_exception_log_start
doesn't exist? you likely meanBLI_windows_exception_capture
?@ -395,3 +396,3 @@
}
void BLI_windows_handle_exception(EXCEPTION_POINTERS *exception)
void BLI_windows_exception_capture(void *exception)
Not a fan of this pattern, it gives the opportunity of use after frees that normally wouldn't happen if you just passed the exception as an argument to the functions that require it. Also having a function called
bli_windows_exception_message_get
not have an exception as input parameter is really strange.@ -414,1 +401,3 @@
fflush(stderr);
}
void bli_windows_exception_message_get(char r_message[512])
lower case
bli_
prefix, but not a static function@ -415,0 +403,4 @@
void bli_windows_exception_message_get(char r_message[512])
{
if (!current_exception) {
/* `BLI_windows_exception_log_start` should have been called before. */
BLI_windows_exception_log_start
doesn't exist? you likely meanBLI_windows_exception_capture
?@ -415,0 +417,4 @@
snprintf(r_message,
512,
"Error : %s\n"
This is more of a UI issue, who is this data for?
If it's for us developers, i'd probably want the ExceptionFlags and any Parameters to be included.
If it's for the end user, there's no need to have the Address and TreadID fields here, as there's literally nothing useful the user can do with that information.
I decided to remove this information from the popup. It wasn't part of the mockup. It was an artistic liberty but it ended up looking ugly.
@ -0,0 +19,4 @@
/** \name showMessageBox
* \{ */
static std::string url_encode(const char *str)
This should probably live elsewhere, seems like a useful function outside of
system_win32
if we're keeping it here, why not just call theUrlEscape
API? input a const char*, output a string feels strangeI don't know what I'm doing wrong, but it's not working:
This code is a bit difficult to debug, so I didn't investigate it, but even so, I have a slight preference for a solution that doesn't use the Windows API since perhaps this code could be exposed later in some BLI header.
@ -0,0 +85,4 @@
* Displays a crash popup with options to open the crash log and report a bug.
* This is based on the `showMessageBox` function in `GHOST_SystemWin32.cc`.
*/
static void showMessageBox(const char *message,
missing
bli_
prefix@ -82,3 +85,3 @@
}
static void sig_handle_crash_backtrace(FILE *fp)
static void crashlog_filepath_get(char filepath[FILE_MAX])
Not convinced this belongs in this file, all other methods are either
MAIN_
orsig_
this feels a bit out of place? @ideasman42 do you have any strong feelings about this?@ -147,2 +148,4 @@
}
}
static void signal_cleanup_and_terminate(int signum)
all other code around here uses
sig_
I'd like @Harley to sign off on the user facing changes, so added him as reviewer.
current_exception
7337fa428dI implemented the solution of opening the last saved .blend. (For this I just stored the directory in
G.filepath_last_blend
whenever a .blend file is written for autosave or for save).(This is not something that has been discussed much, it can be reversed or postponed if fells unsafe).
@blender-bot build
I'll leave that to the UI team, at face value, it is a little strange that a button labelled "close" would open a new blender
I think you're going to have to process the filepath differently, converting directly to
wstring
like that won't work. This is what results when crashing a file calledこんにちは.blend
:I think you'll need to the
UTF16_ENCODE
andUTF16_UN_ENCODE
macros.Well noted @deadpin, fixed :)
(I preferred to use the same solution seen in the original
showMessageBox
).Checkout
From your project repository, check out a new branch and test the changes.