New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bleadperl v5.15.2-436-gbd31be4 breaks STBEY/Bit-Vector-7.1.tar.gz #11658
Comments
From @andkgit bisect commit bd31be4 Probe for <stdbool.h>, and if found use it in handy.h This means that the core uses the compiler's bool type if one exists. diagnostics cc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"7.1\" -DXS_VERSION=\"7.1\" -fPIC "-I/home/src/perl/repoperls/installed-perls/perl/v5.15.2-436-gbd31be4/2a56/lib/5.15.2/x86_64-linux-thread-multi-ld/CORE" Vector.c perl -V Summary of my perl5 (revision 5 version 15 subversion 2) configuration: Characteristics of this binary (from libperl): -- |
From @andkBuilding Math-Prime-XS -- |
From @nwc10On Sun, Sep 18, 2011 at 04:43:41AM -0700, Andreas J. Koenig via RT wrote:
Yes. As I understand it, from looking at the code: BitVector.c provides the C implementation of bit vectors. BitVector.c always includes exactly 5 headers, <stdlib.h>, <limits.h>, Vector.xs includes "EXTERN.h", "perl.h", "XSUB.h", "patchlevel.h" BitVector.h includes "ToolBox.h" [Curiously, BitVector.c does not include BitVector.h] "ToolBox.h" has this: #ifdef PERL_DARWIN and this: #ifdef __cplusplus PERl_DARWIN will be defined on Darwin, because it's in the CCFLAGS in What goes wrong with the above is when perl.h (indirectly) includes stdbool.h, typedef enum { false = FALSE, true = TRUE } boolean; become syntactically invalid. In turn, the "obvious" fix of changing the "PERL_DARWIN" to It compiles. Regression tests fail. For no obvious reason. It turns out that what is going wrong is, well, quite wonderful: $ gdb --args `perl -lne 'print $1 if /^PERL = (.*)/' Makefile` -Mblib -MBit::Vector -lwe '($v0, $v1, $v2) = map {Bit::Vector->new(31)} 0..2; $v1->from_Hex("FFFFFFFE"); $v2->from_Hex("FFFFFFFE"); $v0->add($v1, $v2, 0); print $v0->to_Hex();' Breakpoint 1 (BitVector_compute) pending. Breakpoint 1, BitVector_compute (X=0x9b529c, Y=0x9c1b8c, Z=0x9c377c, In the two different files, the type boolean ends up having a different size. Took a bit of time to figure that one out. After a lot of goes at trying to find an elegant fix, this seems to be it: Inline Patch--- Vector.xs~ 2009-09-29 22:54:00.000000000 +0100
+++ Vector.xs 2011-09-22 16:20:21.000000000 +0100
@@ -10,6 +10,7 @@
/* */
/*****************************************************************************/
+#include "BitVector.h"
#include "EXTERN.h"
#include "perl.h"
@@ -30,10 +31,6 @@
#endif
#endif
-
-#include "BitVector.h"
-
-
typedef SV *BitVector_Object;
typedef SV *BitVector_Handle;
typedef N_word *BitVector_Address;
(No compiler warnings or errors - everything else I tried seemed to have This does feel fragile to me. Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Tue, Sep 20, 2011 at 08:10:00AM +0200, Andreas J. Koenig wrote:
It reached some archives, eg http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00810.html
Reply to STBEY sent as a reply to the original message. Fix for Math-Prime-XS seems much simpler: Inline Patch--- lib/Math/Prime/XS.xs~ 2011-09-22 11:36:46.000000000 +0100
+++ lib/Math/Prime/XS.xs 2011-09-22 11:40:09.000000000 +0100
@@ -21,7 +21,9 @@
#define NUM_LEN(nums) (sizeof (nums) / sizeof (num_entry))
+#ifndef I_STDBOOL
enum { false, true };
+#endif
typedef struct {
unsigned long **ptr;
Nicholas Clark |
From zefram@fysh.orgNicholas Clark wrote:
Better fix: in the header change typedef enum { false = FALSE, true = TRUE } boolean; to typedef int boolean; This means that the type of "boolean" is consistent per system, and the -zefram |
From zefram@fysh.orgNicholas Clark wrote:
That formulation could also be used in the critical part of the fix that -zefram |
From @andk
> Were these the only two distributions to have problems with perl.h I can't tell what my current coverage is. Usually cpantesters and -- |
From schubiger@cpan.orgNicholas Clark <nick@ccl4.org> wrote:
Thanks to both for reporting and the diagnosis. Fixed in v0.23_01. |
From @andk
> It reached some archives, eg > http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00810.html Ahh, interesting, I just retried searching for it by number: http://www.xray.mpe.mpg.de/cgi-bin/w3glimpse/perl5-porters?query=99408&errors=0&case=on&maxfiles=100&maxlines=30 Gives 0 matches. Many other queries that should find it fail as well. -- |
From @rjbsI cannot reproduce failures for this on my Darwin box. Is this issue still blocking? Steps to reproduce, please, if so. |
From @jkeenanOn Tue Feb 28 17:26:39 2012, rjbs wrote:
Along the same lines, if: (a) I have installed Bit-Vector version 7.1 on my machine; (b) I have retained the Bit-Vector test suite under (c) I have a fairly up-to-date, tested version of blead perl under How would I run the test suite with blead? In particular, what would I ##### (I suspect that, more generally, this comes down to: How do I test Thank you very much. |
From @rjbs* James E Keenan via RT <perlbug-followup@perl.org> [2012-02-28T21:10:03]
Rather than answer just what you asked, here's what I do. I use perlbrew to keep the latest 5.15.x installed, as well as blead, when So, say I want to test Bit::Vector. I run: perlbrew lib create 5.15.8@bit-vector ...to create a "bit-vector" local::lib attached to my "5.15.8" perlbrew. Then: cpanm --look Bit::Vector ...which drops me in a shell with the latest Bit::Vector unpacked. Then: perl Makefile.PL && make test And that's about it. -- |
From @andk
> I cannot reproduce failures for this on my Darwin box. I just take four recent bleadperls: - With all four I run 'install Bit::Vector' on my cpan shell and get: make[1]: Entering directory `/tmp/tmp.hg0fEzbF6R/Bit-Vector-7.1-HPmcsK' CPAN::Reporter: this appears to be a duplicate report for the make phase: Test report will not be sent. STBEY/Bit-Vector-7.1.tar.gz Patch is in ticket https://rt.cpan.org/Ticket/Display.html?id=71052 Also in this ticket Steffen Beyer has authorized me to make a new -- |
From @rjbs* "Andreas J. Koenig" <andreas.koenig.7os6VVqR@franz.ak.mind.de> [2012-02-29T02:02:49]
Huh! Thanks for testing that.
...and thanks even more for that! Once it's out and the fix confirmed against -- |
From @cpansproutOn Wed Feb 29 06:30:01 2012, perl.p5p@rjbs.manxome.org wrote:
Steffen Beyer mentioned in that ticket that he doesn’t have time to make -- Father Chrysostomos |
From @rjbs* Father Chrysostomos via RT <perlbug-followup@perl.org> [2012-02-29T12:16:49]
Andreas K., above, said he would be making it. -- |
From @rjbsI spoke with David W. via email and he says he will cut a new release very soon. |
From @rjbsOn Wed Feb 29 18:43:08 2012, rjbs wrote:
Whoops, that comment belongs on [rt.perl.org #109806] |
From @andk
> * Father Chrysostomos via RT <perlbug-followup@perl.org> [2012-02-29T12:16:49]
> Andreas K., above, said he would be making it. The uploaded file Bit-Vector-7.2.tar.gz has entered CPAN as file: $CPAN/authors/id/A/AN/ANDK/Bit-Vector-7.2.tar.gz Ticket can be closed -- |
From @rjbsThanks, Andreas! Closed |
From [Unknown Contact. See original ticket]Thanks, Andreas! Closed |
@rjbs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#99408 (status was 'resolved')
Searchable as RT99408$
The text was updated successfully, but these errors were encountered: