Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash instead of "can't do that operation" dialog in AppVeyor build #490

Closed
rpavlik opened this issue Sep 21, 2019 · 6 comments · Fixed by #560
Closed

Crash instead of "can't do that operation" dialog in AppVeyor build #490

rpavlik opened this issue Sep 21, 2019 · 6 comments · Fixed by #560

Comments

@rpavlik
Copy link
Contributor

rpavlik commented Sep 21, 2019

System information

SolveSpace version: 5d78f99 - Windows artifact from AppVeyor

Operating system: Windows 10

Expected behavior

When I accidentally clicked "other supplementary angle" instead of "constraint angle" (with 2 line segments selected) I assume it was supposed to tell me I goofed with a message box.

Actual behavior

It crashed.

Additional information

EDIT: OK, this is actually reproducible. Open "bothparts" and on the topmost sketch, click these two lines and then hit the "other angle" button. Crashes on Windows at least.
image
circuit box.zip

@rpavlik rpavlik changed the title Crash when clicking "other angle" when there is no angle to act on. Crash when clicking "other supplementary angle" when there is no angle to act on. Sep 21, 2019
@whitequark whitequark added the bug label Sep 22, 2019
@whitequark
Copy link
Contributor

Can't reproduce here. Could you grab a backtrace?

@rpavlik
Copy link
Contributor Author

rpavlik commented Mar 7, 2020

ah ha. I can't reproduce in my local build (with vs2019) but this, as well as other things that should pop up a dialog (drawing a rectangle without a workplane, etc) all crash the AppVeyor build. Looks like there's something wrong with that build which is causing crashes instead of popups.

@rpavlik rpavlik changed the title Crash when clicking "other supplementary angle" when there is no angle to act on. Crash instead of "can't do that operation" dialog in AppVeyor build Mar 7, 2020
@whitequark
Copy link
Contributor

There's debug information uploaded from AppVeyor, do you think you can use that in MSVC to grab a backtrace?

@rpavlik
Copy link
Contributor Author

rpavlik commented Mar 8, 2020

ah, yeah probably, will give it a shot

@rpavlik
Copy link
Contributor Author

rpavlik commented Mar 10, 2020

"Unhandled exception at 0x014C0713 in solvespace.exe: An invalid parameter was passed to a function that considers invalid parameters fatal. occurred"

