Bug#858529: libc6: fgets repeats content after fork on stretch only

2017-03-22 Thread Neil Spring
Package: libc6
Version: 2.24-9
Severity: normal

Dear Maintainers,

I'm testing a programming exercise for students, and found failed tests
that I believe are due to libc6.  I retried the minimal test case on
every machine I have access to, and found that only my two Debian Stretch
machines failed, then took a clean vagrant Jessie box, confirmed correct
behavior, updated to Stretch, and reproduced the error.

I expect the following code to print its input, once.  Instead, it 
prints lines two through four twice. (abcdbcd).

#include 
#include 
#include 
#include 

int main() {
  char buf[255];
  int ln=1;
  int status;
  FILE *f;

  f = fopen("/tmp/fourlines", "w");
  fprintf(f, "a\nb\nc\nd\n");
  fclose(f);

  f= fopen("/tmp/fourlines", "r");
  printf("%d: %s", ln++, fgets(buf, 255, f));

  if(fork() == 0) { exit(1); }
  wait();

  if(fgets(buf, 255, f)) printf("%d: %s", ln++, buf);
  if(fgets(buf, 255, f)) printf("%d: %s", ln++, buf);
  if(fgets(buf, 255, f)) printf("%d: %s", ln++, buf);
  if(fgets(buf, 255, f)) printf("%d: %s", ln++, buf);
  if(fgets(buf, 255, f)) printf("%d: %s", ln++, buf);
  if(fgets(buf, 255, f)) printf("%d: %s", ln++, buf);
  exit(0);
}

Output on my two machines and vm with 2.24-9:

1: a
2: b
3: c
4: d
5: b
6: c
7: d

The behavior is consistent under the debugger; I don't see 
anything obvious in the FILE structure, and notice that a 
read occurs between the d and b (the end of input and when 
what should be old data is back in).

I plan to look into slightly older libc6 versions to find the 
regression, but that will take me some time.

This is sent from the virtual machine, to keep it as clean as 
possible.


-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libc6 depends on:
ii  libgcc1  1:6.3.0-6

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.60
pn  glibc-doc  
ii  libc-l10n  2.24-9
ii  locales2.24-9

-- debconf information:
  glibc/restart-failed:
  glibc/kernel-too-old:
  glibc/upgrade: true
  glibc/restart-services:
  glibc/disable-screensaver:
  glibc/kernel-not-supported:
* libraries/restart-without-asking: true



Processed: fixed 854141 in 2017a-1, closing 854141

2017-03-22 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> fixed 854141 2017a-1
Bug #854141 [tzdata] tzdata: purging tzdata leaves dangling /etc/localtime 
symlink
Marked as fixed in versions tzdata/2017a-1.
> close 854141
Bug #854141 [tzdata] tzdata: purging tzdata leaves dangling /etc/localtime 
symlink
Marked Bug as done
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
854141: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854141
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#854141: [Piuparts-devel] tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Michael Biebl
Am 22.03.2017 um 17:09 schrieb Andreas Beckmann:
> And piuparts expects the chroot after the test to be in the same state
> as before the test. But that chroot was created with the previous
> version of tzdata installed, which was purged in a further minimizing
> step, but left that dangling symlink ... and got stored to disk as the
> base chroot for further sid tests. But now this link suddenly
> disappeared after installing+purging the new version, making piuparts
> unhappy.

Thanks for the explanation.
Now the error message "FAIL: After purging files have disappeared:"
suddenly makes more sense.

Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#854141: [Piuparts-devel] tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Andreas Beckmann
On 2017-03-22 17:02, Michael Biebl wrote:
> Well, the log says that tzdata_2017a-1 was installed and tested.
> Now I'm confused. Can you explain what piuparts is doing there?

And piuparts expects the chroot after the test to be in the same state
as before the test. But that chroot was created with the previous
version of tzdata installed, which was purged in a further minimizing
step, but left that dangling symlink ... and got stored to disk as the
base chroot for further sid tests. But now this link suddenly
disappeared after installing+purging the new version, making piuparts
unhappy.


Andreas



