Lists: | pljava-dev |
---|
From: | achill at matrix(dot)gatewaynet(dot)com (Achilleas Mantzios) |
---|---|
To: | |
Subject: | [Pljava-dev] FreeBSD pl/java problem |
Date: | 2013-02-04 13:17:11 |
Message-ID: | 4461985.cuacIgvZGL@smadev.internal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
Hello,
I am running postgresql 9.2.2 with
openjdk version "1.6.0_32"
OpenJDK Runtime Environment (build 1.6.0_32-b25)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
On FreeBSD 8.3-RELEASE
I am having trouble even running simple tests like :
CREATE FUNCTION getsysprop(VARCHAR)
RETURNS VARCHAR
AS 'java.lang.System.getProperty'
LANGUAGE java;
SELECT getsysprop('user.home');
When i do that, the session hangs, and have to kill -9 the backend.
Searching with truss got :
gettimeofday({1359983241.596250 },0x0) = 0 (0x0)
gettimeofday({1359983241.596275 },0x0) = 0 (0x0)
gettimeofday({1359983241.596300 },0x0) = 0 (0x0)
gettimeofday({1359983241.596327 },0x0) = 0 (0x0)
gettimeofday({1359983241.596352 },0x0) = 0 (0x0)
gettimeofday({1359983241.596378 },0x0) = 0 (0x0)
gettimeofday({1359983241.596403 },0x0) = 0 (0x0)
gettimeofday({1359983241.596431 },0x0) = 0 (0x0)
gettimeofday({1359983241.596458 },0x0) = 0 (0x0)
gettimeofday({1359983241.596482 },0x0) = 0 (0x0)
gettimeofday({1359983241.596507 },0x0) = 0 (0x0)
gettimeofday({1359983241.596532 },0x0) = 0 (0x0)
gettimeofday({1359983241.596556 },0x0) = 0 (0x0)
_umtx_op(0x7fffffffc7e8,0x3,0x1,0x0,0x0,0x1) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGABRT|SIGEMT|SIGKILL|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGABRT|SIGEMT|SIGKILL|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
while ktrace gave :
98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
98910 initial thread RET gettimeofday 0
98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
98910 initial thread RET gettimeofday 0
98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
98910 initial thread RET gettimeofday 0
98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
98910 initial thread RET gettimeofday 0
98910 initial thread CALL gettimeofday(0x7fffffffc940,0)
98910 initial thread RET gettimeofday 0
98910 initial thread CALL _umtx_op(0x7fffffffc7e8,0x3,0x1,0,0)
98910 initial thread RET _umtx_op 0
98910 initial thread CALL sigprocmask(SIG_BLOCK,0x7fffffffc780,0x8016167d8)
98910 initial thread RET sigprocmask 0
98910 initial thread CALL sigprocmask(SIG_SETMASK,0x8016167d8,0)
98910 initial thread RET sigprocmask 0
98910 initial thread CALL sigprocmask(SIG_BLOCK,0x7fffffffc6e0,0x8016167d8)
98910 initial thread RET sigprocmask 0
98910 initial thread CALL sigprocmask(SIG_SETMASK,0x8016167d8,0)
98910 initial thread RET sigprocmask 0
98910 initial thread CALL _umtx_op(0x8f8dc4280,0x11,0,0,0)
I found some relevant problems with FreeBSD systems hanging after an _umtx_op but all those point
to threading problems that now are solved. I found nothing modern about _umtx_op.
I know FreeBSD is not a "Tier-1" platform for postgresql (nor java), but this is my main platform and i'd like
to stick with this.
Is there anything i could do to get closer to make pl/java work with FreeBSD?
Of course i will have to reach other communities as well (freebsd-java, etc...)
but any pointers from you would be just great.
Also read this http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-quot-install-jar-quot-td3290754.html thread.
Very close to my situation. JNI standalone also worked for me.
-
Achilleas Mantzios
IT DEV
IT DEPT
Dynacom Tankers Mgmt
From: | achill at matrix(dot)gatewaynet(dot)com (Achilleas Mantzios) |
---|---|
To: | |
Subject: | [Pljava-dev] FreeBSD pl/java problem |
Date: | 2013-02-04 15:46:03 |
Message-ID: | 1574535.zJ9Qr5fcjM@smadev.internal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
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?
On ?????
04 ?????? 2013 15:17:11 Achilleas Mantzios wrote:
> Hello,
>
> I am running postgresql 9.2.2 with
> openjdk version "1.6.0_32"
> OpenJDK Runtime Environment (build 1.6.0_32-b25)
> OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
> On FreeBSD 8.3-RELEASE
>
> I am having trouble even running simple tests like :
> CREATE FUNCTION getsysprop(VARCHAR)
> RETURNS VARCHAR
> AS 'java.lang.System.getProperty'
> LANGUAGE java;
>
> SELECT getsysprop('user.home');
>
> When i do that, the session hangs, and have to kill -9 the backend.
>
> Searching with truss got :
>
> gettimeofday({1359983241.596250 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596275 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596300 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596327 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596352 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596378 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596403 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596431 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596458 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596482 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596507 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596532 },0x0) = 0 (0x0)
> gettimeofday({1359983241.596556 },0x0) = 0 (0x0)
> _umtx_op(0x7fffffffc7e8,0x3,0x1,0x0,0x0,0x1) = 0 (0x0)
> sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGABRT|SIGEMT|SIGKILL|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
> sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
> sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGABRT|SIGEMT|SIGKILL|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
> sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
>
> while ktrace gave :
>
> 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> 98910 initial thread RET gettimeofday 0
> 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> 98910 initial thread RET gettimeofday 0
> 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> 98910 initial thread RET gettimeofday 0
> 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> 98910 initial thread RET gettimeofday 0
> 98910 initial thread CALL gettimeofday(0x7fffffffc940,0)
> 98910 initial thread RET gettimeofday 0
> 98910 initial thread CALL _umtx_op(0x7fffffffc7e8,0x3,0x1,0,0)
> 98910 initial thread RET _umtx_op 0
> 98910 initial thread CALL sigprocmask(SIG_BLOCK,0x7fffffffc780,0x8016167d8)
> 98910 initial thread RET sigprocmask 0
> 98910 initial thread CALL sigprocmask(SIG_SETMASK,0x8016167d8,0)
> 98910 initial thread RET sigprocmask 0
> 98910 initial thread CALL sigprocmask(SIG_BLOCK,0x7fffffffc6e0,0x8016167d8)
> 98910 initial thread RET sigprocmask 0
> 98910 initial thread CALL sigprocmask(SIG_SETMASK,0x8016167d8,0)
> 98910 initial thread RET sigprocmask 0
> 98910 initial thread CALL _umtx_op(0x8f8dc4280,0x11,0,0,0)
>
> I found some relevant problems with FreeBSD systems hanging after an _umtx_op but all those point
> to threading problems that now are solved. I found nothing modern about _umtx_op.
>
> I know FreeBSD is not a "Tier-1" platform for postgresql (nor java), but this is my main platform and i'd like
> to stick with this.
>
> Is there anything i could do to get closer to make pl/java work with FreeBSD?
>
> Of course i will have to reach other communities as well (freebsd-java, etc...)
> but any pointers from you would be just great.
>
> Also read this http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-quot-install-jar-quot-td3290754.html thread.
> Very close to my situation. JNI standalone also worked for me.
>
> -
> 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
From: | achill at matrix(dot)gatewaynet(dot)com (Achilleas Mantzios) |
---|---|
To: | |
Subject: | [Pljava-dev] FreeBSD pl/java problem |
Date: | 2013-02-04 16:55:34 |
Message-ID: | 1629686.dgDv4mylqG@smadev.internal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
Wrote a very small C postgresql function which simply calls JNI
and it hangs as well.
#include "postgres.h"
#include "utils/elog.h"
#include "utils/palloc.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "storage/bufpage.h"
#include "catalog/pg_type.h"
#include <jni.h>
PG_MODULE_MAGIC;
PG_FUNCTION_INFO_V1(jnitest);
Datum jnitest(PG_FUNCTION_ARGS);
Datum
jnitest(PG_FUNCTION_ARGS)
{
int res;
JNIEnv *env;
JavaVM *jvm;
JavaVMInitArgs vm_args;
JavaVMOption *options=NULL;
vm_args.version = 0x00010002;
vm_args.options = options;
vm_args.nOptions = 0;
vm_args.ignoreUnrecognized = JNI_TRUE;
/* Create the Java VM */
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
PG_RETURN_POINTER(res);
}
create function jnitest() RETURNS integer LANGUAGE c AS '$libdir/jnitest', 'jnitest';
dynacom=# select jnitest();
^^^ hangs
On ??? 04 ??? 2013 17:46:03 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?
>
> On ?????
04 ?????? 2013 15:17:11 Achilleas Mantzios wrote:
> > Hello,
> >
> > I am running postgresql 9.2.2 with
> > openjdk version "1.6.0_32"
> > OpenJDK Runtime Environment (build 1.6.0_32-b25)
> > OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
> > On FreeBSD 8.3-RELEASE
> >
> > I am having trouble even running simple tests like :
> > CREATE FUNCTION getsysprop(VARCHAR)
> > RETURNS VARCHAR
> > AS 'java.lang.System.getProperty'
> > LANGUAGE java;
> >
> > SELECT getsysprop('user.home');
> >
> > When i do that, the session hangs, and have to kill -9 the backend.
> >
> > Searching with truss got :
> >
> > gettimeofday({1359983241.596250 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596275 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596300 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596327 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596352 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596378 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596403 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596431 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596458 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596482 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596507 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596532 },0x0) = 0 (0x0)
> > gettimeofday({1359983241.596556 },0x0) = 0 (0x0)
> > _umtx_op(0x7fffffffc7e8,0x3,0x1,0x0,0x0,0x1) = 0 (0x0)
> > sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGABRT|SIGEMT|SIGKILL|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
> > sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
> > sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGABRT|SIGEMT|SIGKILL|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0)
> > sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
> >
> > while ktrace gave :
> >
> > 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> > 98910 initial thread RET gettimeofday 0
> > 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> > 98910 initial thread RET gettimeofday 0
> > 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> > 98910 initial thread RET gettimeofday 0
> > 98910 initial thread CALL gettimeofday(0x7fffffffc900,0)
> > 98910 initial thread RET gettimeofday 0
> > 98910 initial thread CALL gettimeofday(0x7fffffffc940,0)
> > 98910 initial thread RET gettimeofday 0
> > 98910 initial thread CALL _umtx_op(0x7fffffffc7e8,0x3,0x1,0,0)
> > 98910 initial thread RET _umtx_op 0
> > 98910 initial thread CALL sigprocmask(SIG_BLOCK,0x7fffffffc780,0x8016167d8)
> > 98910 initial thread RET sigprocmask 0
> > 98910 initial thread CALL sigprocmask(SIG_SETMASK,0x8016167d8,0)
> > 98910 initial thread RET sigprocmask 0
> > 98910 initial thread CALL sigprocmask(SIG_BLOCK,0x7fffffffc6e0,0x8016167d8)
> > 98910 initial thread RET sigprocmask 0
> > 98910 initial thread CALL sigprocmask(SIG_SETMASK,0x8016167d8,0)
> > 98910 initial thread RET sigprocmask 0
> > 98910 initial thread CALL _umtx_op(0x8f8dc4280,0x11,0,0,0)
> >
> > I found some relevant problems with FreeBSD systems hanging after an _umtx_op but all those point
> > to threading problems that now are solved. I found nothing modern about _umtx_op.
> >
> > I know FreeBSD is not a "Tier-1" platform for postgresql (nor java), but this is my main platform and i'd like
> > to stick with this.
> >
> > Is there anything i could do to get closer to make pl/java work with FreeBSD?
> >
> > Of course i will have to reach other communities as well (freebsd-java, etc...)
> > but any pointers from you would be just great.
> >
> > Also read this http://postgresql.1045698.n5.nabble.com/Java-VM-stalls-during-quot-install-jar-quot-td3290754.html thread.
> > Very close to my situation. JNI standalone also worked for me.
> >
> > -
> > 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
-
Achilleas Mantzios
IT DEV
IT DEPT
Dynacom Tankers Mgmt
From: | thomas at tada(dot)se (Thomas Hallgren) |
---|---|
To: | |
Subject: | [Pljava-dev] FreeBSD pl/java problem |
Date: | 2013-02-04 17:19:56 |
Message-ID: | 510FEDBC.4080201@tada.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | PostgreSQL : PostgreSQL 메일 링리스트 : 2013-02-04 이후 무지개 토토 17:19 |
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" ?
- thomas
From: | achill at matrix(dot)gatewaynet(dot)com (Achilleas Mantzios) |
---|---|
To: | |
Subject: | [Pljava-dev] FreeBSD pl/java problem |
Date: | 2013-02-05 07:50:25 |
Message-ID: | 1560986.YqyJcHU8qQ@smadev.internal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
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
From: | achill at matrix(dot)gatewaynet(dot)com (Achilleas Mantzios) |
---|---|
To: | |
Subject: | [Pljava-dev] FreeBSD pl/java problem : Solved |
Date: | 2013-02-05 10:31:49 |
Message-ID: | 7908074.KLypagXKvL@smadev.internal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | PostgreSQL : PostgreSQL 메일 링리스트 : 2013-02-05 이후 롤 토토 10:31 |
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
From: | thomas at tada(dot)se (Thomas Hallgren) |
---|---|
To: | |
Subject: | [Pljava-dev] FreeBSD pl/java problem : Solved |
Date: | 2013-02-05 10:41:19 |
Message-ID: | 5110E1CF.7040501@tada.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pljava-dev |
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