Bug#839905: Bug#840293: pkg-kde-tools: pkgkde-symbolshelper broken by perl 5.24

2016-10-16 Thread Lisandro Damián Nicanor Pérez Meyer
On domingo, 16 de octubre de 2016 4:56:56 P. M. ART Guillem Jover wrote:
[snip]
> Ok, it seems the BTS was unable to clone the merged bug :/, I'll just
> reassign to dpkg, and mark is affecting pkg-kde-tools instead.
> 
> I'm not sure if you want to workaround this, if you do we could split
> the bugs and reassign one back.

Truth is we lack someone with perl knowledge in the team, we are overwelmed 
with stuff and most of us are using the stable backport of pkg-kde-tools to 
workaround this, so I guess we will wait :-)

Thanks a lot!

-- 
9: Que es el "Explorador" de Windows
* El tipo que le roba las ideas a MacOs
Damian Nadales
http://mx.grulic.org.ar/lurker/message/20080307.141449.a70fb2fc.es.html

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/


signature.asc
Description: This is a digitally signed message part.


Bug#839905: Bug#840293: pkg-kde-tools: pkgkde-symbolshelper broken by perl 5.24

2016-10-16 Thread Guillem Jover
Control: reassign -1 libdpkg-perl
Control: retitle -1 libdpkg-perl: Dpkg::IPC::spawn immediately closes FH after 
dup
Control: affects -1 pkg-kde-tools

On Fri, 2016-10-14 at 01:05:03 +0200, Guillem Jover wrote:
> Control: clone -1 -2
> Control: reassign -2 libdpkg-perl
> Control: retitle -2 libdpkg-perl: Dpkg::IPC::spawn immediately closes FH 
> after dup

Ok, it seems the BTS was unable to clone the merged bug :/, I'll just
reassign to dpkg, and mark is affecting pkg-kde-tools instead.

I'm not sure if you want to workaround this, if you do we could split
the bugs and reassign one back.

Thanks,
Guillem



Bug#839905: Bug#840293: pkg-kde-tools: pkgkde-symbolshelper broken by perl 5.24

2016-10-13 Thread Guillem Jover
Control: clone -1 -2
Control: reassign -2 libdpkg-perl
Control: retitle -2 libdpkg-perl: Dpkg::IPC::spawn immediately closes FH after 
dup

Hi!

[ Was pointed to this bug by Stuart Prescott. ]

On Thu, 2016-10-13 at 23:30:09 +0200, gregor herrmann wrote:
> On Thu, 13 Oct 2016 17:13:09 -0300, Lisandro Damián Nicanor Pérez Meyer wrote:
> > Steps to reproduce:
> > 
> > apt-get source -t experimental qtdeclarative-opensource-src
> > cd qtdeclarative-opensource-src-5.7.0/
> > getbuildlog qtdeclarative-opensource-src last
> > pkgkde-symbolshelper batchpatch -v 5.7.0 *.log
> 
> Thanks!
> That makes it indeed easier to reproduce :)

Indeed!

> So, my findings:
> - the error "reopen stdout: Bad file descriptor" happens in
>   /usr/share/perl5/Debian/PkgKde/SymbolsHelper/Patching.pm line 246:
>   wait_child($pid, nocheck => 1);
> - that's when the formerly assembled $pid gets executed
> - looking at $pid above, I notice that both to_handle and
>   error_to_handle are set to $outfile (a temp file created before)
> - just out of curiosity, I commented out the error_to_handle line
>   (241), and now `pkgkde-symbolshelper batchpatch -v 5.7.0 *.log'
>   passes
> - running `pkgkde-symbolshelper batchpatch -v 5.7.0 *.log' again
>   fails with failed hunk errors from patch, which also doesn't look
>   so bad
> 
> Not sure where this leaves us, especially since I neither know
> Dpkg::IPC nor understand the apply() sub in
> Debian::PkgKde::SymbolsHelper::Patching.

> (And I also don't know where exactly the problem / changed behaviour
> with perl 5.24 lies. Since the spawn/wait_pid functions are from
> Dpkg::IPC, I guess looking into Dpkg::IPC might be interesting.)

The problem is that spawn() is closing the passed filehandle just
after duping it to STDOUT and then STDERR instead of queueing it for
deferred closure. I'm also not sure why this didn't trigger before?
Perhaps perl was delaying the filehandle closure?

I'll include the attached patch fpr libdpkg-perl in the next dpkg
release, but in the interim you might want to workaround this in
pkg-kde-tools, by duping the $output filehandle before passing it
to spawn().