Bug#854141: [Piuparts-devel] tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Michael Biebl
Am 22.03.2017 um 16:56 schrieb Andreas Beckmann:
> Control: notfound -1 2017a-1
> 
> On 2017-03-22 16:46, Michael Biebl wrote:
> 
>> That bug seems to be still unfixed in the latest version
>>
>> https://piuparts.debian.org/sid/fail/tzdata_2017a-1.log
>>
>> 0m17.0s ERROR: FAIL: After purging files have disappeared:
>>   /etc/localtime -> /usr/share/zoneinfo/Etc/UTC   not owned
> 
> Nope, that just means the chroot needs to be regenerated with the new
> tzdata (which is now in testing, too). But that should have happened
> inbetween, so rescheduling the tzdata test in sid (from March 13) should
> be sufficient.

Well, the log says that tzdata_2017a-1 was installed and tested.
Now I'm confused. Can you explain what piuparts is doing there?


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#854141: [Piuparts-devel] tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Michael Biebl
Am 22.03.2017 um 16:56 schrieb Andreas Beckmann:

> tzdata (which is now in testing, too). But that should have happened
> inbetween, so rescheduling the tzdata test in sid (from March 13) should
> be sufficient.

Btw, can you please reschedule the affected piuparts tests, so that
evolution-data-server is no longer listed as failing and rejected from
testing migration because of that:

https://tracker.debian.org/pkg/evolution-data-server

Thanks,
Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#854141: [Piuparts-devel] tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Andreas Beckmann
Control: notfound -1 2017a-1

On 2017-03-22 16:46, Michael Biebl wrote:

> That bug seems to be still unfixed in the latest version
> 
> https://piuparts.debian.org/sid/fail/tzdata_2017a-1.log
> 
> 0m17.0s ERROR: FAIL: After purging files have disappeared:
>   /etc/localtime -> /usr/share/zoneinfo/Etc/UTCnot owned

Nope, that just means the chroot needs to be regenerated with the new
tzdata (which is now in testing, too). But that should have happened
inbetween, so rescheduling the tzdata test in sid (from March 13) should
be sufficient.

Andreas



Processed: Re: [Piuparts-devel] tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Debian Bug Tracking System
Processing control commands:

> notfound -1 2017a-1
Bug #854141 [tzdata] tzdata: purging tzdata leaves dangling /etc/localtime 
symlink
No longer marked as found in versions tzdata/2017a-1.

-- 
854141: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854141
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#854141: tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Michael Biebl
Control: found -1 2017a-1

On Sat, 04 Feb 2017 14:07:33 +0100 Andreas Beckmann  wrote:
> Package: tzdata
> Version: 2016j-2
> Severity: important
> User: debian...@lists.debian.org
> Usertags: piuparts
> 
> Hi,
> 
> during a test with piuparts I noticed your package left unowned files on
> the system after purge, which is a violation of policy 6.8 (or 10.8):
> 
> https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-removedetails
> 
> Filing this as important as having a piuparts clean archive is a release
> goal since lenny.
> 
> >From the attached log (scroll to the bottom...):
> 
> 0m36.2s ERROR: FAIL: Package purging left files on system:
>   /etc/localtime -> /usr/share/zoneinfo/Etc/UTCnot owned

That bug seems to be still unfixed in the latest version

https://piuparts.debian.org/sid/fail/tzdata_2017a-1.log

0m17.0s ERROR: FAIL: After purging files have disappeared:
  /etc/localtime -> /usr/share/zoneinfo/Etc/UTC  not owned

0m17.0s ERROR: FAIL: Installation and purging test.

This now blocks other packages, like evolution-data-server, from
entering testing.
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Processed: Re: tzdata: purging tzdata leaves dangling /etc/localtime symlink

2017-03-22 Thread Debian Bug Tracking System
Processing control commands:

> found -1 2017a-1
Bug #854141 {Done: Aurelien Jarno } [tzdata] tzdata: 
purging tzdata leaves dangling /etc/localtime symlink
Marked as found in versions tzdata/2017a-1; no longer marked as fixed in 
versions tzdata/2017a-1 and reopened.

-- 
854141: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854141
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems