Web lists-archives.com

All wx apps crash because of nl_langinfo(CODESET) returns garbage




All wxWidgets-based application crash because call
nl_langinfo(CODESET) returns sometimes garbage during wxWidgets
initialization at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/intl.cpp:811:
    char *oldLocale = strdup(setlocale(LC_CTYPE, NULL));
    setlocale(LC_CTYPE, "");
    const char *alang = nl_langinfo(CODESET);
    setlocale(LC_CTYPE, oldLocale);
    free(oldLocale);
alang variable is not null and garbage here! It causes wxWidgets
assertion failure at wxString::FromAscii().

See poedit stack trace #24
#0  0x68022839 in gdk_window_enable_synchronized_configure () from
/usr/bin/cyggdk-x11-2.0-0.dll
#1  0x6677a5c8 in gtk_window_get_focus_on_map () from
/usr/bin/cyggtk-x11-2.0-0.dll
#2  0x67645dda in g_closure_invoke () from /usr/bin/cyggobject-2.0-0.dll
#3  0x6765f156 in g_signal_emit_valist () from /usr/bin/cyggobject-2.0-0.dll
#4  0x6765f6c7 in g_signal_emit () from /usr/bin/cyggobject-2.0-0.dll
#5  0x6676d898 in gtk_widget_realize () from /usr/bin/cyggtk-x11-2.0-0.dll
#6  0x66778b25 in gtk_window_set_focus () from /usr/bin/cyggtk-x11-2.0-0.dll
#7  0x67645dda in g_closure_invoke () from /usr/bin/cyggobject-2.0-0.dll
#8  0x6765f156 in g_signal_emit_valist () from /usr/bin/cyggobject-2.0-0.dll
#9  0x6765f6c7 in g_signal_emit () from /usr/bin/cyggobject-2.0-0.dll
#10 0x6676cffe in gtk_widget_show () from /usr/bin/cyggtk-x11-2.0-0.dll
#11 0x67667f1b in g_type_create_instance () from /usr/bin/cyggobject-2.0-0.dll
#12 0x6764a69e in g_object_unref () from /usr/bin/cyggobject-2.0-0.dll
#13 0x6764bfb0 in g_object_newv () from /usr/bin/cyggobject-2.0-0.dll
#14 0x6764c768 in g_object_new () from /usr/bin/cyggobject-2.0-0.dll
#15 0x5918ef29 in gtk_assert_dialog_new () at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/gtk/assertdlg_gtk.cpp:498
#16 0x591c62dd in wxGUIAppTraits::ShowAssertDialog (this=0x800828d8,
msg=...) at /usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/gtk/utilsgtk.cpp:299
#17 0x599562fc in ShowAssertDialog (file=..., line=line@entry=1186,
func=..., cond=..., msgUser=..., traits=traits@entry=0x800828d8) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/appbase.cpp:1299
#18 0x59957c00 in wxAppConsoleBase::OnAssertFailure
(this=this@entry=0x80082270, file=file@entry=0x800829f4
L"/usr/src/ports/wxWidgets3.0/wxWidgets3.0-3.0.2.0-2.i686/src/wxPython-src-3.0.2.0/src/common/string.cpp",
line=line@entry=1186,
    func=func@entry=0x800828f4 L"FromAscii",
cond=cond@entry=0x800828bc L"c < 0x80", msg=msg@entry=0x80082834
L"Non-ASCII value passed to FromAscii().") at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/appbase.cpp:778
#19 0x5918e85f in wxApp::OnAssertFailure (this=0x80082270,
file=0x800829f4
L"/usr/src/ports/wxWidgets3.0/wxWidgets3.0-3.0.2.0-2.i686/src/wxPython-src-3.0.2.0/src/common/string.cpp",
line=1186, func=0x800828f4 L"FromAscii", cond=0x800828bc L"c < 0x80",
    msg=0x80082834 L"Non-ASCII value passed to FromAscii().") at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/gtk/app.cpp:507
#20 0x59958131 in wxDefaultAssertHandler (file=...,
line=line@entry=1186, func=..., cond=..., msg=...) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/appbase.cpp:1090
#21 0x599574a5 in wxOnAssert (file=file@entry=0x59aeab64
<wxStreamBuffer::wxStreamBuffer(wxStreamBuffer
const&)::__FUNCTION__+112>
"/usr/src/ports/wxWidgets3.0/wxWidgets3.0-3.0.2.0-2.i686/src/wxPython-src-3.0.2.0/src/common/string.cpp",
line=line@entry=1186,
    func=func@entry=0x59aeb0cc <wxString::FromAscii(char const*,
unsigned int)::__FUNCTION__> "FromAscii", cond=cond@entry=0x59aeaca6
<wxStreamBuffer::wxStreamBuffer(wxStreamBuffer
const&)::__FUNCTION__+434> "c < 0x80",
    msg=msg@entry=0x59aeac58
<wxStreamBuffer::wxStreamBuffer(wxStreamBuffer
const&)::__FUNCTION__+356> L"Non-ASCII value passed to FromAscii().")
at /usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/appbase.cpp:1175
#22 0x59a0fbbc in wxString::FromAscii (ascii=0x8008281c "\005",
ascii@entry=0x80082818 "\b(\b\200\005", len=2) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/string.cpp:1185
#23 0x59a0fdc9 in wxString::FromAscii (ascii=ascii@entry=0x80082818
"\b(\b\200\005") at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/string.cpp:1197
#24 0x599d93f4 in wxLocale::GetSystemEncodingName () at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/intl.cpp:811
#25 0x5918d802 in wxApp::Initialize (this=0x80082270, argc_=@0x28cc20:
1, argv_=0x80081fb8) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/gtk/app.cpp:316
#26 0x599d6c55 in wxEntryStart (argc=@0x28cc20: 1,
argv=argv@entry=0x80081fb8) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/init.cpp:322
#27 0x599d7646 in wxInitialize (argc=1, argv=argv@entry=0x80081fb8) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/init.cpp:531
#28 0x599d769a in wxInitializer::wxInitializer (argv=0x80081fb8,
argc=<optimized out>, this=<synthetic pointer>) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/include/wx/init.h:92
#29 wxEntry (argc=@0x59b47588: 1, argv=0x80081fb8) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/init.cpp:462
#30 0x599d779b in wxEntry (argc=@0x59b47588: 1, argv=0x80081fb8,
argv@entry=0x28cc7c) at
/usr/src/debug/wxWidgets3.0-3.0.2.0-2/src/common/init.cpp:507
#31 0x005179e0 in main (argc=1, argv=0x28cc7c) at
/usr/src/debug/poedit-1.8.9-1/src/edapp.cpp:254

gcc 5.4.0
wxWidgets 3.0.2.0-2
Windows 7 64-bit
CYGWIN_NT-6.1-WOW seven 2.7.0(0.306/5/3) 2017-02-12 13:13 i686 Cygwin

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple