Running an application from cmd with some cmdLine args. WxWidget parses the arguments and passes them to my application. Some methods are run in my app based on those params and than the app finishes. In some cases WxWidget crashes with the following stack. Any suggestions on why this might happen?

0x1022e0184 std::__1::__compressed_pair_elem<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, 0, false>::__get() const + 4 (compressed_pair.h:67)
1   0x1022e0175 std::__1::__compressed_pair<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, std::__1::allocator<wchar_t> >::first() const + 21 (compressed_pair.h:156)
2   0x1022e0095 std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__is_long() const + 21 (string:1459)
3   0x1022e0369 std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::size() const + 25 (string:978)
4   0x1022e0e95 std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::length() const + 21 (string:979)
5   0x1022ddbd5 wxString::length() const + 21 (string.h:1405)
6   0x1020f3ca8 wxPrivate::wxStringAsBufHelper<wchar_t>::Get(wxString const&, unsigned long*) + 40 (string.h:3796)
7   0x1020f3c34 wxCharTypeBuffer<wchar_t> wxString::tchar_str<wchar_t>(unsigned long*) const + 52 (string.h:1627)
8   0x1020f3af5 wxStringTypeBufferBase<wchar_t>::wxStringTypeBufferBase(wxString&, unsigned long) + 69 (string.h:3906)
9   0x1020f3aa5 wxStringTypeBuffer<wchar_t>::wxStringTypeBuffer(wxString&, unsigned long) + 37 (string.h:3990)
10  0x1020ee785 wxStringTypeBuffer<wchar_t>::wxStringTypeBuffer(wxString&, unsigned long) + 37 (string.h:3990)
11  0x1020ee612 wxString::FromAscii(char const*, unsigned long) + 98 (string.cpp:1169)
12  0x1020ee80c wxString::FromAscii(char const*) + 60 (string.cpp:1187)
13  0x102155f0a wxMutexInternal::HandleLockResult(int) + 266 (threadpsx.cpp:371)
14  0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
15  0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
16  0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
17  0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
18  0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
19  0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
20  0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
21  0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
22  0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
23  0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
24  0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
25  0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
26  0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
27  0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
28  0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
29  0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
30  0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
31  0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
32  0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
33  0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
34  0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
35  0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
36  0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
37  0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
38  0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
39  0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
40  0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
41  0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
42  0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
43  0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
44  0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
45  0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
46  0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
47  0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
48  0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)

Could not find any relevant solutions or indication of why this might occur. Application does not have any UI.

1

There are 1 best solutions below

5
VZ. On

The problem is that pthread_mutex_lock() fails with an unexpected error (i.e. not one of EDEADLK, EINVAL or ETIMEDOUT) and trying to log this error results in the same error again and, so, to stack overflow (making this site a good choice for discussing this!).

It would be interesting to know what is the value passed to HandleLockResult(), i.e. what is the actual error, if you can look it up. And, of course, if you can provide simple example reproducing the problem, you should open a bug report in wxWidgets for this.