Mac problems with shared builds

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Mac problems with shared builds

Post by Ryan Norton » Sat Aug 20, 2005 8:55 am

OK, building is good, but then at runtime with the controls sample I get a bunch of asserts -
01:44:36: Debug: ../src/common/artprov.cpp(195): assert "wxAssertFailure" failed: no wxArtProvider exists
01:44:52: Debug: ../src/mac/carbon/icon.cpp(72): assert "wxAssertFailure" failed: invalid icon
01:44:54: Debug: ../src/mac/carbon/icon.cpp(79): assert "wxAssertFailure" failed: invalid icon
01:44:54: Debug: ../src/mac/carbon/icon.cpp(72): assert "wxAssertFailure" failed: invalid icon
01:44:55: Debug: ../src/mac/carbon/icon.cpp(79): assert "wxAssertFailure" failed: invalid icon
01:44:55: Debug: ../src/mac/carbon/bitmap.cpp(182): assert "m_hBitmap" failed: Unable to create GWorld context
01:44:56: Debug: ../src/mac/carbon/dc.cpp(418): assert "wxAssertFailure" failed: Invalid dc wxDC::DoDrawIcon
01:44:57: Debug: ../src/common/artprov.cpp(159): assert "wxAssertFailure" failed: no wxArtProvider exists
01:44:58: Debug: ../src/common/artprov.cpp(159): assert "wxAssertFailure" failed: no wxArtProvider exists
01:44:58: Debug: ../src/common/artprov.cpp(159): assert "wxAssertFailure" failed: no wxArtProvider exists
Now with my mediaplayer sample I get another error that actually crashes the program:
[Ryan-Nortons-Computer:mb/samples/mediaplayer] ryannorton% gdb ./mediaplayer
GNU gdb 5.3-20021014 (Apple version gdb-250) (Sat Dec 7 02:14:27 GMT 2002)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "powerpc-apple-macos10".
Reading symbols for shared libraries ....... done
(gdb) run
Starting program: /Users/ryannorton/wxWidgets/mb/samples/mediaplayer/mediaplayer
[Switching to process 2653 thread 0xb03]
Reading symbols for shared libraries . done
Reading symbols for shared libraries ............................................................ done

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x015b05ec in wxMBConv::cMB2WC(char const*) const (this=0x16e06a8, psz=0xbffff0e0 "239") at ../src/common/strconv.cpp:181
181 size_t nLen = MB2WC(NULL, psz, 0);
(gdb) bt
#0 0x015b05ec in wxMBConv::cMB2WC(char const*) const (this=0x16e06a8, psz=0xbffff0e0 "239") at ../src/common/strconv.cpp:181
#1 0x0166198c in wxMBConv::cMB2WX(char const*) const (this=0x16e06a8, psz=0xbffff0e0 "239") at ../include/wx/strconv.h:62
#2 0x015d5734 in wxVsnprintf_(wchar_t*, unsigned long, wchar_t const*, char*) (buf=0x2d6e9c, lenMax=1024, format=0x1630a80, argptr=0xbffff6c8 "\001d\177\024") at ../src/common/wxchar.cpp:372
#3 0x015bdcb8 in wxString::PrintfV(wchar_t const*, char*) (this=0xbffff6e0, pszFormat=0x1630a80, argptr=0xbffff6c0 "\001d~�") at ../src/common/string.cpp:1832
#4 0x015bdbfc in wxString::Printf(wchar_t const*, ...) (this=0xbffff6e0, pszFormat=0x1630a80) at ../src/common/string.cpp:1806
#5 0x0155bd34 in ShowAssertDialog(wchar_t const*, int, wchar_t const*, wchar_t const*, wxAppTraits*) (szFile=0x1647eb0, nLine=239, szCond=0x1647f14, szMsg=0x1647fb4, traits=0x0) at ../src/common/appbase.cpp:788
#6 0x0155ba50 in wxOnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*) (szFile=0x1647eb0, nLine=239, szCond=0x1647f14, szMsg=0x1647fb4) at ../src/common/appbase.cpp:640
#7 0x0155b9ac in wxAssert(int, wchar_t const*, int, wchar_t const*, wchar_t const*) (cond=0, szFile=0x1647eb0, nLine=239, szCond=0x1647f14, szMsg=0x1647fb4) at ../src/common/appbase.cpp:612
#8 0x015acf64 in wxClassInfo::Register() (this=0xb036008) at ../src/common/object.cpp:239
#9 0x0af851a8 in wxClassInfo::wxClassInfo(wchar_t const*, wxClassInfo const*, wxClassInfo const*, int, wxObject* (*)()) (this=0xb036008, className=0xaf29d14, baseInfo1=0x16b5a2c, baseInfo2=0x0, size=44, ctor=0xada0944 <wxIdleEvent::wxCreateObject()>) at ../include/wx/object.h:76
#10 0x0af82818 in wxClassInfo::wxClassInfo(wchar_t const*, wxClassInfo const*, wxClassInfo const*, int, wxObject* (*)()) (this=0xb036008, className=0xaf29d14, baseInfo1=0x16b5a2c, baseInfo2=0x0, size=44, ctor=0xada0944 <wxIdleEvent::wxCreateObject()>) at ../include/wx/object.h:68
#11 0x0af67b4c in __static_initialization_and_destruction_0(int, int) (__initialize_p=1, __priority=65535) at ../src/common/event.cpp:71
#12 0x0af6a3d4 in _GLOBAL__I__ZN11wxIdleEvent12ms_classInfoE () at ../src/common/event.cpp:367
#13 0x8fe16350 in __dyld_call_module_initializers_for_library ()
#14 0x8fe160e4 in __dyld_call_module_initializers ()
#15 0x8fe133ac in __dyld__dyld_make_delayed_module_initializer_calls ()
#16 0x00002c68 in _call_mod_init_funcs () at /SourceCache/Csu/Csu-45/crt.c:299
#17 0x00002b50 in _start (argc=1, argv=0xbffffd54, envp=0xbffffd5c) at /SourceCache/Csu/Csu-45/crt.c:217
#18 0x00002ab0 in start ()
The line it crashes on is the assert in object.cpp

Code: Select all

    // Using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you
    // link any object module twice mistakenly, or link twice against wx shared
    // library) will break this function because it will enter an infinite loop
    // and eventually die with "out of memory" - as this is quite hard to
    // detect if you're unaware of this, try to do some checks here.
    wxASSERT_MSG( sm_classTable->Get(m_className) == NULL,
                  _T("class already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() twice (may be by linking some object module(s) twice)
?") );
Any ideas on any of these? (static builds work perfectly)

OS X 10.2, CVS, unicode debug shared
[Mostly retired moderator, still check in to clean up some stuff]

Post Reply