Skip site navigation (1) Skip section navigation (2)

Re: BUG #1270: stack overflow in thread in fe_getauthname

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Peter Davie" <Peter(dot)Davie(at)relevance(dot)com(dot)au>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1270: stack overflow in thread in fe_getauthname
Date: 2004-09-27 23:45:54
Message-ID: 8224.1096328754@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org> writes:
> With the THREAD_SAFETY changes, a buffer is defined on the stack as:
> char       pwdbuf[BUFSIZ];
> This buffer overflows the stack when used in a thread.  As the application 
> creating the thread cannot be modified to increase the stack size, it would 
> probably be prudent to reduce this buffer size (I believe that BUFSIZ is 
> around 8192 bytes on most modern Unix implementations). 

No, it would be prudent to fix the app.  While this one particular
buffer might be larger than needed, we are *not* going to buy into the
notion that libpq needs to run successfully in an 8K stack.  This
particular problem is only the tip of the iceberg; hewing to any
such limit is going to require far more drastic changes that just don't
seem worthwhile.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-09-27 23:55:55
Subject: Re: BUG #1270: stack overflow in thread in fe_getauthname
Previous:From: Bruce MomjianDate: 2004-09-27 23:39:14
Subject: Re: BUG #1270: stack overflow in thread in fe_getauthname

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group