Re: [HACKERS] stack depth limit exceeded problem.

2005-09-25 Thread Thomas Hallgren
Martijn van Oosterhout wrote: I rely on the signal handler that the JVM uses for page-faults (which a stack overflow generally amounts to) and fpe exeptions so I know that they will generate java exceptions in a controlled way (which I in turn translate to elog(ERROR) on the main thread).

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-24 Thread Thomas Hallgren
Oliver Jowett wrote: Thomas Hallgren wrote: PL/Java runs a JVM. Since a JVM is multi threaded, PL/Java goes to fairly extreme measures to ensure that only one thread at a time can access the backend. So far, this have worked well but there is one small problem. [...] I assume this

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-24 Thread Martijn van Oosterhout
On Sat, Sep 24, 2005 at 10:34:42AM +0200, Thomas Hallgren wrote: Oliver Jowett wrote: I assume this means you have a single lock serializing requests to the backend? Yes, of course. I also make sure that the main thread cannot return until another thread that is servicing a backend

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-24 Thread Thomas Hallgren
Martijn van Oosterhout wrote: On Sat, Sep 24, 2005 at 10:34:42AM +0200, Thomas Hallgren wrote: Oliver Jowett wrote: I assume this means you have a single lock serializing requests to the backend? Yes, of course. I also make sure that the main thread cannot return until

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-24 Thread Martijn van Oosterhout
On Sat, Sep 24, 2005 at 12:26:58PM +0200, Thomas Hallgren wrote: Yes. All backend exceptions are cought in a PG_CATCH and then propagated to Java as a ServerException. If there's no catch in the Java code, they are rethrown by the java_call_handler. This time with jump buffer that was setup

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-24 Thread Thomas Hallgren
Martijn van Oosterhout wrote: Linux has sigaltstack so you can catch the stack overflow signal (and other signals obviously, but that's its main use), but it's not terribly portable. I rely on the signal handler that the JVM uses for page-faults (which a stack overflow generally amounts to)

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-24 Thread Martijn van Oosterhout
On Sat, Sep 24, 2005 at 02:38:35PM +0200, Thomas Hallgren wrote: Martijn van Oosterhout wrote: Linux has sigaltstack so you can catch the stack overflow signal (and other signals obviously, but that's its main use), but it's not terribly portable. I rely on the signal handler that the

[HACKERS] stack depth limit exceeded problem.

2005-09-23 Thread Thomas Hallgren
Hi, I have a problem with PL/Java that, if it's going to have a good solution, requires your help. PL/Java runs a JVM. Since a JVM is multi threaded, PL/Java goes to fairly extreme measures to ensure that only one thread at a time can access the backend. So far, this have worked well but

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-23 Thread Tom Lane
Thomas Hallgren [EMAIL PROTECTED] writes: Someone loads a library that contains a method that spawns a new thread. They already broke the backend when they did that. max_stack_depth is just the tip of the iceberg. regards, tom lane ---(end of

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-23 Thread Thomas Hallgren
Tom Lane wrote: Thomas Hallgren [EMAIL PROTECTED] writes: Someone loads a library that contains a method that spawns a new thread. They already broke the backend when they did that. max_stack_depth is just the tip of the iceberg. I knew I'd get a response like that from you :-)

Re: [HACKERS] stack depth limit exceeded problem.

2005-09-23 Thread Oliver Jowett
Thomas Hallgren wrote: PL/Java runs a JVM. Since a JVM is multi threaded, PL/Java goes to fairly extreme measures to ensure that only one thread at a time can access the backend. So far, this have worked well but there is one small problem. [...] I assume this means you have a single lock