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

Re: wxWidgets alert at start

From: Jyrki Wahlstedt <jyrki(dot)wahlstedt(at)hut(dot)fi>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: wxWidgets alert at start
Date: 2007-08-01 11:23:58
Message-ID: DA8221C9-A8BC-4224-B5FF-1BEA63A16BDF@hut.fi (view raw or flat)
Thread:
Lists: pgadmin-hackers
On 1.8.2007, at 13.24, Dave Page wrote:

> Jyrki Wahlstedt wrote:
>>
>> On 1.8.2007, at 12.31, Dave Page wrote:
>>> Can you attach gdb/xcode at that point and get a backtrace?
>>>
>> You mean something like this:
>
> ...
>
>> #17 0x00224ecb in isPgApp (app=(at)0xbffff5f4) at ./utils/misc.cpp:1090
>> #18 0x00009948 in pgAdmin3::InitPaths (this=0x18d2b990) at
>> ./pgAdmin3.cpp:766
>> #19 0x000105ea in pgAdmin3::OnInit (this=0x18d2b990) at ./ 
>> pgAdmin3.cpp:206
>> #20 0x002dfa22 in wxAppConsole::CallOnInit (this=0x18d2b990) at
>> /opt/local/include/wx-2.8/wx/app.h:76
>> #21 0x17d68a46 in wxEntry (argc=(at)0x17e60038, argv=0x18d292c0) at
>> ../src/common/init.cpp:433
>> #22 0x00007e60 in main (argc=2, argv=0xbffffc3c) at ./pgAdmin3.cpp: 
>> 104
>>
>> after 'gdb pgAdmin3 pid'?
>
> Yup, exactly like that :-)
>
> It's dying when it checks for the PostgreSQL utilities (isPgApp()  
> runs a
> utility with the --version option to check that it's a PostgreSQL  
> util,
> and not an EDB version). In ~/Library/Preferences/pgadmin3  
> Preferences,
> do you have anything set for the PostgreSQLPath and EnterpriseDBPath
> options?
Portion of preferences:
PostgreSQLPath=/Apps/pgAdmin3.app/Contents/SharedSupport/helper
EnterpriseDBPath=

>
> If so, is there a pg_dump executable in either location? What does it
> return if you run it with the --version option?
jwa(at)messiaen:MacOS> cd ../SharedSupport/helper/
jwa(at)messiaen:helper> ll
total 728
-rwxr-xr-x   2 root  admin  215632  1 Elo 12:11 pg_dump*
-rwxr-xr-x   2 root  admin   54892  1 Elo 12:11 pg_dumpall*
-rwxr-xr-x   2 root  admin   96532  1 Elo 12:11 pg_restore*
jwa(at)messiaen:helper> ./pg_dump --version
dyld: Library not loaded: @executable_path/../../Contents/Frameworks/ 
libssl.0.9.8.dylib
   Referenced from: /Applications/MacPorts/pgAdmin3.app/Contents/ 
SharedSupport/helper/./../../../Contents/Frameworks/libpq.5.dylib
   Reason: image not found
Trace/BPT trap