Thanks,
Guillem
diff --git i/scripts/Dpkg/IPC.pm w/scripts/Dpkg/IPC.pm
index 5172540..3dfbde9 100644
--- i/scripts/Dpkg/IPC.pm
+++ w/scripts/Dpkg/IPC.pm
@@ -282,7 +282,8 @@ sub spawn {
 	} elsif ($opts{from_handle}) {
 	open(STDIN, '<&', $opts{from_handle})
 		or syserr(g_('reopen stdin'));
-	close($opts{from_handle}); # has been duped, can be closed
+	# has been duped, can be closed
+	push @{$opts{close_in_child}}, $opts{from_handle};
 	}
 	# Redirect STDOUT if needed
 	if ($opts{to_file}) {
@@ -291,7 +292,8 @@ sub spawn {
 	} elsif ($opts{to_handle}) {
 	open(STDOUT, '>&', $opts{to_handle})
 		or syserr(g_('reopen stdout'));
-	close($opts{to_handle}); # has been duped, can be closed
+	# has been duped, can be closed
+	push @{$opts{close_in_child}}, $opts{to_handle};
 	}
 	# Redirect STDERR if needed
 	if ($opts{error_to_file}) {
@@ -300,7 +302,8 @@ sub spawn {
 	} elsif ($opts{error_to_handle}) {
 	open(STDERR, '>&', $opts{error_to_handle})
 	or syserr(g_('reopen stdout'));
-	close($opts{error_to_handle}); # has been duped, can be closed
+	# has been duped, can be closed
+	push @{$opts{close_in_child}}, $opts{error_to_handle};
 	}
 	# Close some inherited filehandles
 	close($_) foreach (@{$opts{close_in_child}});


Bug#839905: Bug#840293: pkg-kde-tools: pkgkde-symbolshelper broken by perl 5.24

2016-10-13 Thread gregor herrmann
On Thu, 13 Oct 2016 17:13:09 -0300, Lisandro Damián Nicanor Pérez Meyer wrote:

> Steps to reproduce:
> 
> apt-get source -t experimental qtdeclarative-opensource-src
> cd qtdeclarative-opensource-src-5.7.0/
> getbuildlog qtdeclarative-opensource-src last
> pkgkde-symbolshelper batchpatch -v 5.7.0 *.log

Thanks!
That makes it indeed easier to reproduce :)

So, my findings:
- the error "reopen stdout: Bad file descriptor" happens in
  /usr/share/perl5/Debian/PkgKde/SymbolsHelper/Patching.pm line 246:
  wait_child($pid, nocheck => 1);
- that's when the formerly assembled $pid gets executed
- looking at $pid above, I notice that both to_handle and
  error_to_handle are set to $outfile (a temp file created before)
- just out of curiosity, I commented out the error_to_handle line
  (241), and now `pkgkde-symbolshelper batchpatch -v 5.7.0 *.log'
  passes
- running `pkgkde-symbolshelper batchpatch -v 5.7.0 *.log' again
  fails with failed hunk errors from patch, which also doesn't look
  so bad

Not sure where this leaves us, especially since I neither know
Dpkg::IPC nor understand the apply() sub in
Debian::PkgKde::SymbolsHelper::Patching.

Maybe guillem and/or modax as the respective authors can help here.  

(And I also don't know where exactly the problem / changed behaviour
with perl 5.24 lies. Since the spawn/wait_pid functions are from
Dpkg::IPC, I guess looking into Dpkg::IPC might be interesting.)


Cheers,
gregor

-- 
 .''`.  Homepage https://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer -  https://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Bob Dylan: Tweedle Dee & Tweedle Dum


signature.asc
Description: Digital Signature


Bug#839905: Bug#840293: pkg-kde-tools: pkgkde-symbolshelper broken by perl 5.24

2016-10-13 Thread Lisandro Damián Nicanor Pérez Meyer
Steps to reproduce:

apt-get source -t experimental qtdeclarative-opensource-src
cd qtdeclarative-opensource-src-5.7.0/
getbuildlog qtdeclarative-opensource-src last
pkgkde-symbolshelper batchpatch -v 5.7.0 *.log

I'm using experimental's qtdeclarative because I know there are symbols that 
need fixing in there.

-- 
 SlackDeb: velo como un entrenamiento shaolin para geeks,
en vez de meditación y tortura física, abstinencia de internet y sexo
  Horacio Francisco Sebastián "Perrito" Durán Barrionuevo, sobre un
  viaje que Federico "SlackDeb" Peretti estaba planeando con su novia.

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/


signature.asc
Description: This is a digitally signed message part.


Bug#839905: Bug#840293: pkg-kde-tools: pkgkde-symbolshelper broken by perl 5.24

2016-10-13 Thread Lisandro Damián Nicanor Pérez Meyer
forcemerge 839905 840293
tag 839905 help confirmed
thanks

I'm afraid we don't have perl developers in the team anymore, so tagging this 
bug with "help".

I'm BBCing two friends which might give us a hand here, but using blind copy 
to now force them =)

Thanks!

-- 
http://xkcd.com/162/

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/


signature.asc
Description: This is a digitally signed message part.