Getting crash in regcomp() on suse linux,
Following is the backtrace,
0x00007fb4bd90c0e0 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x00007fb4bd90c0e0 in raise () from /lib64/libc.so.6
#1 0x00007fb4bd90d6c1 in abort () from /lib64/libc.so.6
#2 0x00007fb4bd94f427 in __libc_message () from /lib64/libc.so.6
#3 0x00007fb4bd955c43 in malloc_printerr () from /lib64/libc.so.6
#4 0x00007fb4bd9595b1 in _int_malloc () from /lib64/libc.so.6
#5 0x00007fb4bd95b61a in calloc () from /lib64/libc.so.6
#6 0x00007fb4bd9aca65 in parse_expression () from /lib64/libc.so.6
#7 0x00007fb4bd9ae087 in parse_branch () from /lib64/libc.so.6
#8 0x00007fb4bd9ae1bc in parse_reg_exp () from /lib64/libc.so.6
#9 0x00007fb4bd9ae797 in re_compile_internal () from /lib64/libc.so.6
#10 0x00007fb4bd9b44e9 in regcomp () from /lib64/libc.so.6
Tried changing the const and non-const variables.
should not crash
int main()
{
regex_t myRegEx;
string str = "\\[[0-9]+\\][0-9]+\\[/[0-9]+\\]";
const int retval = regcomp(&myRegEx, str.c_str(), REG_EXTENDED);
return 0;
}
no crash
Related
#my problem:#
1. I create two threads, one real-time thread, one normal thread; both threads have read-write locks, and we bind two threads to one CPU core to run;
2. Two threads will hang,Has anyone encountered such a problem?
3. My Glibc library is libc-2.27.so
#include <sys/prctl.h>
#include <sched.h>
#include <stdio.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include <iostream>
#include <thread>
pthread_rwlock_t qlock;
inline int set_cpu(int i)
{
cpu_set_t mask;
CPU_ZERO(&mask);
CPU_SET(i,&mask);
printf("thread %u, i = %d\n", pthread_self(), i);
if(-1 == pthread_setaffinity_np(pthread_self() ,sizeof(mask),&mask))
{
fprintf(stderr, "pthread_setaffinity_np erro\n");
return -1;
}
return 0;
}
int32_t set_rt_thread(const char *thread_name, uint32_t prio)
{
struct sched_param cfg_param;
int32_t ret = 0;
if (prio > 99)
{
printf("%s rt prio is too big, %u.\n", thread_name, prio);
return -EINVAL;
}
cfg_param.sched_priority = prio;
ret = sched_setscheduler(0, SCHED_RR, &cfg_param);
printf("Cur thread new scheduler = %d.\n", sched_getscheduler(0));
if(ret < 0)
{
printf("%s sched_set scheduler to SCHED_RR error.\n", thread_name);
}
else
{
printf("%s tid=%ld is rt thread now.\n", thread_name, syscall(SYS_gettid));
}
return 0;
}
int32_t set_thread_name(const char *name)
strong text{
return prctl(PR_SET_NAME, name);
}
//thread 1
void thead_input() {
std::string thread_name = "thead_input";
set_thread_name(thread_name.c_str());
set_rt_thread(thread_name.c_str(),90);
set_cpu(5);
while(1) {
pthread_rwlock_wrlock(&qlock);
printf("thead 1\n");
pthread_rwlock_unlock(&qlock);
printf("thread unlock 2\n");
usleep(100);
}
}
//thread 2
void thead_output() {
std::string thread_name = "thead_output";
set_cpu(5);
set_thread_name(thread_name.c_str());
set_rt_thread(thread_name.c_str(),99);
while(1) {
pthread_rwlock_wrlock(&qlock);
std::cout<<"thead 2"<<std::endl;
pthread_rwlock_unlock(&qlock);
usleep(100);
}
}
//main function
int main(int argc, char **argv) {
if(pthread_rwlock_init(&qlock, NULL) != 0) {
std::cout<<"pthread rw lock init fail\n"<<std::endl;
return -1;
}
std::thread t1(thead_input);
std::thread t2(thead_output);
t1.join();
t2.join();
return 0;
}
Debug log:
[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
0x0000007f899de31c in __GI___pthread_timedjoin_ex
(threadid=547765662160, thread_return=0x0, abstime=0x0,
block=<optimized out>) at pthread_join_common.c:89 89 pthread_join_common.c: No such file or directory. (gdb) thread
apply all bt
Thread 3 (Thread 0x7f88e0a1d0 (LWP 21439)):
#0 __pthread_rwlock_wrlock_full (abstime=0x0, rwlock=0x5577ff2020 <qlock>) at pthread_rwlock_common.c:679
#1 __GI___pthread_rwlock_wrlock (rwlock=0x5577ff2020 <qlock>) at pthread_rwlock_wrlock.c:27
#2 0x0000005577fdf8b8 in thead_output () at main.cpp:88
#3 0x0000005577fdff64 in std::__invoke_impl<void, void (*)()> (__f=#0x55a376afc8: 0x5577fdf844 <thead_output()>)
at /usr/include/c++/7/bits/invoke.h:60
#4 0x0000005577fdfd30 in std::__invoke<void (*)()> (__fn=#0x55a376afc8: 0x5577fdf844 <thead_output()>)
at /usr/include/c++/7/bits/invoke.h:95
#5 0x0000005577fe04cc in std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>
(this=0x55a376afc8)
at /usr/include/c++/7/thread:234
#6 0x0000005577fe0480 in std::thread::_Invoker >::operator()
(this=0x55a376afc8)
at /usr/include/c++/7/thread:243
#7 0x0000005577fe044c in std::thread::_State_impl
::_M_run (
this=0x55a376afc0) at /usr/include/c++/7/thread:186
#8 0x0000007f898fee14 in ?? () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#9 0x0000007f899dd088 in start_thread (arg=0x7ff794cc5f) at pthread_create.c:463
#10 0x0000007f897964ec in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
Thread 2 (Thread 0x7f8960b1d0 (LWP 21438)):
#0 0x0000007f899e1ef8 in __pthread_rwlock_wrlock_full (abstime=0x0, rwlock=0x5577ff2020 <qlock>)
at pthread_rwlock_common.c:595
#1 __GI___pthread_rwlock_wrlock (rwlock=0x5577ff2020 <qlock>) at pthread_rwlock_wrlock.c:27
#2 0x0000005577fdf7ec in thead_input () at main.cpp:71
#3 0x0000005577fdff64 in std::__invoke_impl<void, void (*)()> (__f=#0x55a376ae78: 0x5577fdf788 <thead_input()>)
at /usr/include/c++/7/bits/invoke.h:60
#4 0x0000005577fdfd30 in std::__invoke<void (*)()> (__fn=#0x55a376ae78: 0x5577fdf788 <thead_input()>)
at /usr/include/c++/7/bits/invoke.h:95
#5 0x0000005577fe04cc in std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ul>
(this=0x55a376ae78)
at /usr/include/c++/7/thread:234
#6 0x0000005577fe0480 in std::thread::_Invoker >::operator()
(this=0x55a376ae78)
at /usr/include/c++/7/thread:243
#7 0x0000005577fe044c in std::thread::_State_impl
::_M_run (
this=0x55a376ae70) at /usr/include/c++/7/thread:186
#8 0x0000007f898fee14 in ?? () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#9 0x0000007f899dd088 in start_thread (arg=0x7ff794cc5f) at pthread_create.c:463
#10 0x0000007f897964ec in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
Thread 1 (Thread 0x7f89a75ce0 (LWP 21436)):
#0 0x0000007f899de31c in __GI___pthread_timedjoin_ex (threadid=547765662160, thread_return=0x0, abstime=0x0,
block=<optimized out>) at pthread_join_common.c:89
#1 0x0000007f898ff0a8 in std::thread::join() () from /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#2 0x0000005577fdf9cc in main (argc=1, argv=0x7ff794ce98) at main.cpp:104
I have a class that calls a function depending on a value passed in. The function is void with no parameters and is stored in a map (along with some other information).
The program compiles and the function golden_retriever works as expected but when labrador is called the program SIGSEVs with the following information in gdb (beyond #5 it is out of the test class and into the actual code):
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) where
#0 0x0000000000000000 in ?? ()
#1 0x000000000040dc71 in std::_Mem_fn<void (TestHandlerTwo::*)()>::operator()<, void>(TestHandlerTwo*) const (this=0x6416c0, __object=0x641400)
at /usr/include/c++/4.8/functional:601
#2 0x000000000040d600 in std::_Bind<std::_Mem_fn<void (TestHandlerTwo::*)()> (TestHandlerTwo*)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) (this=0x6416c0,
__args=<unknown type in /home/master/splint/SplintApp/test, CU 0x1eee, DIE 0x140c8>)
at /usr/include/c++/4.8/functional:1296
#3 0x000000000040c90c in std::_Bind<std::_Mem_fn<void (TestHandlerTwo::*)()> (TestHandlerTwo*)>::operator()<, void>() (this=0x6416c0) at /usr/include/c++/4.8/functional:1355
#4 0x000000000040bcf3 in std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (TestHandlerTwo::*)()> (TestHandlerTwo*)> >::_M_invoke(std::_Any_data const&) (
__functor=...) at /usr/include/c++/4.8/functional:2071
#5 0x000000000040ab5c in std::function<void ()>::operator()() const (this=0x641690)
at /usr/include/c++/4.8/functional:2471
The code:
#include <iostream>
#include <map>
#include <memory>
struct command
{
std::string cmdname; // console friendly name
std::function<void()> execute; // function to call
};
class IHandler
{
public:
virtual void parse(int value) = 0;
};
class BaseHandler : public IHandler
{
public:
virtual auto getCommandMap() -> std::map<int, command> const = 0;
void parse(int value) override
{
// this normally takes a stream of bytes and parses it but for this example we hardcode it.
auto search = getCommandMap().find(value);
if (search == getCommandMap().end())
{
return;
}
std::cout << "Function is " << (search->second.execute ? "callable" : "not callable") << std::endl;
if (search->second.execute)
{
search->second.execute();
}
return;
}
};
void golden_retriever()
{
std::cout << "Chases cat" << std::endl;
}
class TestHandlerTwo : public BaseHandler
{
std::map<int, command> commandMap =
{
{ 0x02, { "Handled", golden_retriever } },
{ 0x03, { "Test", std::bind(&TestHandlerTwo::labrador, this) } }
};
public:
void labrador()
{
std::cout << "Chases birds" << std::endl;
}
virtual auto getCommandMap() -> std::map<int, command> const override
{
return commandMap;
}
};
int main(int argc, char* argv[])
{
auto testHandler = std::shared_ptr<IHandler>(new TestHandlerTwo());
testHandler->parse(0x02);
testHandler->parse(0x03);
return 0;
}
The output of which is:
(gdb) run
Starting program: /home/master/test/main
Function is callable
Chases cat
Function is callable
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
My usage of bind seems correct according to this article and question already asked on StackOverflow, so what is wrong with my code?
You are accessing the iterator after the container (map) has destroyed.
At BaseHandler::parse
void parse(int value) override
{
// !!here, you constructs a map, and destruct it immediately
// which invalidates the iterator
// auto search = getCommandMap().find(value);
// if (search == getCommandMap().end())
// {
// return;
// }
// change to these three lines
auto&& commandMap = getCommandMap();
auto&& search = commandMap.find(value);
if (search == commandMap.end()) return;
std::cout << "Function is " << (search->second.execute ? "callable" : "not callable") << std::endl;
if (search->second.execute)
{
search->second.execute();
}
return;
}
See BaseHandler::getCommandMap
// this always create a copy of original map, which considered
// temporary, destroys after execution of the statement if not
// being explicitly held.
virtual auto getCommandMap() -> std::map<int, command> const = 0;
I believe I have an SDL2 bug here and I wanted some verification. When I create a renderer it is invalid and I cannot initialize SDL_ttf because of this. Here is a quick demo program that exhibits the issue on my xubuntu 14.04 distribution. My graphics card is an NVIDIA GTX 550 Ti. Driver version 331.113 proprietary, tested.
#include <SDL2/SDL.h>
#include <string>
#include <stdexcept>
#include <iostream>
using namespace std;
int main() {
SDL_Window* _window;
SDL_Renderer* _renderer;
if( SDL_Init( SDL_INIT_EVERYTHING ) != 0 ) {
string error( SDL_GetError() );
throw runtime_error( "SDL could not initialize! SDL Error: " + error );
}
_window = SDL_CreateWindow( "Conscious", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, 500, 500, SDL_WINDOW_SHOWN );
if( _window == NULL ) {
string error( SDL_GetError() );
throw runtime_error( "Window could not be created! SDL Error: " + error );
}
_renderer = SDL_CreateRenderer( _window , -1,
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC );
if( _renderer == NULL ) {
string error( SDL_GetError() );
throw runtime_error( "Renderer could not be created! SDL Error: " + error );
}
cout << SDL_GetError() << endl;
return 0;
}
Let me know what you think!
Thanks,
Jonathon
--EDIT--
If you take out SDL_image and SDL_ttf the renderer is still returned as invalid.
Also this does not happen on windows with the same exact hardware. If this is not a bug would somebody please explain what could be wrong with such a simple example?
--EDIT EDIT--
This code prints out "Invalid renderer" on my system. If you have SDL2 please run it and let me know if you do too.
While it is indeed produces 'Invalid renderer' message, it isn't a problem because as SDL_GetError documentation states You must check the return values of SDL function calls to determine when to appropriately call SDL_GetError()., and SDL gave you no reason to look for error description in GetError.
Why it happens, by the way:
Breakpoint 1, 0x00007ffff7b00e90 in SDL_SetError_REAL () from /usr/lib64/libSDL2-2.0.so.0
(gdb) backtrace
#0 0x00007ffff7b00e90 in SDL_SetError_REAL () from /usr/lib64/libSDL2-2.0.so.0
#1 0x00007ffff7b8f124 in SDL_GL_GetProcAddress_REAL () from /usr/lib64/libSDL2-2.0.so.0
#2 0x00007ffff7b8f80b in SDL_GL_GetAttribute_REAL () from /usr/lib64/libSDL2-2.0.so.0
#3 0x00007ffff7b41bcf in GL_CreateRenderer () from /usr/lib64/libSDL2-2.0.so.0
#4 0x00007ffff7b3b66c in SDL_CreateRenderer_REAL () from /usr/lib64/libSDL2-2.0.so.0
#5 0x0000000000401383 in main ()
GL_CreateRenderer calls SDL_GetAttribute to get context version and such, which tries to load GL functions, which requires active renderer, but it isn't there yet. While not most eye-pleasant solution, it works well and it isn't a bug. Probable reason why you don't have it on windows is e.g. because it uses different renderer (d3d?).
This code works on GNU/Linux but I can't find how to make it run on Mac OS X Lion.
Here is a test code. Nothing too hard to understand, only an empty window waiting for a quit event to stop. If I comment the glClear call, everything works fine... in fact glClear or any gl call makes it crash on a nice Segmentation fault.
Here is the code :
#include <iostream>
#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
int main( int ac, char **av )
{
SDL_Surface *screen;
SDL_Init( SDL_INIT_VIDEO );
if(SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8) < 0) { printf("opengl error: %s\n", SDL_GetError()); }
if(SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8) < 0) { printf("opengl error: %s\n", SDL_GetError()); }
if(SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8) < 0) { printf("opengl error: %s\n", SDL_GetError()); }
if(SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32) < 0) { printf("opengl error: %s\n", SDL_GetError()); }
if(SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) < 0) { printf("couldn't set double buffering: %s\n", SDL_GetError()); }
if ( (screen = SDL_SetVideoMode( 640, 480, 32, SDL_OPENGL | SDL_NOFRAME | SDL_DOUBLEBUF )) == NULL )
{
exit( EXIT_FAILURE );
}
SDL_WM_SetCaption( "test", NULL );
bool loop = true;
SDL_Event event;
while ( loop )
{
glClear( GL_COLOR_BUFFER_BIT );
SDL_PollEvent( &event );
switch ( event.type )
{
case SDL_QUIT:
loop = false;
break;
}
}
SDL_Quit();
return 0;
}
Here is the how I compile it:
g++ -g -I/opt/local/include -I/usr/X11R6/include -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -L/usr/X11R6/lib -lGL main.cpp
gdb does not help me so much:
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x000000010000269d in SDL_main (ac=1, av=0x100517c90) at main.cpp:28
#2 0x0000000100002360 in -[SDLMain applicationDidFinishLaunching:] ()
#3 0x00007fff90bc2de2 in __-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 ()
#4 0x00007fff8c354e0a in _CFXNotificationPost ()
#5 0x00007fff90baf097 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#6 0x00007fff8a49faa7 in -[NSApplication _postDidFinishNotification] ()
#7 0x00007fff8a49f80d in -[NSApplication _sendFinishLaunchingNotification] ()
#8 0x00007fff8a49e4d2 in -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] ()
#9 0x00007fff8a49e233 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()
#10 0x00007fff8c39e851 in -[NSObject performSelector:withObject:withObject:] ()
#11 0x00007fff90be589b in __-[NSAppleEventManager setEventHandler:andSelector:forEventClass:andEventID:]_block_invoke_1 ()
#12 0x00007fff90be4822 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#13 0x00007fff90be46b0 in _NSAppleEventManagerGenericHandler ()
#14 0x00007fff8e760c25 in aeDispatchAppleEvent ()
#15 0x00007fff8e760b03 in dispatchEventAndSendReply ()
#16 0x00007fff8e7609f7 in aeProcessAppleEvent ()
#17 0x00007fff912a1b6d in AEProcessAppleEvent ()
#18 0x00007fff8a49b63d in _DPSNextEvent ()
#19 0x00007fff8a49acf5 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#20 0x00007fff8a49762d in -[NSApplication run] ()
#21 0x0000000100002174 in main ()
I'm not sure, but IIRC you need to add the OpenGL framework as well, if using SDL for window and context creation.
OS: MAC X 10.7.0
The Mac OS X install an older version of wxMac(wxMac-2.8.8.1) in /usr, but I install a newer one(wxMac-2.8.12.0) in /usr/local. To install it, I compile the new one with the flag:
arch_flags="-arch i386"
./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" --enable-unicode --enable-debug --disable-shared
Then I write a simple program(hello2.cpp) to test it:
#include "wx/wx.h"
class HelloWorldApp : public wxApp
{
public:
virtual bool OnInit();
private:
wxButton *button;
};
IMPLEMENT_APP(HelloWorldApp)
bool HelloWorldApp::OnInit()
{
wxFrame *frame = new wxFrame((wxFrame*) NULL, -1, _T("Hello wxWidgets World"));
frame->CreateStatusBar();
frame->SetStatusText(_T("Hello World"));
button = new wxButton((wxFrame *)frame, -2, _T("123"));
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
I compile this test program in the command line with the flag:
g++ hello2.cpp /usr/local/bin/wx-config --cxxflags --libs -o hello2
But I receive some warnings and errors. I am a newbie in Mac programming, so I don't know the reason. I just have to say: help!
Here is the result of compiling:
ld: warning: in /usr/local/lib/libiconv.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols:
"_libiconv_open", referenced from:
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
"_libiconv", referenced from:
wxMBConv_iconv::GetMBNulLen() const in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::WC2MB(char*, wchar_t const*, unsigned long) constin libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::WC2MB(char*, wchar_t const*, unsigned long) constin libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::MB2WC(wchar_t*, char const*, unsigned long) constin libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::MB2WC(wchar_t*, char const*, unsigned long) constin libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::wxMBConv_iconv(wchar_t const*)in libwx_base_carbonud-2.8.a(baselib_strconv.o)
"_libiconv_close", referenced from:
wxMBConv_iconv::~wxMBConv_iconv()in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::~wxMBConv_iconv()in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::~wxMBConv_iconv()in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::~wxMBConv_iconv()in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::~wxMBConv_iconv()in libwx_base_carbonud-2.8.a(baselib_strconv.o)
wxMBConv_iconv::~wxMBConv_iconv()in libwx_base_carbonud-2.8.a(baselib_strconv.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I uninstall wxMac-2.8.12.
I installl wxWidgets-2.9.2(./configure --enable-unicode --enable-debug --disable-shared)
I compile the test program with g++ hello2.cpp `/usr/local/bin/wx-config --cxxflags --libs` -o hello2 again. There only one warning:
ld: warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file
I think that's OK.