Well, still segfaults after an uneventful debug build:
Program received signal SIGSEGV, Segmentation fault.
0xb7e64e79 in wxStandardPaths::GetInstallPrefix (this=0xbfaeea20) at ../src/unix/stdpaths.cpp:68
68 wxString basename(wxString(wxTheApp->argv[0]).AfterLast(_T('/')));
apparently while trying to get argv[0]. gdb reports "No symbol "wxTheApp" in current context." on trying to inspect, and stepping into the statement results in "Couldn't get registers: No such process." Tried several times to stop gdb at the preceding lines and inspect wxTheApp, but it goes straight to line 68 once entering the function.
My app is in a local project folder, so I tried copying it to /usr/local/bin and running it from home just to see if that would give GetInstallPrefix an argv[0] it might like better: crashed again.
cheers,
Bahman
PS Here's GetInstallPrefix just for reference:
Code: Select all
wxString wxStandardPaths::GetInstallPrefix() const
{
if ( m_prefix.empty() )
{
wxStandardPaths *self = wx_const_cast(wxStandardPaths *, this);
#ifdef __LINUX__
// under Linux, we can get location of the executable
char buf[4096];
if ( readlink("/proc/self/exe", buf, WXSIZEOF(buf)) != -1 )
{
wxString exe(buf, wxConvLibc);
// consider that we're in the last "bin" subdirectory of our prefix
wxString basename(wxString(wxTheApp->argv[0]).AfterLast(_T('/'))); // << SEGFAULT
size_t pos = exe.find(_T("/bin/") + basename);
if ( pos != wxString::npos )
{
self->m_prefix.assign(exe, 0, pos);
}
}
if ( m_prefix.empty() )
#endif // __LINUX__
{
#ifdef __VMS
self->m_prefix = _T("/sys$system");
#else
self->m_prefix = _T("/usr/local");
#endif
}
}
return m_prefix;
}