in reply to Re: cpan install Unicode::Map8 failed
in thread cpan install Unicode::Map8 failed

Update here. I am a new comer to Perl, and it takes one day to investigate this issue. I have not fixed it, while I find some useful info.

[root@sparts Unicode-Map8-0.13-kCcefS]# pwd /root/.cpan/build/Unicode-Map8-0.13-kCcefS [root@sparts Unicode-Map8-0.13-kCcefS]# make clean [root@sparts Unicode-Map8-0.13-kCcefS]# make ... map8x.c: In function ‘map8_recode8’: map8x.c:321: warning: pointer targets in passing argument 1 of ‘strlen +’ differ in signedness map8x.c:314: warning: unused variable ‘uc’ ... [root@sparts Unicode-Map8-0.13-kCcefS]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/callback.t .. ok t/map8.t ........ No subtests run t/compat.t .... ok t/unistr.t .... ok

I use "make testdb TEST_FILE=t/map8.t", when excuting the below line:

print "not " unless $no->recode8($l1, "xyz{|}") eq "xyzæøå";

I see " DB<2> x $! 0 'Bad file descriptor'", so I guess it seems caused by recode8(). I commented all recode() and modify the test count in map8.t, and then run "make test" again, it is "PASSED". In order to look more deeply, I created the simply test file including recode8:(named cm.t)

print "1..1\n"; use strict; use Unicode::Map8 qw(NOCHAR); print "MAPS_DIR = $Unicode::Map8::MAPS_DIR\n"; my $l1 = Unicode::Map8->new("latin1") || die; my $no = Unicode::Map8->new("no") || die; #print "not " unless $no->recode8($l1, "xyz{|}") eq "xyzæøå"; my $t1 = $no->recode8($l1, "xyz{|}"); print "ok 1\n";

make test again

[root@sparts Unicode-Map8-0.13-kCcefS]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/callback.t .. ok t/cm.t ........ Usage: Unicode::Map8::recode8(m1, m2, str) at t/cm.t l +ine 15. t/cm.t ........ Dubious, test returned 9 (wstat 2304, 0x900) Failed 1/1 subtests t/compat.t .... ok t/unistr.t .... ok Test Summary Report ------------------- t/cm.t (Wstat: 2304 Tests: 0 Failed: 0) Non-zero exit status: 9 Parse errors: Bad plan. You planned 1 tests but ran 0. Files=5, Tests=20, 0 wallclock secs ( 0.05 usr 0.04 sys + 0.14 cusr + 0.06 csys = 0.29 CPU) Result: FAIL Failed 1/5 test programs. 0/20 subtests failed. make: *** [test_dynamic] Error 255

I also see recode8() is defined in Map8.xs

recode8(m1, m2, str) Map8* m1 Map8* m2 PREINIT: STRLEN len; STRLEN rlen; char* res; INPUT: char* str = SvPV(ST(2), len); CODE: RETVAL = newSV(len + 1); SvPOK_on(RETVAL); res = SvPVX(RETVAL); map8_recode8(m1, m2, str, res, len, &rlen); res[rlen] = '\0'; SvCUR_set(RETVAL, rlen); OUTPUT: RETVAL

It needs 3 parameters:($m1,$m2,str), and I try to modify the cm.t as "my $t1 = $no->recode8($no, $l1, "xyz{|}");" and then "make test" also show the same error. Here, I do not know how to do it next, can you pls give any hint? Thanks, Phillip

Replies are listed 'Best First'.
Re^3: cpan install Unicode::Map8 failed
by PhillipHuang (Beadle) on Jul 18, 2011 at 08:31 UTC

    Can anyone help me?

      You will need to show us the output of the failing test file. That means not running make test but running the test in isolation, by using

      make perl -Mblib -w t/map8.t

      That will show you the message why the test fails. As to the potential deeper reason of why the assumptions of the author about the code fail, I don't know.

        Thanks, Corion. Here's the output:

        [root@sparts Unicode-Map8-0.13-gF4099]# perl -Mblib -w t/map8.t 1..18 MAPS_DIR = /root/.cpan/build/Unicode-Map8-0.13-gF4099/blib/lib/Unicode +/Map8/maps ok 1 Segmentation fault

        I will also try to write to the author and ask for his/her help.

      map8_recode8(m1, m2, str, res, len, &rlen);

      This function is probably undefined.