agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] stack depth limit exceeded - patch possible?
Date: Thu, 17 Apr 2008 15:22:47 +0200
Message-ID: <48074F27.9050606@par.univie.ac.at> (raw)
In-Reply-To: <4806264F.1060800@ejurka.com>
References: <48010499.30000@par.univie.ac.at>
	<Pine.BSO.4.64.0804131023000.9928@leary.csoft.net>
	<58782.88.116.137.78.1208177811.squirrel@www.par.univie.ac.at>
	<Pine.BSO.4.64.0804141112330.5378@leary.csoft.net>
	<48060EE6.9040009@par.univie.ac.at>
	<4806264F.1060800@ejurka.com>

Dear Kris,

first of all thank you very much for your fast response including a 
patch suggestion for my issue.
I made the changes to the 2 pljava source files (one c File, one java 
File changed) as proposed by you, assuming that

*** 153,159 ****
  	{
  		synchronized(Backend.THREADLOCK)
  		{
! 			return _move(m_pointer, forward, count);
  		}
  	}
  
--- 153,159 ----
  	{
  		synchronized(Backend.THREADLOCK)
  		{
! 			return _fetch(m_pointer, System.identityHashCode(Thread.currentThread()), forward, count);
  		}
  	}
  
***************

should be changed to the new return _move(.....) as well as done for the return _fetch(...).

As I never built postgresql nor pljava local on my Win XP maschine I installed mingw and msys, set msys\bin in my path and tried to build the pl/java release with 

make release 

from the root directory of the pljava src distribution (/e/downloads/pljava).

Then I get the following error:
make[1]: Entering directory `/e/downloads/pljava-1.4.0/build/classes/pljava'
javac -source 1.4 -target 1.4 -d . <java sources>
javac: no source files
make[1]: *** [.timestamp] Error 2
make[1]: Leaving directory `/e/downloads/pljava-1.4.0/build/classes/pljava'
make: *** [pljava_all] Error 2

What else do I have to set in order to get the built process working?

Regards,

Alexander

Kris Jurka schrieb:
> Alexander W?hrer wrote:
>> 2304DEBUG:  Changed stack_base_ptr from 00BDFC9A to 0B1EFAF4
>> 2304DEBUG:  Restored stack_base_ptr to 00BDFC9A
>> 2304DEBUG:  Changed stack_base_ptr from 00BDFC9A to 0B1EFAC8
>> 2304DEBUG:  Restored stack_base_ptr to 00BDFC9A
>> 2304DEBUG:  Exception in function SPI_cursor_fetch
>> org.postgresql.pljava.internal.ServerException: stack depth limit 
>> exceeded
>>     at org.postgresql.pljava.internal.Portal._fetch(Native Method)
>>     at org.postgresql.pljava.internal.Portal.fetch(Portal.java:91)
>
> So you can see the initial stack_base_ptr being adjusted when the 
> query is initially executed.  Unfortunately pljava is not adjusting it 
> again later when rs.next() is being called.  So if the portal fetch 
> needs to do any actual work (that is the results were not materialized 
> by the initial execution) it needs to adjust the stack as well.  Can 
> you try the attached patch to see if it fixes things for you?
>
> In general it seems that anything operating inside of 
> synchronized(Backend.THREADLOCK) might need to adjust the stack unless 
> it's certain the work it's doing is trivial and won't invoke 
> check_stack_depth.  Unfortunately I don't know enough about when pg 
> calls check_stack_depth to know offhand what is/is not safe.  A more 
> thorough audit is required here.  Let's start with this patch and see 
> where that gets us.
>
> Kris Jurka
>

-- 
**********************************************
University of Vienna
Institute for Scientific Computing
Nordbergstra?e 15/C/311
A-1090 Vienna
Austria

tel.:   +43-1-4277-39421
fax.:   +43-1-4277-9394
e-mail: woehrer at par.univie.ac.at
url:    http://www.par.univie.ac.at/~woehrer/
**********************************************





view thread (11+ messages)  latest in thread

Message-ID: <48074F27.9050606@par.univie.ac.at>
Permalink:  ../48074F27.9050606@par.univie.ac.at/
Also on:    postgresql.org/message-id/48074F27.9050606@par.univie.ac.at

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] stack depth limit exceeded - patch possible?
  In-Reply-To: <48074F27.9050606@par.univie.ac.at>

* 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