Skip Menu |

This queue is for tickets about the libintl-perl CPAN distribution.

Report information
The Basics
Id: 54112
Status: resolved
Priority: 0/
Queue: libintl-perl

People
Owner: Nobody in particular
Requestors: gert.kello [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: csjewell [...] cpan.org
Subject: libintl-perl 1.20 unhandled win32 exception with strawberry Perl
Date: Fri, 29 Jan 2010 10:41:05 +0200
To: bug-libintl-perl [...] rt.cpan.org
From: Gert Kello <gert.kello [...] gmail.com>
Hi. I'm trying to install the LibIntl-Perl module from CPAN (G/GU/GUIDO/libintl-perl-1.20.tar.gz) using strawberry perl, but it raises an unhandled win32 exception in perl.exe when doing ./tests/03bindtextdomain_xs.t. Screenshot attached (yet it is very uninformative) Also attached CPAN output in two log files, before & after the exception occurred. Well, I assume the after part is not that interesting anymore. I also asked about it in #win32<http://widget.mibbit.com/?settings=1c154d53c72ad8cfdfab3caa051b30a2&server=irc.perl.org&channel=%23win32&noServerTab=false&noServerNotices=true&noServerMotd=true&autoConnect=true>channel at irc.perl.org, and they suggested sending that e-mail. Perl version is info is in attached perlV.txt file Let me know if You need any additional information about the system I'm running. Gert

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Download BeforeException.log
application/octet-stream 21.8k

Message body not shown because it is not plain text.

Download AfterException.log
application/octet-stream 27.1k

Message body not shown because it is not plain text.

Hi, the XS version of libintl-perl is an extremely simple wrapper around the gettext library installed on the system. It just passes function arguments from Perl to C, and the return value back from C to Perl. If this was a problem, your Perl wouldn't work at all. It is next to impossible that this is a bug in libintl-perl, and very unlikely that it is a bug in your Perl interpreter. I'm almost sure that the culprit is gettext library on your system. You can test that by re-writing the test in C. This is relatively straightforward. If you have the same exception, you know that it is not a Perl related problem. You may also want to have a look at Locale::Messages::select_package(). You can deactivate the XS version altogether, and only use the pure Perl version. You will not see a big performance penalty. Cheers, Guido
CC: csjewell [...] cpan.org
Subject: Re: [rt.cpan.org #54112] libintl-perl 1.20 unhandled win32 exception with strawberry Perl
Date: Fri, 29 Jan 2010 13:28:03 +0200
To: bug-libintl-perl [...] rt.cpan.org
From: Gert Kello <gert.kello [...] gmail.com>
Hi. Actually I would assume that the libintl-perl & strawberry perl maintainers would sort it out (disable the the XS version for strawberry or provide "working" copy of gettext library) BTW, do You check during install that the gettext library is present in system? As far as I can tell, it is not in my PATH... Gert
Am Fr 29. Jan 2010, 08:15:12, gert.kello@gmail.com schrieb: Show quoted text
> Hi. > > Actually I would assume that the libintl-perl & strawberry perl
maintainers Show quoted text
> would sort it out (disable the the XS version for strawberry or provide > "working" copy of gettext library) > > BTW, do You check during install that the gettext library is present in > system? As far as I can tell, it is not in my PATH...
When you build libintl-perl, the first line of output reads "Checking whether we can compile the XS version ...". Does that answer your question? About the rest: I have never heard of strawberry perl before, I don't have a working MS-DOS aka Windows installation, leave alone Visual C or whatever. How should I be able to sort that out for you? The binding (libintl-perl), the script interpreter (strawberry perl) or the library (gettext) cause the crash, and it is highly unlikely that the binding is the culprit in this case. Please ask the maintainers of strawberry perl whether they can reproduce the problem on their machines. They have at least the same operating system. I will send you a bottle of good Bulgarian wine if you can prove me that a bug in libintl-perl causes this crash. Cheers, Guido Show quoted text
> > Gert
Subject: Re: [rt.cpan.org #54112] libintl-perl 1.20 unhandled win32 exception with strawberry Perl
Date: Sat, 30 Jan 2010 18:24:49 +0200
To: bug-libintl-perl [...] rt.cpan.org
From: Gert Kello <gert.kello [...] gmail.com>
Show quoted text
>
> > > > BTW, do You check during install that the gettext library is present in > > system? As far as I can tell, it is not in my PATH...
> > When you build libintl-perl, the first line of output reads "Checking > whether we can compile the XS version ...". Does that answer your question? > >
Well, I also did read the README.win32, it did talk about ActiveState perl & skipping the xs version. For some reason I thought You are checking the Perl interpreter... The binding (libintl-perl), the script interpreter (strawberry perl) or Show quoted text
> the library (gettext) cause the crash, and it is highly unlikely that > the binding is the culprit in this case. Please ask the maintainers of > strawberry perl whether they can reproduce the problem on their > machines. They have at least the same operating system. >
My first call was them. And they suggested to report here. I narrowed down this problem a bit: gettext_xs.pm file, line 136 sub bindtextdomain ($;$) { my ($domain, $directory) = @_; if (defined $domain && length $domain && defined $directory && length $directory (I added some line breaks to set comments) seems like the "defined $directory" causes that error when called like my $bound_domain = bindtextdomain 'existing'; 03bindtextdomain_xs.t, line 30 if I comment out the "&& defined $directory && length $directory" part, then error does not happen anymore (it happens if just the "&& length $directory" is commented out) It also does not happen if called is modified to be my $bound_domain = bindtextdomain 'existing', '1'; Really sounds like something has messed up the memory structures.. Unfortunately I'm really green in the whole perl area (newbie in perl itself, c/c++ and also in gnu toolchain). so it really takes me time to find out the error reasons... Regards, Gert
CC: csjewell [...] cpan.org
Subject: Re: [rt.cpan.org #54112] libintl-perl 1.20 unhandled win32 exception with strawberry Perl
Date: Mon, 1 Feb 2010 11:53:51 +0200
To: bug-libintl-perl [...] rt.cpan.org
From: Gert Kello <gert.kello [...] gmail.com>
Show quoted text
> > > The binding (libintl-perl), the script interpreter (strawberry perl) or
>> the library (gettext) cause the crash, and it is highly unlikely that >> the binding is the culprit in this case. Please ask the maintainers of >> strawberry perl whether they can reproduce the problem on their >> machines. They have at least the same operating system. >>
> > > if I comment out the "&& defined $directory && length $directory" part, > then error does not happen anymore (it happens if just the "&& length > $directory" is commented out) It also does not happen if called is modified > to be > my $bound_domain = bindtextdomain 'existing', '1'; >
I feel SO stupid at moment... Well, digging a bit into source & getting my perl debugger to work again: The following calls to bindtextdomain fail: return &Locale::gettext_xs::_bindtextdomain; return &Locale::gettext_xs::_bindtextdomain('',''); return &Locale::gettext_xs::_bindtextdomain('existing'); The following ones work: return &Locale::gettext_xs::_bindtextdomain('existing', '.'); return &Locale::gettext_xs::_bindtextdomain('', '.'); return &Locale::gettext_xs::_bindtextdomain(undef(), '.'); Seems to be caused by the error made while porting gettext into win32. The original bindtextdomain function is char * BINDTEXTDOMAIN (const char *domainname, const char *dirname) { set_binding_values (domainname, &dirname, NULL); return (char *) dirname; } but seems like the gnuwin32 port ( http://gnuwin32.sourceforge.net/packages/gettext.htm) misses the safeguard for NULL dirname char * BINDTEXTDOMAIN (const char *domainname, const char *dirname) { if (!access (dirname, R_OK)) { set_binding_values (domainname, &dirname, NULL); return (char *) dirname; } else { char *locale_dirname, *installdir = strdup (dirname), *s; if ((s = strrchr (installdir, '/'))) *s = '\0'; if ((s = strrchr (installdir, '/'))) *s = '\0'; locale_dirname = relocatex (installdir, dirname); set_binding_values (domainname, (const char **) &locale_dirname, NULL); if (installdir) free (installdir); return (char *) locale_dirname; } } I will carry this case over to gnuwin32 Gert
RT-Send-CC: csjewell [...] cpan.org
Hi, can you try to git update libintl-perl? Alternatively, change gettext_xs/gettext_xs.xs lines 250-252 to read like this: /* Treat empty or undefined strings as NULL. */ if (!domain || domain[0] == '\000') XSRETURN_UNDEF; Does that fix your problem? Cheers, Guido
RT-Send-CC: csjewell [...] cpan.org
Am Mo 01. Feb 2010, 08:11:37, GUIDO wrote: Show quoted text
> /* Treat empty or undefined strings as NULL. */ > if (!domain || domain[0] == '\000') > XSRETURN_UNDEF; > > Does that fix your problem?
If yes, the case is pretty clear. Your (C) version of bindtextdomain() segfaults if it receives a NULL pointer for the first argument (the textdomain). The GNU and Solaris version obviously handles this case gracefully. I don't think that this has anything to do with you Perl interpreter. Cheers, Guido
Subject: Re: [rt.cpan.org #54112] libintl-perl 1.20 unhandled win32 exception with strawberry Perl
Date: Mon, 1 Feb 2010 22:38:06 +0200
To: bug-libintl-perl [...] rt.cpan.org
From: Gert Kello <gert.kello [...] gmail.com>
On 1 February 2010 15:19, GUIDO via RT <bug-libintl-perl@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=54112 > > > Am Mo 01. Feb 2010, 08:11:37, GUIDO wrote:
> > /* Treat empty or undefined strings as NULL. */ > > if (!domain || domain[0] == '\000') > > XSRETURN_UNDEF; > > > > Does that fix your problem?
> > If yes, the case is pretty clear. Your (C) version of bindtextdomain() > segfaults if it receives a NULL pointer for the first argument (the > textdomain). The GNU and Solaris version obviously handles this case > gracefully. > >
Hi. I tried to tell that the GnuWin32 port of gettext library has a problem that it segfaults if the "directory" parameter is NULL - GnuWin32 to blame here. It works fine if the "domain" parameter is NULL. Gert
CC: csjewell [...] cpan.org
Subject: Re: [rt.cpan.org #54112] libintl-perl 1.20 unhandled win32 exception with strawberry Perl
Date: Tue, 2 Feb 2010 09:56:08 +0200
To: bug-libintl-perl [...] rt.cpan.org
From: Gert Kello <gert.kello [...] gmail.com>
Reported in GnuWin32 project: https://sourceforge.net/support/tracker.php?aid=2944447 Gert Show quoted text
>
Not a bug.