Debian Bug report logs - #133640
[SEGFAULT] [S-S-D] [HURD] dpkg: start-stop-daemon segfaults in some cases

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Ognyan Kulev <ogi@fmi.uni-sofia.bg>

Date: Tue, 12 Feb 2002 23:18:01 UTC

Severity: important

Tags: patch, sid

Merged with 254180

Found in versions 1.9.17, 1.10.22

Fixed in versions dpkg/1.10.22, dpkg/1.10.23

Done: Scott James Remnant <scott@netsplit.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Gergely Nagy <algernon@debian.org>:
New Bug report received and forwarded. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Gergely Nagy <algernon@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg: [HURD] start-stop-daemon segfaults in some cases
Date: Wed, 13 Feb 2002 00:16:57 +0100
Package: dpkg
Version: 1.9.17
Severity: normal

In short:

# echo $RANDOM >foo.pid
# start-stop-daemon --stop --pidfile foo.pid --name foobar
Segmentation fault
# uname -a
GNU dryden 0.2 GNUmach-1.2/Hurd-0.2 i386-AT386 unknown
#

So far, I tracked it down to pid_is_cmd calling
proc_stat_list_pid_proc_stat with the first argument (procset) being
NULL, which shouldn't happen.

Grepping through the sources, do_procinit() is supposed to initialise
this global varible. Yet, that function is not called AFAICS (setting
a break point on it in gdb doesn't stop the program).

Since I'm not really familiar with start-stop-daemon yet, I don't have
a solution, nor an idea how to fix it. I'll try to investigate it
further, and will send followups to this bugreport, provided that
someone doesn't beat me.

Note that the contents of the pidfile doesn't matter, and without the
--name argument, it works fine, also without --pidfile foobar, it
works too. It just doesn't work with both specified :(

Oh, I tried dpkg CVS, and the bug is still present.



Information forwarded to debian-bugs-dist@lists.debian.org, Gergely Nagy <algernon@debian.org>, Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>, control@bugs.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Neal H Walfield <neal@cs.uml.edu>:
Extra info received and forwarded to list. Copy sent to Gergely Nagy <algernon@debian.org>, Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>, control@bugs.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org. Full text and rfc822 format available.

Message #10 received at 133640@bugs.debian.org (full text, mbox):

From: Neal H Walfield <neal@cs.uml.edu>
To: 133640@bugs.debian.org
Subject: A fix
Date: 23 Feb 2002 17:00:07 -0500
tag 133640 patch
thanks

Here is a patch to fix the problem.  I am not sure that it is the best
fix as I do not completely understand the internal interfaces.

What I have gathered is that do_procinit is a misnomer.  From
examining the other implementations (for OpenBSD, Linux and SunOS
based systems), I conclude that it is only used to verify that the
/proc filesystem is mounted and is not in fact an initialization
routine.  I reach this later conclusion based on the fact that it is
not consistently called.

My solution is to empty do_procinit (the Hurd implementation does not
depend on it) and introduce a new constructor (do_libpsinit) to
initialize some structures that we use for libps.  This fixes the
reported segmentation fault.

In fixing the segmentation fault, I ran across two other bugs in the
Hurd implementation: pid_is_user throws a fatal error if the pid does
not exist as does pid_is_cmd.  Instead, they should just return
failure.  The attached patch also fixes this.

Thanks.

--- start-stop-daemon.c.orig	Sat Feb 23 16:18:02 2002
+++ start-stop-daemon.c	Sat Feb 23 16:45:46 2002
@@ -628,9 +628,10 @@ pid_is_user(pid_t pid, uid_t uid)
 		return 0;
 	return (sb.st_uid == uid);
 	pstat = proc_stat_list_pid_proc_stat (procset, pid);
-	if (pstat == NULL)
-		fatal ("Error getting process information: NULL proc_stat struct");
-	proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_OWNER_UID);
+	if (pstat)
+		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_OWNER_UID);
+	else
+		return 1;
 	return (pstat->owner_uid == uid);
 }
 
@@ -639,9 +640,10 @@ pid_is_cmd(pid_t pid, const char *name)
 {
 	struct proc_stat *pstat;
 	pstat = proc_stat_list_pid_proc_stat (procset, pid);
-	if (pstat == NULL)
-		fatal ("Error getting process information: NULL proc_stat struct");
-	proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_ARGS);
+	if (pstat)
+		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_ARGS);
+	else
+		return 1;
 	return (!strcmp (name, pstat->args));
 }
 #endif /* OSHURD */
@@ -722,6 +724,14 @@ check_all (void *ptr)
 
 static void
 do_procinit(void)
