Skip Menu |
 

This queue is for tickets about the Glib CPAN distribution.

Report information
The Basics
Id: 82349
Status: resolved
Priority: 0/
Queue: Glib

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.262
  • 1.280
  • 1.290
  • 1.291
  • 1.300
  • 1.301
  • 1.302
Fixed in: (no value)

Attachments
0001-Fix-hang-of-t-9.t-on-FreeBSD-perl-s-not-built-with-p.patch



Subject: t/9.t hangs on FreeBSD 9 with non-threaded perl
Download (untitled) / with headers
text/plain 418b
The test suite works fine with threaded perls on the same system. Also there does not seem to be problems with older version of FreeBSD (8.0). A pass/fail overview may be seen here: http://matrix.cpantesters.org/?dist=Glib%201.280;os=freebsd;reports=1 The issue was also mentioned in the gtk-perl mailing list, see here: https://mail.gnome.org/archives/gtk-perl-list/2011-November/msg00038.html Regards, Slaven
Subject: Re: [rt.cpan.org #82349] t/9.t hangs on FreeBSD 9 with non-threaded perl
Date: Mon, 31 Dec 2012 15:12:07 +0100
To: Slaven_Rezic via RT <bug-Glib [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
Download (untitled) / with headers
text/plain 1.4k
On Mon, Dec 31, 2012 at 08:55:35AM -0500, Slaven_Rezic via RT <bug-Glib@rt.cpan.org> wrote: Show quoted text
> The test suite works fine with threaded perls on the same system. Also
Just a thought then: does FreeBSD support using threads (or threaded libraries) when the main program hasn't been linked with e.g. -pthread? You can test this by linking perl itself with -pthread (without linking against -lpthread or enabling the windows process emulation code (ithreads)). If it then works, it's a limitation in freebsd threading (or rather, lack of the extension found in GNU/Linux and many other systems which don't need this), and since gtk/glib might use threads internally at any time, there is little in the way of avoiding it, short of recompiling glib and gtk without thread support as well. The best solution would be to compile the non-ithreaded perl as a threaded application as the problem will otherwise come up with any extension that wants to use pthreads. Show quoted text
> there does not seem to be problems with older version of FreeBSD (8.0).
I know that older versions (freebsd 8) do not support this, but happen to work some of the time (and corrupting memory at some other times), so that might just be luck. -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schmorp@schmorp.de -=====/_/_//_/\_,_/ /_/\_\
Download (untitled) / with headers
text/plain 1.1k
On 2012-12-31 09:12:19, schmorp@schmorp.de wrote: Show quoted text
> On Mon, Dec 31, 2012 at 08:55:35AM -0500, Slaven_Rezic via RT <bug- > Glib@rt.cpan.org> wrote:
> > The test suite works fine with threaded perls on the same system.
> Also > > Just a thought then: does FreeBSD support using threads (or threaded > libraries) when the main program hasn't been linked with e.g. > -pthread? > > You can test this by linking perl itself with -pthread (without > linking > against -lpthread or enabling the windows process emulation code > (ithreads)).
Starting with FreeBSD 9.1, perl is compiled with -pthread by default. The output of perl -V:ldflags in FreeBSD 9.0 was: ldflags=' -Wl,-E -fstack-protector -L/usr/local/lib'; In 9.1 it's: ldflags='-pthread -Wl,-E -fstack-protector -L/usr/local/lib'; And in fact, Glib's t/9.t runs fine with the perl in FreeBSD 9.1. Not sure what to do with this knowledge. -pthread may be turned off in FreeBSD's perl port (it's a configurable option), and the default freebsd hint file in the perl source distribution also does not use -pthread for non-threaded builds. Regards, Slaven
Download (untitled) / with headers
text/plain 150b
Can you try "freebsd-child-watch-fix" branch then? https://git.gnome.org/browse/perl-Glib/log/?h=freebsd-child-watch-fix The patch is also attached.
Subject: 0001-Fix-hang-of-t-9.t-on-FreeBSD-perl-s-not-built-with-p.patch
From 9e3d2adb9541f98063b9d10c93232282910e9af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20Sch=C3=B6nfeld?= <kaffeetisch@gmx.de> Date: Sat, 1 Nov 2014 17:34:58 +0100 Subject: [PATCH] Fix hang of t/9.t on FreeBSD perl's not built with "-pthread" Glib's child watches will not work when perl was not linked against libpthread/libthr. https://rt.cpan.org/Ticket/Display.html?id=82349 --- t/9.t | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/t/9.t b/t/9.t index d067434..21c3f60 100644 --- a/t/9.t +++ b/t/9.t @@ -210,16 +210,18 @@ if (Glib->CHECK_VERSION (2, 14, 0)) { { + my $skip_reason = undef; if (! $have_fork) { - print "ok 26 # skip, no fork: $fork_excuse\n"; - print "ok 27 # skip\n"; - print "ok 28 # skip\n"; - print "ok 29 # skip\n"; - print "ok 30 # skip\n"; - goto SKIP_CHILD_TESTS; + $skip_reason = "no fork: $fork_excuse"; } if (! Glib->CHECK_VERSION (2, 4, 0)) { - print "ok 26 # skip: need glib >= 2.4\n"; + $skip_reason = 'need glib >= 2.4'; + } + if ($^O eq 'freebsd' && $Config{ldflags} !~ m/-pthread\b/) { + $skip_reason = 'need a perl built with "-pthread" on freebsd'; + } + if (defined $skip_reason) { + print "ok 26 # skip: $skip_reason\n"; print "ok 27 # skip\n"; print "ok 28 # skip\n"; print "ok 29 # skip\n"; -- 1.9.1
Download (untitled) / with headers
text/plain 115b
OK, I'm now rather confident that this is the correct fix, so I pushed a variant of it that also applies to NetBSD.
Download (untitled) / with headers
text/plain 258b
On 2014-11-01 13:18:41, TSCH wrote: Show quoted text
> Can you try "freebsd-child-watch-fix" branch then? > > https://git.gnome.org/browse/perl-Glib/log/?h=freebsd-child-watch-fix >
Looks good (tried on a FreeBSD 9.2 system with perl 5.18.2 without threads or pthreads).


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.