Calling xlst_process with certain arguments causes server crash

Поиск
Список
Период
Сортировка
Искать

Calling xlst_process with certain arguments causes server crash

От:
<pgagarinov@alliedtesting.com>
Дата:
Hello,

It looks like calling xlst_process as follows causes a crash:

select xslt_process('
60
0.75
30
0.75
1

               calendar spread

','

  
  
    
      
      
          result.asp?value=3D
      
    
  
','')

After the crash pglog contains the following records:





Peter Gagarinov | Head of Modelling and Analytics

Allied Testing

Re: Calling xlst_process with certain arguments causes server crash

От:
<pgagarinov@alliedtesting.com>
Дата:
Hello,

It looks like calling xlst_process as follows causes a crash:

select xslt_process('
60
0.75
30
0.75
1

               calendar spread

','

  

  
    
      
      
          result.asp?value=3D
      
    
  

','')

After the crash pglog contains the following records:

2012-06-04 16:32:40.927 MSDLOG:  server process (PID 4512) was terminated b=
y exception 0xC0000005
2012-06-04 16:32:40.927 MSDHINT:  See C include file "ntstatus.h" for a des=
cription of the hexadecimal value.
2012-06-04 16:32:40.927 MSDLOG:  terminating any other active server proces=
ses

Could you please help to figure out how it can be fixed?

Thanks,
Peter


Peter Gagarinov | Head of Modelling and Analytics

Allied Testing

Re: Calling xlst_process with certain arguments causes server crash

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
 writes:
> It looks like calling xlst_process as follows causes a crash:

Hm, apparently xsltApplyStylesheet returns a NULL in this example,
and we're passing that on to xsltSaveResultToString which is not
expecting any such thing.  I presume we need another error check
here, but what should the error say exactly?  Can we get any info
more detailed than "failed to apply stylesheet"?

			regards, tom lane

Re: Calling xlst_process with certain arguments causes server crash

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
I wrote:
> Hm, apparently xsltApplyStylesheet returns a NULL in this example,
> and we're passing that on to xsltSaveResultToString which is not
> expecting any such thing.  I presume we need another error check
> here, but what should the error say exactly?  Can we get any info
> more detailed than "failed to apply stylesheet"?

Apparently not -- or at least, if libxslt provides any easy way to
extract error reports, it's not evident from the pretty-awful
documentation.  I've committed a fix that just reports "failed to apply
stylesheet".

			regards, tom lane

Re: Calling xlst_process with certain arguments causes server crash

От:
<pgagarinov@alliedtesting.com>
Дата:
Hello Tom,

Here is another example that causes a crash, probably for the same reason b=
ut better be safe than sorry:

select xslt_process('
60
0.75
30
0.75
1

	calendar spread

',
'



        
        
		
		
		
		
=09=09
        
        
		
		
		
		
=09=09
        =20=20=20=20=20=20=20=20
        

','')

A correct error report for this case would be something like "function glob=
al-name is unknown" (I've just replaced a correct "name" function with "glo=
bal-name") but of course "failed to apply stylesheet" is still better than =
a crash :)

Thanks,
Peter


Peter Gagarinov | Head of Modelling and Analytics

Allied Testing


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20
Sent: Tuesday, June 05, 2012 4:16 AM
To: Peter Gagarinov
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] Calling xlst_process with certain arguments causes serv=
er crash=20

I wrote:
> Hm, apparently xsltApplyStylesheet returns a NULL in this example, and=20
> we're passing that on to xsltSaveResultToString which is not expecting=20
> any such thing.  I presume we need another error check here, but what=20
> should the error say exactly?  Can we get any info more detailed than=20
> "failed to apply stylesheet"?

Apparently not -- or at least, if libxslt provides any easy way to extract =
error reports, it's not evident from the pretty-awful documentation.  I've =
committed a fix that just reports "failed to apply stylesheet".

			regards, tom lane
FAQ