dbTalk Databases Forums  

[BUGS] PATCH: Uninitialized variable usage in contrib/pg_autovacuum

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] PATCH: Uninitialized variable usage in contrib/pg_autovacuum in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Craig Boston
 
Posts: n/a

Default [BUGS] PATCH: Uninitialized variable usage in contrib/pg_autovacuum - 11-21-2003 , 05:59 PM






--Boundary-00=_KYqv/jTUnEGZbFx
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Sorry about the cross-post -- I'm not 100% sure which list this should be sent
to.

I noticed in the 7.4 release that in contrib/pg_autovacuum, args->logfile is
not initialized if a log file is not specified on the command line. This
causes an immediate segfault on systems that fill allocated memory with some
value other than zero (my FreeBSD machine uses 0xD0).

Several crashes later I discovered that args->user, password, host, and port
are also used without being initialized.

This doesn't appear to be fixed in CVS and I came up empty on a mailing list
search -- hope it hasn't been reported already.

Attached is a quick patch that fixes the problem.

--
Craig

--Boundary-00=_KYqv/jTUnEGZbFx
Content-Type: text/plain;
charset="us-ascii";
name="autovacuum.uninit.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="autovacuum.uninit.patch"

--- contrib/pg_autovacuum/pg_autovacuum.c.orig Fri Nov 21 17:11:32 2003
+++ contrib/pg_autovacuum/pg_autovacuum.c Fri Nov 21 17:37:28 2003
@@ -811,6 +811,11 @@
args->analyze_scaling_factor = -1;
args->debug = AUTOVACUUM_DEBUG;
args->daemonize = 0;
+ args->user = 0;
+ args->password = 0;
+ args->host = 0;
+ args->logfile = 0;
+ args->port = 0;

/*
* Fixme: Should add some sanity checking such as positive integer

--Boundary-00=_KYqv/jTUnEGZbFx
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)

--Boundary-00=_KYqv/jTUnEGZbFx--


Reply With Quote
  #2  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] PATCH: Uninitialized variable usage in contrib/pg_autovacuum - 11-29-2003 , 11:37 PM







Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Craig Boston wrote:
Quote:
Sorry about the cross-post -- I'm not 100% sure which list this should be sent
to.

I noticed in the 7.4 release that in contrib/pg_autovacuum, args->logfile is
not initialized if a log file is not specified on the command line. This
causes an immediate segfault on systems that fill allocated memory with some
value other than zero (my FreeBSD machine uses 0xD0).

Several crashes later I discovered that args->user, password, host, and port
are also used without being initialized.

This doesn't appear to be fixed in CVS and I came up empty on a mailing list
search -- hope it hasn't been reported already.

Attached is a quick patch that fixes the problem.

--
Craig
[ Attachment, skipping... ]

Quote:
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)
--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] PATCH: Uninitialized variable usage in contrib/pg_autovacuum - 12-01-2003 , 05:16 PM




Patch applied. Thanks.

---------------------------------------------------------------------------


Craig Boston wrote:
Quote:
Sorry about the cross-post -- I'm not 100% sure which list this should be sent
to.

I noticed in the 7.4 release that in contrib/pg_autovacuum, args->logfile is
not initialized if a log file is not specified on the command line. This
causes an immediate segfault on systems that fill allocated memory with some
value other than zero (my FreeBSD machine uses 0xD0).

Several crashes later I discovered that args->user, password, host, and port
are also used without being initialized.

This doesn't appear to be fixed in CVS and I came up empty on a mailing list
search -- hope it hasn't been reported already.

Attached is a quick patch that fixes the problem.

--
Craig
[ Attachment, skipping... ]

Quote:
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)
--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #4  
Old   
Bruce Momjian
 
Posts: n/a

Default Re: [BUGS] PATCH: Uninitialized variable usage in contrib/pg_autovacuum - 12-01-2003 , 05:17 PM




Patch applied to 7.4.X too.

---------------------------------------------------------------------------

Craig Boston wrote:
Quote:
Sorry about the cross-post -- I'm not 100% sure which list this should be sent
to.

I noticed in the 7.4 release that in contrib/pg_autovacuum, args->logfile is
not initialized if a log file is not specified on the command line. This
causes an immediate segfault on systems that fill allocated memory with some
value other than zero (my FreeBSD machine uses 0xD0).

Several crashes later I discovered that args->user, password, host, and port
are also used without being initialized.

This doesn't appear to be fixed in CVS and I came up empty on a mailing list
search -- hope it hasn't been reported already.

Attached is a quick patch that fixes the problem.

--
Craig
[ Attachment, skipping... ]

Quote:
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)
--
Bruce Momjian | http://candle.pha.pa.us
pgman (AT) candle (DOT) pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.