+{
+        /* Nothing to do. */
+}
+
+static void do_libpsinit(void)  __attribute__ ((constructor));
+
+static void
+do_libpsinit(void)
 {
 	struct ps_context *context;
 	error_t err;



Tags added: patch Request was from Neal H Walfield <neal@cs.uml.edu> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to owner@bugs.debian.org (Debian Bug Tracking System):
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org. Full text and rfc822 format available.

Message #17 received at 133640@bugs.debian.org (full text, mbox):

From: owner@bugs.debian.org (Debian Bug Tracking System)
To: Neal H Walfield <neal@cs.uml.edu>, 133640@bugs.debian.org
Cc: Dpkg Development <debian-dpkg@lists.debian.org> (dpkg #133640)
Subject: Processed: Bug#133640: A fix
Date: Sat, 23 Feb 2002 16:03:11 -0600
Processing commands for control@bugs.debian.org:

> tag 133640 patch
Bug#133640: dpkg: [HURD] start-stop-daemon segfaults in some cases
Tags added: patch

> thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)




Changed Bug title. Request was from Adam Heath <doogie@brainfood.com> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug title. Request was from Adam Heath <doogie@brainfood.com> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Michael Banck <mbanck@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #26 received at 133640@bugs.debian.org (full text, mbox):

From: Michael Banck <mbanck@debian.org>
To: 133640@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#133640: A fix
Date: Mon, 17 May 2004 23:31:27 +0200
severity 133640 important
thanks

This bug would be 'grave' if hurd-i386 was a released architecture.
Basically, it makes every init-script running S-S-D segfault when called
as 'stop' or 'restart'. This completely breaks package updates of
daemons.

I've tested the below patch now for a couple of weeks and it works well.
The patch still applies cleanly, albeit with a bit of fuzz.

See http://lists.debian.org/debian-hurd/2004/04/msg00037.html and
http://lists.debian.org/debian-hurd/2004/05/index.html as well as their
follow-ups for some feedback. I've also built dpkg on GNU/Linux with
this patch and I did not experience a regression there.

I've just talked to Neal again and he still thinks the patch is good.
So, could you please apply it for your next upload? This is really a
nasty showstopper for the Hurd port right now.


Thanks,

Michael

On Sat, Feb 23, 2002 at 05:00:07PM -0500, Neal H Walfield wrote:
> Here is a patch to fix the problem.  I am not sure that it is the best
> fix as I do not completely understand the internal interfaces.
> 
> What I have gathered is that do_procinit is a misnomer.  From
> examining the other implementations (for OpenBSD, Linux and SunOS
> based systems), I conclude that it is only used to verify that the
> /proc filesystem is mounted and is not in fact an initialization
> routine.  I reach this later conclusion based on the fact that it is
> not consistently called.
> 
> My solution is to empty do_procinit (the Hurd implementation does not
> depend on it) and introduce a new constructor (do_libpsinit) to
> initialize some structures that we use for libps.  This fixes the
> reported segmentation fault.
> 
> In fixing the segmentation fault, I ran across two other bugs in the
> Hurd implementation: pid_is_user throws a fatal error if the pid does
> not exist as does pid_is_cmd.  Instead, they should just return
> failure.  The attached patch also fixes this.
> 
> Thanks.
> 
> --- start-stop-daemon.c.orig	Sat Feb 23 16:18:02 2002
> +++ start-stop-daemon.c	Sat Feb 23 16:45:46 2002
> @@ -628,9 +628,10 @@ pid_is_user(pid_t pid, uid_t uid)
>  		return 0;
>  	return (sb.st_uid == uid);
>  	pstat = proc_stat_list_pid_proc_stat (procset, pid);
> -	if (pstat == NULL)
> -		fatal ("Error getting process information: NULL proc_stat struct");
> -	proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_OWNER_UID);
> +	if (pstat)
> +		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_OWNER_UID);
> +	else
> +		return 1;
>  	return (pstat->owner_uid == uid);
>  }
>  
> @@ -639,9 +640,10 @@ pid_is_cmd(pid_t pid, const char *name)
>  {
>  	struct proc_stat *pstat;
>  	pstat = proc_stat_list_pid_proc_stat (procset, pid);
> -	if (pstat == NULL)
> -		fatal ("Error getting process information: NULL proc_stat struct");
> -	proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_ARGS);
> +	if (pstat)
> +		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_ARGS);
> +	else
> +		return 1;
>  	return (!strcmp (name, pstat->args));
>  }
>  #endif /* OSHURD */
> @@ -722,6 +724,14 @@ check_all (void *ptr)
>  
>  static void
>  do_procinit(void)
> +{
> +        /* Nothing to do. */
> +}
> +
> +static void do_libpsinit(void)  __attribute__ ((constructor));
> +
> +static void
> +do_libpsinit(void)
>  {
>  	struct ps_context *context;
>  	error_t err;
> 
> 
> 



Severity set to `important'. Request was from Michael Banck <mbanck@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Scott James Remnant <scott@netsplit.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #33 received at 133640@bugs.debian.org (full text, mbox):

From: Scott James Remnant <scott@netsplit.com>
To: Michael Banck <mbanck@debian.org>, 133640@bugs.debian.org
Subject: Re: Bug#133640: A fix
Date: Mon, 17 May 2004 23:04:29 +0100
[Message part 1 (text/plain, inline)]
On Mon, 2004-05-17 at 23:31 +0200, Michael Banck wrote:

> This bug would be 'grave' if hurd-i386 was a released architecture.
> 
No, it would still be "important" -- it doesn't make the package
unusable or mostly so.

> I've just talked to Neal again and he still thinks the patch is good.
> So, could you please apply it for your next upload? This is really a
> nasty showstopper for the Hurd port right now.
> 
Will have a check myself, but looks reasonable.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Ognyan Kulev <ogi@fmi.uni-sofia.bg>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #38 received at 133640@bugs.debian.org (full text, mbox):

From: Ognyan Kulev <ogi@fmi.uni-sofia.bg>
To: debian-hurd@lists.debian.org
Cc: Michael Banck <mbanck@debian.org>, 133640@bugs.debian.org
Subject: Re: new dpkg packages up for testing
Date: Sun, 23 May 2004 15:36:57 +0300
/* Cc: 133640@bugs.debian.org */

Ognyan Kulev wrote:
> I've reinstalled my Hurd and the SEGV doesn't appear anymore, so my 
> report is no longer reason for holding 1.10.20.0.1.  But there is 
> 1.10.21 upstream with long changelog entry, so I guess it's best the 
> patch to be re-applied to this newer version.

I've found why start-stop-daemon signals SEGV on my old installation. 
It's reproduced when new hurd package is compiled and installed.  As we 
know, since last hurd package upload 20040301-1, there is an API & ABI 
change in libihash.  libihash is used by libps, (1) so all programs that 
use libps should be recompiled, including start-stop-daemon of dpkg.

Unfortunately, it's not only that.  (2) In start-stop-daemon, old 
function ihash_iterate should be replaced with HURD_IHASH_ITERATE. 
There are two problems with this replacement.  In struct ps_context of 
ps.h, surprisingly struct hurd_ihash is used instead of hurd_ihash_t for 
some fields.  (3) So parameter to HURD_IHASH_ITERATE should be 
&context->procs instead of just context->procs.  And the last problem is 
that (4) HURD_IHASH_ITERATE uses C99 style definition of variables 
inside for statement and dpkg doesn't enable this style by default.

After all these things are made, I experience no problem with patched 
1.10.21.

Regards,
ogi




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Ognyan Kulev <ogi@fmi.uni-sofia.bg>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #43 received at 133640@bugs.debian.org (full text, mbox):

From: Ognyan Kulev <ogi@fmi.uni-sofia.bg>
To: Michael Banck <mbanck@debian.org>
Cc: debian-hurd@lists.debian.org, 133640@bugs.debian.org
Subject: Re: new dpkg packages up for testing
Date: Mon, 24 May 2004 17:38:29 +0300
[Message part 1 (text/plain, inline)]
Michael Banck wrote:
> On Mon, May 24, 2004 at 03:33:39PM +0300, Ognyan Kulev wrote:
>>Michael Banck wrote:
>>>Does this mean we'd have to get dpkg to change it's build-behaviour? Or
>>>is there another solution?
>>
>>I've just added -std=gnu99 to CFLAGS in utils/Makefile.in. 
>>HURD_IHASH_ITERATE is the only legal way to iterate through all elements 
>>in ihash and it needs C99 syntax.  So one way or another, 
>>start-stop-daemon should be compiled with C99 syntax enabled.  I think 
>>that there is no harm in enabling C99 for utils/*, or even the whole dpkg.
> 
> Hmm, alright. I just hope the dpkg guys don't take this as an excuse to
> not apply the patch 'just prior to release'. Better to limit it to
> utils.

The patch is attached.  -std=gnu99 is applied only when SSD is compiled.

Again, this patch should be applied upstream only when new hurd package 
(with ihash changes) is uploaded.

I've uploaded my binary packages to 
http://debian.fmi.uni-sofia.bg/~ogi/hurd/repo/ .

Regards,
ogi
[dpkg.diff (text/x-patch, inline)]
diff --exclude='config*' --exclude=changelog --exclude='*~' -urpN ../cvs/dpkg-1.10.21/utils/Makefile.in dpkg-1.10.21.ogi.2/utils/Makefile.in
--- ../cvs/dpkg-1.10.21/utils/Makefile.in	2002-08-24 22:54:19.000000000 +0300
+++ dpkg-1.10.21.ogi.2/utils/Makefile.in	2004-05-24 19:39:59.000000000 +0300
@@ -71,6 +71,9 @@ endif
 	$(mkinstalldirs) $(DESTDIR)/$(man1dir)
 	$(INSTALL_DATA) $(srcdir)/$(MD5_MANPAGES) $(DESTDIR)/$(man1dir)
 
+# When compiled for the Hurd, start-stop-daemon.c should be compiled
+# with C99 features enabled.
+start-stop-daemon.o: CFLAGS += -std=gnu99
 start-stop-daemon: $(SSD_OBJECTS) ../lib/libdpkg.a
 	$(CC) $(LDFLAGS) -o $@ $(SSD_OBJECTS) $(LIBS) $(SSD_LIBS)
 
diff --exclude='config*' --exclude=changelog --exclude='*~' -urpN ../cvs/dpkg-1.10.21/utils/start-stop-daemon.c dpkg-1.10.21.ogi.2/utils/start-stop-daemon.c
--- ../cvs/dpkg-1.10.21/utils/start-stop-daemon.c	2004-03-12 17:07:43.000000000 +0200
+++ dpkg-1.10.21.ogi.2/utils/start-stop-daemon.c	2004-05-24 19:42:47.000000000 +0300
@@ -650,9 +650,10 @@ pid_is_user(pid_t pid, uid_t uid)
 		return 0;
 	return (sb.st_uid == uid);
 	pstat = proc_stat_list_pid_proc_stat (procset, pid);
-	if (pstat == NULL)
-		fatal ("Error getting process information: NULL proc_stat struct");
-	proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_OWNER_UID);
+	if (pstat)
+		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_OWNER_UID);
+	else
+		return 1;
 	return (pstat->owner_uid == uid);
 }
 
@@ -661,9 +662,10 @@ pid_is_cmd(pid_t pid, const char *name)
 {
 	struct proc_stat *pstat;
 	pstat = proc_stat_list_pid_proc_stat (procset, pid);
-	if (pstat == NULL)
-		fatal ("Error getting process information: NULL proc_stat struct");
-	proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_ARGS);
+	if (pstat)
+		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_ARGS);
+	else
+		return 1;
 	return (!strcmp (name, pstat->args));
 }
 #endif /* OSHURD */
@@ -751,17 +753,16 @@ do_procinit(void)
 
 
 #if defined(OSHURD)
-error_t
-check_all(void *ptr)
+static void
+do_procinit(void)
 {
-	struct proc_stat *pstat = ptr;
-
-	check(pstat->pid);
-	return 0;
+	/* Nothing */
 }
 
+static void do_libpsinit(void)  __attribute__ ((constructor));
+
 static void
-do_procinit(void)
+do_libpsinit(void)
 {
 	struct ps_context *context;
 	error_t err;
@@ -779,7 +780,10 @@ do_procinit(void)
 		error(1, err, "proc_stat_list_add_all");
 
 	/* Check all pids */
-	ihash_iterate(context->procs, check_all);
+	HURD_IHASH_ITERATE (&context->procs, ptr) {
+		struct proc_stat *pstat = ptr;
+		check(pstat->pid);
+	}
 }
 #endif /* OSHURD */
 

Tags added: pending Request was from Scott James Remnant <scott@netsplit.com> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Ognyan Kulev <ogi@fmi.uni-sofia.bg>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #50 received at 133640@bugs.debian.org (full text, mbox):

From: Ognyan Kulev <ogi@fmi.uni-sofia.bg>
To: Michael Banck <mbanck@debian.org>
Cc: debian-hurd@lists.debian.org, 133640@bugs.debian.org
Subject: Re: new dpkg packages up for testing
Date: Sun, 30 May 2004 19:41:46 +0300
Ognyan Kulev wrote:
> Again, this patch should be applied upstream only when new hurd package 
> (with ihash changes) is uploaded.

I see that new hurd package with the ihash changes is uploaded[1].  It's 
very desirable to have the updated patch applied in next release of dpkg.

[1] http://packages.qa.debian.org/h/hurd/news/1.html

Regards,
ogi




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Michael Banck <mbanck@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #55 received at 133640@bugs.debian.org (full text, mbox):

From: Michael Banck <mbanck@debian.org>
To: 133640@bugs.debian.org
Subject: some issues still left
Date: Mon, 31 May 2004 00:50:26 +0200
Hi,

I've just built a dpkg from a tarball provided by Scott.

There are two-and-a-half issues:

1. We really need to pass -std=gnu99, otherwise this error appears:

start-stop-daemon.c:775: error: 'for' loop intial declaration used
	outside C99 mode

--- ../cvs/dpkg-1.10.21/utils/Makefile.in
+++ dpkg-1.10.21.ogi.2/utils/Makefile.in
@@ -71,6 +71,9 @@ endif
        $(mkinstalldirs) $(DESTDIR)/$(man1dir)
        $(INSTALL_DATA) $(srcdir)/$(MD5_MANPAGES) $(DESTDIR)/$(man1dir)

+# When compiled for the Hurd, start-stop-daemon.c should be compiled
+# with C99 features enabled.
+start-stop-daemon.o: CFLAGS += -std=gnu99
 start-stop-daemon: $(SSD_OBJECTS) ../lib/libdpkg.a
        $(CC) $(LDFLAGS) -o $@ $(SSD_OBJECTS) $(LIBS) $(SSD_LIBS)

2. One part of Neal's patch did not get applied yet, and I still get
segfaults without it (and it's fine after applying it): 

(utils/start-stop-daemon.c)
@@ -722,6 +724,14 @@ check_all (void *ptr)

 static void
 do_procinit(void)
+{
+        /* Nothing to do. */
+}
+
+static void do_libpsinit(void)  __attribute__ ((constructor));
+
+static void
+do_libpsinit(void)
 {
        struct ps_context *context;
        error_t err;
                                                                                   
2.5: There's an unrelated parse error in utils/md5sum.c.

Sorry if the diffs don't apply cleanly, I copy&pasted them from the BTS
web pages.

cheers,

Michael

-- 
Michael Banck
Debian Developer
mbanck@debian.org
http://www.advogato.org/person/mbanck/diary.html



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Scott James Remnant <scott@netsplit.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #60 received at 133640@bugs.debian.org (full text, mbox):

From: Scott James Remnant <scott@netsplit.com>
To: Michael Banck <mbanck@debian.org>, 133640@bugs.debian.org
Subject: Re: Bug#133640: some issues still left
Date: Sun, 30 May 2004 20:49:36 -0300
[Message part 1 (text/plain, inline)]
On Mon, 2004-05-31 at 00:50 +0200, Michael Banck wrote:

> I've just built a dpkg from a tarball provided by Scott.
> 
> There are two-and-a-half issues:
> 
> 1. We really need to pass -std=gnu99, otherwise this error appears:
> 
> start-stop-daemon.c:775: error: 'for' loop intial declaration used
> 	outside C99 mode
> 
Ok, can we have this macro removed and replaced with a C90 equivalent
then?

> 2. One part of Neal's patch did not get applied yet, and I still get
> segfaults without it (and it's fine after applying it): 
> 
This bit is clearly crack; I'm not going to add a constructor function
-- find a better way to do this.

> 2.5: There's an unrelated parse error in utils/md5sum.c.
> 
Yeah, this was my bad... fixed in arch.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
[signature.asc (application/pgp-signature, inline)]

Reply sent to Scott James Remnant <scott@netsplit.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Gergely Nagy <algernon@debian.org>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #65 received at 133640-close@bugs.debian.org (full text, mbox):

From: Scott James Remnant <scott@netsplit.com>
To: 133640-close@bugs.debian.org
Subject: Bug#133640: fixed in dpkg 1.10.22
Date: Wed, 02 Jun 2004 14:47:04 -0400
Source: dpkg
Source-Version: 1.10.22

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive:

dpkg-dev_1.10.22_all.deb
  to pool/main/d/dpkg/dpkg-dev_1.10.22_all.deb
dpkg-doc_1.10.22_all.deb
  to pool/main/d/dpkg/dpkg-doc_1.10.22_all.deb
dpkg_1.10.22.dsc
  to pool/main/d/dpkg/dpkg_1.10.22.dsc
dpkg_1.10.22.tar.gz
  to pool/main/d/dpkg/dpkg_1.10.22.tar.gz
dpkg_1.10.22_i386.deb
  to pool/main/d/dpkg/dpkg_1.10.22_i386.deb
dselect_1.10.22_i386.deb
  to pool/main/d/dpkg/dselect_1.10.22_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 133640@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Scott James Remnant <scott@netsplit.com> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue,  1 Jun 2004 18:21:40 -0300
Source: dpkg
Binary: dpkg-doc dpkg dselect dpkg-dev dpkg-static
Architecture: source all i386
Version: 1.10.22
Distribution: unstable
Urgency: low
Maintainer: Dpkg Development <debian-dpkg@lists.debian.org>
Changed-By: Scott James Remnant <scott@netsplit.com>
Description: 
 dpkg       - Package maintenance system for Debian
 dpkg-dev   - Package building tools for Debian
 dpkg-doc   - Dpkg Internals Documentation
 dselect    - a user tool to manage Debian packages
Closes: 41554 81355 85079 85815 85818 96881 114946 120562 122910 133640 137719 140695 154422 175897 179648 192812 202997 204691 206163 211850 211856 212284 216695 217042 217823 218060 219623 221235 226800 226931 227169 229766 230242 230751 232317 232445 232639 232831 233282 235773 236331 237734 238483 241938 244624 245994 246103 246158 246159 246160 246161 246162 246163 246164 246359 246595 246857 247086 247116 248483 249254 249454 250176 250281 251830
Changes: 
 dpkg (1.10.22) unstable; urgency=low
 .
   The DebConf4 Release.
 .
   This release is mostly intended to mop up the minor and trivial bug
   fixes in the list and clear out the documentation changes.  As such,
   it should be treated with even more suspicion than is normal.
 .
   * Use colouring to break cycles earlier to avoid long loops whilst
     installing or configuring packages.  Closes: #232445, #246857.
   * Don't try to configure packages that disappeared in the same
     run.  Closes: #202997.
   * Fix segfault when "gcc -dumpmachine" returns a non-matching triplet.
     Closes: #211850.
   * Remove restriction that package names be at least two characters long.
     Closes: #237734.
   * Fix dpkg-source (actually controllib.pl) to output the field name
     properly again.  Closes: #226931, #246595.
   * Make dpkg-scanpackages output Origin and Bugs fields with proper
     casing.  Closes: #154422.
   * Add support for DOS line-endings to md5sum.  Closes: #246103.
   * Fix start-stop-daemon segfault on Hurd.  Closes: #133640.
   * Allow dpkg-shlibdeps to run as non-root users.  Closes: #96881.
   * Correct various compiler warnings.  Closes: #229766.
 .
   * Architecture Support:
     - Added x86-64 (x86_64 / amd64).  Closes: #238483, #241938.
     - Added i?86-gnu (Hurd).  Closes: #216695, #236331.
     - Added i386-kfreebsd-gnu and i386-knetbsd-gnu.  Closes: #250176.
   * Packaging:
     - Create $(docdir) even when --without-sgml-doc is passed so the
       ChangeLog can be installed.  Closes: #137719.
     - Stop hardcoding the list of manual page languages in debian/rules,
       so we include Spanish, Russian and Brazilian Portugese.  Closes: #245994.
     - Quote LDFLAGS in debian/rules to allow multiple options.
       Closes: #230242.
   * Documentation:
     - Move dpkg-scanpackages and dpkg-scansources to section 1 as they
       are user tools.  Closes: #114946.
     - Correct hyphen characters in manpages.  Closes: #212284, #247086, #226800.
     - Remove obsolete references to the Debian Packaging Manual.
       Closes: #122910, #140695.
     - Correct 'n' and 'p' key descriptions in dselect help message.
       Closes: #120562.
     - Add --force-bad-verify to dpkg manpage.  Closes: #192812.
     - Correct dpkg manpage to refer to --force-remove-reinstreq instead of
       -non-existant --force-reinstreq option.  Closes: #232831.
     - Correct documentation of --compare-versions arguments.  Closes: #232317.
     - Correct usage of "et al" to "et al.".  Closes: #230751.
     - Add dpkg-reconfigure(8) to SEE ALSO section of dpkg(8).  Closes: #233282.
     - Suggest packages that provide additional functionality in the dpkg
       manpage.  Closes: #81355.
     - Suggest dselect update in description of dpkg --update-avail.
       Closes: #206163.
     - Suggest aptitude as well as dselect.  Closes: #217042.
     - Suggest fakeroot for dpkg-source -r.  Closes: #175897.
     - Correct documentation of start-stop-daemon.  Closes: #41554, #211856.
     - Correct documentation of start-stop-daemon manpage to refer to --retry
       alongside --stop.  Closes: #204691.
     - Add note that start-stop-daemon will chdir("/") unless -d is specified.
       Closes: #217823, #218060.
     - Correct documentation of dpkg-query --list.  Closes: #232639.
     - Correct invalid use of &quot; within update-alternatives(8) with .BR.
       Closes: #244624.
     - Rewrite description of dpkg-source -i to indicate the intent of the
       default setting rather than the exact exclusions.  Closes: #227169.
     - Correct documentation of dpkg-statoverride --update.  Closes: #85079.
     - Correct documentation of update-alternatives --install.  Closes: #179648.
     - Documented dpkg:Version and dpkg:UpstreamVersion substvars.
       Closes: #85815, #85818.
     - Fix spelling error in utils/md5sum.1.  Closes: #250281.
     - Replace "&c." with the slightly clearer "etc.".  Closes: #235773.
     - Correct various typos.  Closes: #219623, #221235.
   * Updated Translations:
     - Catalan (Jordi Mallach).
     - French (Christian Perrier).  Closes: #246359.
     - Italian (Lele Gaifax).
     - Japanese manpages (KISE Hiroshi).  Closes: #248483.
     - Russian (Nikolai Prokoschenko).  Closes: #249254.
     - Spanish manpages (Ruben Porras).  Closes: #246158, #246159, #246160,
       #246161, #246162, #246163, #251830.
   * New Translations:
     - German start-stop-daemon and update-alternatives manpages
       (Helge Kreutzmann).  Closes: #247116, #249454.
     - Spanish dpkg-scansources manpage (Ruben Porras).  Closes: #246164.
Files: 
 30f042fc1f3db3d9143438f4e2306149 798 base required dpkg_1.10.22.dsc
 2fc62cd054f1be7d1f8cb8073262a120 1714586 base required dpkg_1.10.22.tar.gz
 4bc9129933db0c7b0785a489c97731dc 1276700 base required dpkg_1.10.22_i386.deb
 e0475bfa90adb09db43e61eda465c362 119716 base required dselect_1.10.22_i386.deb
 0d64ddb21e386e1b126e5aaa2e9706c4 166218 utils standard dpkg-dev_1.10.22_all.deb
 acccec3738feda8e1ff7ad3fe7db005c 10616 doc optional dpkg-doc_1.10.22_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAvPQ3IexP3IStZ2wRAuqZAJ4mE9ylYoJBuLl0YV6SVGo71zTBRACgqqy9
0KbAumIvcM1r4tuxlS3RWPE=
=VO/U
-----END PGP SIGNATURE-----




Bug reopened, originator set to debian-hurd@lists.debian.org. Request was from Ognyan Kulev <ogi@fmi.uni-sofia.bg> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug submitter from debian-hurd@lists.debian.org to Ognyan Kulev <ogi@fmi.uni-sofia.bg>. Request was from Ognyan Kulev <ogi@fmi.uni-sofia.bg> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#133640; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Ognyan Kulev <ogi@fmi.uni-sofia.bg>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #74 received at 133640@bugs.debian.org (full text, mbox):

From: Ognyan Kulev <ogi@fmi.uni-sofia.bg>
To: 133640@bugs.debian.org
Subject: Patch without C99 and constructor
Date: Wed, 16 Jun 2004 11:28:30 +0300
[Message part 1 (text/plain, inline)]
Hi,

Patch that really closes this bug is attached.

I've moved pid_is_running inside #ifndef OSHURD because this function 
uses /proc which is not available in the Hurd.  Version of 
pid_is_running that uses Hurd's things is provided.
[ssd.diff (text/x-patch, inline)]
--- start-stop-daemon.c.orig	2004-06-16 13:50:54.000000000 +0300
+++ start-stop-daemon.c	2004-06-16 13:51:01.000000000 +0300
@@ -89,9 +89,6 @@
 #ifdef HAVE_ERROR_H
 #  include <error.h>
 #endif
-#ifdef HURD_IHASH_H
-  #include <hurd/ihash.h>
-#endif
 
 static int testmode = 0;
 static int quietmode = 0;
@@ -121,7 +118,7 @@ static int nicelevel = 0;
 
 static struct stat exec_stat;
 #if defined(OSHURD)
-static struct proc_stat_list *procset;
+static struct proc_stat_list *procset = NULL;
 #endif
 
 
@@ -638,38 +635,70 @@ pid_is_cmd(pid_t pid, const char *name)
 
 
 #if defined(OSHURD)
+static void
+init_procset(void)
+{
+	struct ps_context *context;
+	error_t err;
+
+	err = ps_context_create(getproc(), &context);
+	if (err)
+		error(1, err, "ps_context_create");
+
+	err = proc_stat_list_create(context, &procset);
+	if (err)
+		error(1, err, "proc_stat_list_create");
+
+	err = proc_stat_list_add_all(procset, 0, 0);
+	if (err)
+		error(1, err, "proc_stat_list_add_all");
+}
+
+static struct proc_stat *
+get_proc_stat (pid_t pid, ps_flags_t flags)
+{
+	struct proc_stat *ps;
+	ps_flags_t wanted_flags = PSTAT_PID | flags;
+
+	if (!procset)
+		init_procset();
+
+	ps = proc_stat_list_pid_proc_stat(procset, pid);
+	if (!ps)
+		return NULL;
+	if (proc_stat_set_flags(ps, wanted_flags))
+		return NULL;
+	if ((proc_stat_flags(ps) & wanted_flags) != wanted_flags)
+		return NULL;
+
+	return ps;
+}
+
 static int
 pid_is_user(pid_t pid, uid_t uid)
 {
-	struct stat sb;
-	char buf[32];
-	struct proc_stat *pstat;
+	struct proc_stat *ps;
 
-	sprintf(buf, "/proc/%d", pid);
-	if (stat(buf, &sb) != 0)
-		return 0;
-	return (sb.st_uid == uid);
-	pstat = proc_stat_list_pid_proc_stat (procset, pid);
-	if (pstat)
-		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_OWNER_UID);
-	else
-		return 1;
-	return (pstat->owner_uid == uid);
+	ps = get_proc_stat(pid, PSTAT_OWNER_UID);
+	return ps && proc_stat_owner_uid(ps) == uid;
 }
 
 static int
 pid_is_cmd(pid_t pid, const char *name)
 {
-	struct proc_stat *pstat;
-	pstat = proc_stat_list_pid_proc_stat (procset, pid);
-	if (pstat)
-		proc_stat_set_flags (pstat, PSTAT_PID | PSTAT_ARGS);
-	else
-		return 1;
-	return (!strcmp (name, pstat->args));
+	struct proc_stat *ps;
+
+	ps = get_proc_stat(pid, PSTAT_ARGS);
+	return ps && !strcmp(proc_stat_args(ps), name);
+}
+
+static int
+pid_is_running(pid_t pid)
+{
+	return get_proc_stat(pid, 0) != NULL;
 }
-#endif /* OSHURD */
 
+#else /* !OSHURD */
 
 static int
 pid_is_running(pid_t pid)
@@ -687,6 +716,8 @@ pid_is_running(pid_t pid)
 	return 1;
 }
 
+#endif /* OSHURD */
+
 static void
 check(pid_t pid)
 {
@@ -753,29 +784,20 @@ do_procinit(void)
 
 
 #if defined(OSHURD)
+static int
+check_proc_stat (struct proc_stat *ps)
+{
+	check(ps->pid);
+	return 0;
+}
+
 static void
 do_procinit(void)
 {
-	struct ps_context *context;
-	error_t err;
-
-	err = ps_context_create(getproc(), &context);
-	if (err)
-		error(1, err, "ps_context_create");
+	if (!procset)
+		init_procset();
 
-	err = proc_stat_list_create(context, &procset);
-	if (err)
-		error(1, err, "proc_stat_list_create");
-
-	err = proc_stat_list_add_all(procset, 0, 0);
-	if (err)
-		error(1, err, "proc_stat_list_add_all");
-
-	/* Check all pids */
-	HURD_IHASH_ITERATE (&context->procs, ptr) {
-		struct proc_stat *pstat = ptr;
-		check(pstat->pid);
-	}
+	proc_stat_list_for_each (procset, check_proc_stat);
 }
 #endif /* OSHURD */
 

Tags added: sid Request was from Ognyan Kulev <ogi@fmi.uni-sofia.bg> to control@bugs.debian.org. Full text and rfc822 format available.

Merged 133640 254180. Request was from Ognyan Kulev <ogi@fmi.uni-sofia.bg> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to Scott James Remnant <scott@netsplit.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Ognyan Kulev <ogi@fmi.uni-sofia.bg>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #83 received at 133640-close@bugs.debian.org (full text, mbox):

From: Scott James Remnant <scott@netsplit.com>
To: 133640-close@bugs.debian.org
Subject: Bug#133640: fixed in dpkg 1.10.23
Date: Mon, 19 Jul 2004 15:47:30 -0400
Source: dpkg
Source-Version: 1.10.23

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive:

dpkg-dev_1.10.23_all.deb
  to pool/main/d/dpkg/dpkg-dev_1.10.23_all.deb
dpkg-doc_1.10.23_all.deb
  to pool/main/d/dpkg/dpkg-doc_1.10.23_all.deb
dpkg_1.10.23.dsc
  to pool/main/d/dpkg/dpkg_1.10.23.dsc
dpkg_1.10.23.tar.gz
  to pool/main/d/dpkg/dpkg_1.10.23.tar.gz
dpkg_1.10.23_i386.deb
  to pool/main/d/dpkg/dpkg_1.10.23_i386.deb
dselect_1.10.23_i386.deb
  to pool/main/d/dpkg/dselect_1.10.23_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 133640@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Scott James Remnant <scott@netsplit.com> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 19 Jul 2004 19:52:14 +0100
Source: dpkg
Binary: dpkg-doc dpkg dselect dpkg-dev dpkg-static
Architecture: source all i386
Version: 1.10.23
Distribution: unstable
Urgency: low
Maintainer: Dpkg Development <debian-dpkg@lists.debian.org>
Changed-By: Scott James Remnant <scott@netsplit.com>
Description: 
 dpkg       - Package maintenance system for Debian
 dpkg-dev   - Package building tools for Debian
 dpkg-doc   - Dpkg Internals Documentation
 dselect    - a user tool to manage Debian packages
Closes: 133640 246158 246159 246160 246161 246162 246163 246164 252346 252407 252586 254175 254180 254209 254590 254598 256302
Changes: 
 dpkg (1.10.23) unstable; urgency=low
 .
   The "Let the Wookie win" Release.
 .
   * Updated hurd start-stop-daemon support.  Closes: #133640, #254180.
   * Removed usage of non-POSIX test options.  Closes: #256302.
 .
   * Architecture Support:
     - Renamed x86-64 to amd64.  Closes: #252346, #254598.
   * Documentation:
     - Correct typo in dpkg-divert(8).  Closes: #254175.
   * New Translations:
     - Korean (Changwoo Ryu).  Closes: #254590.
   * Updated Translations:
     - Catalan (Jordi Mallach).
     - Danish (Claus Hindsgaul).  Closes: #252407.
     - French (Christian Perrier).  Closes: #252586.
     - Italian (Lele Gaifax).
     - Polish (Bartosz Fenski).  Closes: #254209.
     - Spanish manpages (Ruben Porras).  Closes: #246158, #246159, #246160,
       #246161, #246162, #246163, #246164.
Files: 
 2eb35b462d81826455016fad6c5e8f3a 798 base required dpkg_1.10.23.dsc
 94a845ab0e14deb196d43e03c48a16b9 1763248 base required dpkg_1.10.23.tar.gz
 d6498369a2404180e10950ff1162ccec 1341122 base required dpkg_1.10.23_i386.deb
 edf5d858fc64757ef43855935ff961c7 119848 base required dselect_1.10.23_i386.deb
 2eabc2d309da69a9cb0449652e65221b 165728 utils standard dpkg-dev_1.10.23_all.deb
 bb925ebd2e7c47eacab34ed4cc171941 10612 doc optional dpkg-doc_1.10.23_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA/BqrIexP3IStZ2wRAn7qAJ45IerZoUtRwmicirNhEE6BFlbESACgo//G
tnS5yOFrND1ZGS/aaL8BZfs=
=SC/e
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 15:09:22 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.