So, pg_dump exists, but doesnt return anything that makes sense (and  
it is not found anywhere else
>
> If those locations don't exist, it'll first look in the path for a
> pg_dump, and then in a bunch of known locations (straight from the  
> code):
>
<snip>
The referenced library seems to exist, where it is supposed to be:
jwa(at)messiaen:Frameworks> ll
total 479752
-rwxr-xr-x   2 root  admin     454260  1 Elo 12:11 libSDL-1.2.0.dylib*
-rwxr-xr-x   2 root  admin    1394844  1 Elo 12:11 libcrypto. 
0.9.8.dylib*
-rwxr-xr-x   2 root  admin    1053388  1 Elo 12:11 libiconv.2.dylib*
-rwxr-xr-x   2 root  admin     279152  1 Elo 12:11 libncurses.5.dylib*
-rwxr-xr-x   2 root  admin     116004  1 Elo 12:11 libpq.5.dylib*
-rwxr-xr-x   2 root  admin     452148  1 Elo 12:11 libreadline. 
5.2.dylib*
-rwxr-xr-x   2 root  admin     283320  1 Elo 12:11 libssl.0.9.8.dylib*
...

The other pg_dump gives:
jwa(at)messiaen:Frameworks> /opt/local/lib/postgresql82/bin/pg_dump -- 
version
pg_dump (PostgreSQL) 8.2.4

Ok, I dug around a bit, and it seems that the use of pg_config is not  
totally proper in the configuration phase (I must admit that MacPorts  
PostgreSQL directory structure is not too simple either, but  
pg_config should be able to take care of that). Because of this I  
have made symbolic links in the build structure, but that shouldn't  
be needed, as pg_config should tell all necessary information. I  
tried to use purely pg_config, but could not configure, because no  
valid PostgreSQL installation was found. This comes from the lines in  
config.log:
configure:6183: gcc -o conftest -O2 -I/opt/local/include -L/opt/local/ 
lib -L/opt/local/lib/postgresql82/lib conftest.c -lpq   >&5
/usr/bin/ld: warning -L: directory name (/opt/local/lib/postgresql82/ 
lib) does not exist
/usr/bin/ld: can't locate file for: -lpq
collect2: ld returned 1 exit status

For some reason it seems that 'lib' is attached to the directory name  
given by pg_config:
jwa(at)messiaen:pgAdmin3> pg_config --libdir
/opt/local/lib/postgresql82
jwa(at)messiaen:pgAdmin3> ls $(pg_config --libdir)
adminpack.so*                   libpq.a
ascii_and_mic.so*               libpq.dylib@
bin/                            lo.so*
cyrillic_and_mic.so*            pg_buffercache.so*
dblink.so*                      pg_trgm.so*
euc_cn_and_mic.so*              pgxml.so*
euc_jp_and_sjis.so*             pgxs/
euc_kr_and_mic.so*              plpgsql.so*
euc_tw_and_big5.so*             plpython.so*
fuzzystrmatch.so*               slony1_funcs.so*
latin2_and_win1250.so*          tsearch2.so*
latin_and_mic.so*               utf8_and_ascii.so*
libecpg.5.2.dylib*              utf8_and_big5.so*
libecpg.5.dylib@                utf8_and_cyrillic.so*
libecpg.a                       utf8_and_euc_cn.so*
libecpg.dylib@                  utf8_and_euc_jp.so*
libecpg_compat.2.2.dylib*       utf8_and_euc_kr.so*
libecpg_compat.2.dylib@         utf8_and_euc_tw.so*
libecpg_compat.a                utf8_and_gb18030.so*
libecpg_compat.dylib@           utf8_and_gbk.so*
libpgport.a                     utf8_and_iso8859.so*
libpgtypes.2.2.dylib*           utf8_and_iso8859_1.so*
libpgtypes.2.dylib@             utf8_and_johab.so*
libpgtypes.a                    utf8_and_sjis.so*
libpgtypes.dylib@               utf8_and_uhc.so*
libpq.5.0.dylib*                utf8_and_win.so*
libpq.5.dylib@                  xxid.so*

Well, sorry for this long and confused mess, but one could say there  
is hope to find the solution.
> Regards, Dave

!
! Jyrki Wahlstedt
!	http://www.wahlstedt.fi/jyrki/
!
! Our life is no dream; but it ought to become one and perhaps will.
! PGP key ID: 0x139CC386 fingerprint: F355 B46F 026C B8C1 89C0  A780  
6366 EFD9 139C C386




In response to

Responses

pgadmin-hackers by date

Next:From: svnDate: 2007-08-01 12:35:00
Subject: SVN Commit by dpage: r6522 - trunk/pgadmin3
Previous:From: Dave PageDate: 2007-08-01 10:24:29
Subject: Re: wxWidgets alert at start

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