agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] FreeBSD pl/java problem : Solved
Date: Tue, 05 Feb 2013 11:41:19 +0100
Message-ID: <5110E1CF.7040501@tada.se> (raw)
In-Reply-To: <7908074.KLypagXKvL@smadev.internal.net>
References: <4461985.cuacIgvZGL@smadev.internal.net>
	<510FEDBC.4080201@tada.se>
	<1560986.YqyJcHU8qQ@smadev.internal.net>
	<7908074.KLypagXKvL@smadev.internal.net>

That's great news. Thanks for conveying your solution to the list.

- thomas

On 2013-02-05 11:31, Achilleas Mantzios wrote:
> Hi,
> it seemed from all sides it was a FreeBSD/postgresql/threading problem.
> After much playing around finally i experimented putting in /usr/local/src/postgresql-9.2.2/src/backend/Makefile :
> postgres: $(OBJS)
>          $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) -lpthread -o $@
> i.e. explicitly linking the postgres backend to /usr/lib/libpthread.so which is a symlink to /usr/lib/libthr.so which is a symlink to /lib/libthr.so.3 ,
> did the trick.
> root at smadev:/usr/local/src/postgresql-9.2.2# ldd /usr/local/pgsql/bin/postgres
> /usr/local/pgsql/bin/postgres:
>          libm.so.5 => /lib/libm.so.5 (0x800ae5000)
>          libldap-2.4.so.8 => /usr/local/lib/libldap-2.4.so.8 (0x800c05000)
>          libthr.so.3 => /lib/libthr.so.3 (0x800d47000)
>          libc.so.7 => /lib/libc.so.7 (0x800e60000)
>          liblber-2.4.so.8 => /usr/local/lib/liblber-2.4.so.8 (0x8010a2000)
>          libssl.so.6 => /usr/lib/libssl.so.6 (0x8011af000)
>          libcrypto.so.6 => /lib/libcrypto.so.6 (0x801302000)
>
> I had the first good results from pl/java :)
>
> On ??? 05 ??? 2013 09:50:25 Achilleas Mantzios wrote:
>> On ?????
 04 ?????? 2013 18:19:56 Thomas Hallgren wrote:
>>> On 2013-02-04 16:46, Achilleas Mantzios wrote:
>>>> Just an update on this :
>>>>
>>>> by inserting some elog statements in ./src/C/pljava/Backend.c
>>>> just before JNI_createVM  :
>>>>
>>>> 	  elog(DEBUG1, "Creating JavaVM");
>>>>
>>>>           elog(INFO,"jstat = %d",jstat);
>>>>
>>>>           //jstat = JNI_createVM(&s_javaVM, &vm_args);
>>>>           JNIEnv *env;
>>>>           jstat = JNI_CreateJavaVM(&s_javaVM, (void**)&env, &vm_args);
>>>>
>>>>           elog(INFO,"jstat = %d",jstat);
>>>>
>>>> it never gets into the second elog, which means it hangs in JNI_CreateJavaVM.
>>>>
>>>> Outside postgresql i can run JNI programs with no problem.
>>>>
>>>> Any clues?
>>> Is the postgresql back-end server configured to use the same JVM as
>>> you're using "outside postgresql" ?
>> Yes, besides my system has currently only one jdk installed,
>> i made pljava.so look for this libjvm.so by explicitly putting
>> # cat /usr/local/libdata/ldconfig/openjdk
>> /usr/local/openjdk6/jre/lib/amd64/server
>>
>> and therefore :
>> ldd /usr/local/pgsql/lib/pljava.so
>> /usr/local/pgsql/lib/pljava.so:
>>          libjvm.so => /usr/local/openjdk6/jre/lib/amd64/server/libjvm.so (0x800c00000)
>>          libc.so.7 => /lib/libc.so.7 (0x800648000)
>>          libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x80178f000)
>>          libm.so.5 => /lib/libm.so.5 (0x80199f000)
>>          libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x801abf000)
>>          libthr.so.3 => /lib/libthr.so.3 (0x801bcd000)
>>
>> Also by doing :
>>
>> dynacom=# SELECT PG_BACKEND_PID();
>>   pg_backend_pid
>> ----------------
>>            20205
>> (1 row)
>>
>> dynacom=# SELECT getsysprop('user.home');
>>
>> ^^^^^ hangs here, and from another shell :
>>
>> % gdb /usr/local/pgsql/bin/postgres 20205
>> ....
>> Reading symbols from /lib/libcrypto.so.6...(no debugging symbols found)...done.
>> Loaded symbols for /lib/libcrypto.so.6
>> Reading symbols from /usr/local/pgsql/lib/pljava.so...(no debugging symbols found)...done.
>> Loaded symbols for /usr/local/pgsql/lib/pljava.so
>> Reading symbols from /usr/local/openjdk6/jre/lib/amd64/server/libjvm.so...(no debugging symbols found)...done.
>> Loaded symbols for /usr/local/openjdk6/jre/lib/amd64/server/libjvm.so
>> Reading symbols from /usr/lib/libstdc++.so.6...(no debugging symbols found)...done.
>> Loaded symbols for /usr/lib/libstdc++.so.6
>> Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.
>> Loaded symbols for /lib/libgcc_s.so.1
>> Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
>> [New Thread 801616700 (LWP 100683/initial thread)]
>> Loaded symbols for /lib/libthr.so.3
>> Reading symbols from /usr/local/openjdk6/jre/lib/amd64/libverify.so...(no debugging symbols found)...done.
>> Loaded symbols for /usr/local/openjdk6/jre/lib/amd64/libverify.so
>> Reading symbols from /usr/local/openjdk6/jre/lib/amd64/libjava.so...(no debugging symbols found)...done.
>> Loaded symbols for /usr/local/openjdk6/jre/lib/amd64/libjava.so
>> Reading symbols from /usr/local/openjdk6/jre/lib/amd64/libzip.so...(no debugging symbols found)...done.
>> Loaded symbols for /usr/local/openjdk6/jre/lib/amd64/libzip.so
>> ....
>>
>> Without the explicit addition to the ldconfig in /usr/local/libdata/ldconfig/openjdk pljava.so had problems
>> loading it.
>>
>>
>>> - thomas
>>>
>>> _______________________________________________
>>> Pljava-dev mailing list
>>> Pljava-dev at pgfoundry.org
>>> http://lists.pgfoundry.org/mailman/listinfo/pljava-dev
>> -
>> Achilleas Mantzios
>> IT DEV
>> IT DEPT
>> Dynacom Tankers Mgmt
>> _______________________________________________
>> Pljava-dev mailing list
>> Pljava-dev at pgfoundry.org
>> http://lists.pgfoundry.org/mailman/listinfo/pljava-dev
> -
> Achilleas Mantzios
> IT DEV
> IT DEPT
> Dynacom Tankers Mgmt
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at pgfoundry.org
> http://lists.pgfoundry.org/mailman/listinfo/pljava-dev




view thread (2+ messages)

Message-ID: <5110E1CF.7040501@tada.se>
Permalink:  ../5110E1CF.7040501@tada.se/
Also on:    postgresql.org/message-id/5110E1CF.7040501@tada.se

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] FreeBSD pl/java problem : Solved
  In-Reply-To: <5110E1CF.7040501@tada.se>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox