Further Mac woes

From: Adam H(dot)Pendleton <apendlet(at)hq(dot)nasa(dot)gov>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Further Mac woes
Date: 2004-09-21 16:11:42
Message-ID: ED595BA4-0BE8-11D9-934C-000A95B4F45C@hq.nasa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Okay, from my last post you can see that pgAdmin3 isn't doing a good
job of selecting my default language. Now, when I continue after the
assert dialog, the program crashes with this backtrace:

#0 0x90006e40 in strlen ()
#1 0x1286296c in wxMacStringToPascal(wxString const&, unsigned char*)
(from=(at)0xbffff240, to=0xbffff124 "\022\177= ") at
../src/mac/carbon/utils.cpp:692
#2 0x0e813644 in wxNotebook::MacSetupTabs() (this=0x1f6db6a0) at
../src/mac/carbon/notebmac.cpp:372
#3 0x0e8133d8 in wxNotebook::InsertPage(unsigned long, wxWindow*,
wxString const&, bool, int) (this=0x1f6db6a0, nPage=0,
pPage=0x1f6dc570, strText=(at)0xbffff460, bSelect=false, imageId=-1) at
../src/mac/carbon/notebmac.cpp:317
#4 0x0e992f44 in wxBookCtrl::AddPage(wxWindow*, wxString const&, bool,
int) (this=0x1f6db6a0, page=0x1f6dc570, text=(at)0xbffff460,
bSelect=false, imageId=-1) at ../include/wx/bookctrl.h:146
#5 0x17f719f0 in frmMain::frmMain(wxString const&) (this=0x2816000,
title=(at)0xbffff920) at
/Users/fmonkey/Projects/pgadmin3/src/ui/frmMain.cpp:287
#6 0x17f6dfcc in frmMain::frmMain(wxString const&) (this=0x2816000,
title=(at)0xbffff920) at
/Users/fmonkey/Projects/pgadmin3/src/ui/frmMain.cpp:113
#7 0x13990dcc in pgAdmin3::OnInit() (this=0x111ad40) at
/Users/fmonkey/Projects/pgadmin3/src/pgAdmin3.cpp:488
#8 0x13996e84 in wxAppConsole::CallOnInit() (this=0x111ad40) at
../../wx2/include/wx-2.5/wx/app.h:87
#9 0x12816ac4 in wxEntry(int&, wchar_t**) (argc=(at)0xbffffbf8,
argv=0x111aa00) at ../src/common/init.cpp:394
#10 0x12816c2c in wxEntry(int&, char**) (argc=(at)0xbffffbf8,
argv=0xbffffc88) at ../src/common/init.cpp:457
#11 0x1398fc04 in main (argc=1, argv=0xbffffc88) at
/Users/fmonkey/Projects/pgadmin3/src/pgAdmin3.cpp:96

#1, wxMacStringToPascal is below:

void wxMacStringToPascal( const wxString&from , StringPtr to )
{
wxCharBuffer buf = from.mb_str( wxConvLocal ) ;
int len = strlen(buf) ;

if ( len > 255 )
len = 255 ;
to[0] = len ;
memcpy( (char*) &to[1] , buf , len ) ;
}

The program crashes on the "int len = strlen(buf)" because buf = NULL
before that call, which means the conversion to a c-string fails in the
previous line, which I think might have something to do with language,
since it appears that "from" is properly defined when the function is
called (can't tell for sure since wxStrings don't really show well in a
debugger). Any ideas?

ahp

Browse pgadmin-hackers by date

  From Date Subject
Next Message Adam H.Pendleton 2004-09-21 16:19:14 Further Mac woes
Previous Message Andreas Pflug 2004-09-21 15:08:40 Re: pgAdmin3 on Mac