On 10/11/2010 08:16 PM, Martin Simmons wrote:
>>>>>> On Mon, 11 Oct 2010 15:13:41 +0300, Spiros Ioannou said:
>>
>>   yes, it actually is using the correct library. This worked with bacula 
>> 3.0.1 so I presume something changed in the way the PQisthreadsafe 
>> function is called from bacula?
> 
> Probably 3.0.1 didn't ever call PQisthreadsafe (it just assumed that it would
> return true if present).  You were lucky that there were no concurrency
> problems because of this.
> 
> 
>> siv...@mnemosyne:/usr/local/bacula/bin $ ldd bacula-dir |grep libpq
>>          libpq.so.5 => /usr/local/pgsql/lib/libpq.so.5 (0x00002b593b82d000)
>>
>> siv...@mnemosyne:/usr/local/bacula/bin $ nm  
>> /usr/local/pgsql/lib/libpq.so.5|grep -i thread
>> 0000000000008ed0 T PQisthreadsafe
>> 0000000000006310 T PQregisterThreadLock
>> 0000000000006330 t default_threadlock
>> 000000000021b9c0 d pg_g_threadlock
>>                   U pthread_mutex_lock@@GLIBC_2.2.5
>>                   U pthread_mutex_unlock@@GLIBC_2.2.5
>> 000000000021c840 b singlethread_lock.9505
> 
> You could check what it returns by doing
> 
> gdb /usr/local/pgsql/lib/libpq.so.5
> 
> then use the gdb command
> 
> disass PQisthreadsafe
> 
> Assuming that returns 0, then you need to try again to build and install a
> thread-safe libpq.
> 
> __Martin
> 
> 
>>
>>
>>
>>
>> On 29/9/2010 15:50, Martin Simmons wrote:
>>>>>>>> On Wed, 29 Sep 2010 13:34:53 +0300, Spiros Ioannou said:
>>>>    I tried to upgrade from 3.0.1  to 5.0.3 , and it's been a nightmare for
>>>> 2 days.
>>>> after giving up on bat (it's is a impossible to compile due to a variety
>>>> of errors, reminding me of compiling software in the early 90's),
>>>>
>>>> I'm now stuck with bacula-dir not starting, with the following error in
>>>> the log:
>>>> 29-Sep 13:22 bacula-dir: ABORTING due to ERROR in postgresql.c:303
>>>> Pg client library must be thread-safe when using BatchMode.
>>>>
>>>> but, postgres is 8.3.3 configured with  --enable-thread-safety, and in
>>>> bacula's config.log I could find:
>>>> configure:29051: checking for PQisthreadsafe in -lpq
>>>> configure:29086: gcc -o conftest -g -O2   conftest.c -lpq  -ldl
>>>> -L/usr/local/pgsql/lib -lpq -lcrypt>&5
>>>> configure:29092: $? = 0
>>>> configure:29110: result: yes
>>>> ....
>>>> ac_cv_lib_pq_PQisthreadsafe=yes
>>>>
>>>> doing an ltrace bacula-dir though, outputs this:
>>>> PQisthreadsafe(0x6c1920, 0, 0x6c1920, 0, 0x134ed28) = 0
>>>>
>>>> please help as I'm now left without backup since I've updated the DB to
>>>> the new version.
>>>> Thanks.
>>>> system is CentOs 5.3
>>>> postgres 8.3.3
>>>> bacula 5.0.3
>>> The configure check doesn't actually call PQisthreadsafe, so it might say 
>>> yes
>>> even if PQisthreadsafe returns 0.
>>>
>>> Is bacula-dir definitely using your thread-safe libpq.so?  E.g. check with
>>> ldd.
>>>
>>> __Martin
>>>

Martin as you are reading currently gdb what is your opinion on that result ?

gdb /usr/lib64/libpq.so.5.2
GNU gdb (GDB) SUSE (7.2-2.4)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib64/libpq.so.5.2...(no debugging symbols 
found)...done.
(gdb) disass PQisthreadsafe
Dump of assembler code for function PQisthreadsafe:
   0x00000000000114b0 <+0>:     mov    $0x1,%eax
   0x00000000000114b5 <+5>:     retq
End of assembler dump.
(gdb)



-- 

Bruno Friedmann (irc:tigerfoot)
Ioda-Net Sàrl www.ioda-net.ch
 openSUSE Member
    User www.ioda.net/r/osu
    Blog www.ioda.net/r/blog
  fsfe fellowship www.fsfe.org
GPG KEY : D5C9B751C4653227
vcard : http://it.ioda-net.ch/ioda-net.vcf

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to