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: (view raw, whole thread or download thread mbox)
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 
#2  0x0e813644 in wxNotebook::MacSetupTabs() (this=0x1f6db6a0) at 
#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 
#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 
#6  0x17f6dfcc in frmMain::frmMain(wxString const&) (this=0x2816000, 
title=(at)0xbffff920) at 
#7  0x13990dcc in pgAdmin3::OnInit() (this=0x111ad40) at 
#8  0x13996e84 in wxAppConsole::CallOnInit() (this=0x111ad40) at 
#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 

#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?



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-2017 The PostgreSQL Global Development Group