Skip site navigation (1) Skip section navigation (2)

Further Mac woes

From: Adam H(dot)Pendleton <fmonkey(at)fmonkey(dot)net>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Further Mac woes
Date: 2004-09-21 16:19:14
Message-ID: FAF48A46-0BE9-11D9-934C-000A95B4F45C@fmonkey.net (view raw or flat)
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


Responses

pgadmin-hackers by date

Next:From: Andreas PflugDate: 2004-09-21 16:48:25
Subject: Re: Further Mac woes
Previous:From: Adam H.PendletonDate: 2004-09-21 16:11:42
Subject: Further Mac woes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group