>	solvespace.exe!_invoke_watson(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned int pReserved) Line 132	C++
 	solvespace.exe!_invalid_parameter(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned int pReserved) Line 86	C++
 	solvespace.exe!std::_String_const_iterator<std::_String_val<std::_Simple_types<char>>>::operator*() Line 80	C++
 	solvespace.exe!std::_String_iterator<std::_String_val<std::_Simple_types<char>>>::operator*() Line 336	C++
 	solvespace.exe!MessageBox(const char * fmt, char * va, bool error, std::function<void __cdecl(void)> onDismiss) Line 142	C++
 	solvespace.exe!SolveSpace::Error(const char * fmt, ...) Line 183	C++
 	solvespace.exe!SolveSpace::GraphicsWindow::MouseLeftDown(double mx, double my, bool shiftDown, bool ctrlDown) Line 995	C++
 	solvespace.exe!SolveSpace::GraphicsWindow::MouseEvent(SolveSpace::Platform::MouseEvent event) Line 898	C++
 	solvespace.exe!std::_Pmf_wrap<bool (__thiscall SolveSpace::GraphicsWindow::*)(SolveSpace::Platform::MouseEvent),bool,SolveSpace::GraphicsWindow,SolveSpace::Platform::MouseEvent>::operator()(SolveSpace::GraphicsWindow * _Pfnobj, SolveSpace::Platform::MouseEvent <_Fargs_0>) Line 1230	C++
 	solvespace.exe!std::_Bind<1,bool,std::_Pmf_wrap<bool (__thiscall SolveSpace::GraphicsWindow::*)(SolveSpace::Platform::MouseEvent),bool,SolveSpace::GraphicsWindow,SolveSpace::Platform::MouseEvent>,SolveSpace::GraphicsWindow * const,std::_Ph<1> &>::_Do_call<SolveSpace::Platform::MouseEvent,0,1>(std::tuple<SolveSpace::Platform::MouseEvent &> _Myfargs, std::_Arg_idx<0,1> __formal) Line 1150	C++
 	solvespace.exe!std::_Bind<1,bool,std::_Pmf_wrap<bool (__thiscall SolveSpace::GraphicsWindow::*)(SolveSpace::Platform::MouseEvent),bool,SolveSpace::GraphicsWindow,SolveSpace::Platform::MouseEvent>,SolveSpace::GraphicsWindow * const,std::_Ph<1> &>::operator()<SolveSpace::Platform::MouseEvent>(SolveSpace::Platform::MouseEvent && <_Fargs_0>) Line 1138	C++
 	solvespace.exe!std::_Callable_obj<std::_Bind<1,bool,std::_Pmf_wrap<bool (__thiscall SolveSpace::GraphicsWindow::*)(SolveSpace::Platform::MouseEvent),bool,SolveSpace::GraphicsWindow,SolveSpace::Platform::MouseEvent>,SolveSpace::GraphicsWindow * const,std::_Ph<1> &>,0>::_ApplyX<bool,SolveSpace::Platform::MouseEvent>(SolveSpace::Platform::MouseEvent && <_Args_0>) Line 284	C++
 	solvespace.exe!std::_Func_impl<std::_Callable_obj<std::_Bind<1,bool,std::_Pmf_wrap<bool (__thiscall SolveSpace::GraphicsWindow::*)(SolveSpace::Platform::MouseEvent),bool,SolveSpace::GraphicsWindow,SolveSpace::Platform::MouseEvent>,SolveSpace::GraphicsWindow * const,std::_Ph<1> &>,0>,std::allocator<std::_Func_class<bool,SolveSpace::Platform::MouseEvent>>,bool,SolveSpace::Platform::MouseEvent>::_Do_call(SolveSpace::Platform::MouseEvent && <_Args_0>) Line 229	C++
 	solvespace.exe!std::_Func_class<bool,SolveSpace::Platform::MouseEvent>::operator()(SolveSpace::Platform::MouseEvent <_Args_0>) Line 315	C++
 	solvespace.exe!SolveSpace::Platform::WindowImplWin32::WndProc(HWND__ * h, unsigned int msg, unsigned int wParam, long lParam) Line 951	C++

@rpavlik
Copy link
Contributor Author

rpavlik commented Mar 10, 2020

Specifically, the MessageBox issue location is:

   142:     while(isspace(*it)) it++;
00DCEC69  movsx       ecx,byte ptr [eax]  
00DCEC6C  push        ecx  
00DCEC6D  call        isspace (014C5FD0h)  
00DCEC72  add         esp,4  
00DCEC75  test        eax,eax  
00DCEC77  je          MessageBox+29Ah (0DCEC9Ah)  
00DCEC79  push        0  
00DCEC7B  lea         edx,[ebp-144h]  
00DCEC81  push        edx  
00DCEC82  lea         ecx,[it]  
00DCEC88  call        std::_String_iterator<std::_String_val<std::_Simple_types<char> > >::operator++ (0DD1300h)  
00DCEC8D  lea         ecx,[ebp-144h]  
00DCEC93  call        std::_Vector_iterator<std::_Vecto

The fact that this is in a varargs call does not make me very confident in my ability to track it down, unfortunately. C-style varargs are definitely "not my thing"

Wonder if this is the old "std::string(nullptr) goes boom" or something like it...

The value of f looks weird... though I guess if it's the varargs content...
image

Here's the locals one stack frame deeper, inside messagebox:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants