STATUS 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. 5.8, 5.6 and earlier had a good core perl compiler, but we are much better.
  2. B::C is stable and used in production for -O0 and -O3. For bigger programs
  3. not all methods in certain packages are detected, you'd need to add them via
  4. -u<packagename>.
  5. B::CC is very unstable, work is in progress. Certain alioth benchmarks are 6x faster.
  6. Recursive function calls and certain dynamic ops are not yet supported.
  7. The Bytecode compiler is only stable for >=5.8, non-debugging, threaded. The
  8. CPAN Bytecode compiler is disabled for 5.6, we keep the old. The old core
  9. compiler fails for 50% of the testcases.
  10. Windows and other OS with strict linking will fail to install due to some
  11. not exported libperl symbols. Looks at the patches in ramblings.
  12. Windows: Bad luck. perl 5.16 has finally all needed symbols exported, but the
  13. 5.16 perl releases are considered too insecure to be recommended for production.
  14. Security: The latest released compiler version 1.42 is only supported up to 5.14.2.
  15. 5.16.x, 5.14.3 and 5.12.5 are too insecure to be recommended for production.
  16. C and CC: Same ok and less failures as with 5.6, 5.8 and 5.9.4.
  17. In 5.8.8 and 5.8.9 we have much less errors in the testsuite for the
  18. new CPAN compiler and the CORE compiler. See below.
  19. Most B::C and B::CC bugs fixed.
  20. 5.10 + 5.12 + 5.14 + 5.16 + 5.18 compatibility added.
  21. Open Problems for B::C:
  22. See google issues.
  23. 5.16 not yet supported in the stable 1.42 release, only git master.
  24. See below at the detailed 5.6, 5.8, 5.10, 5.12, 5.14, 5.16, 5.17.6 status
  25. TEST STATUS
  26. -----------
  27. Regularily tested on cygwin1.7, darwin 10.8/intel, centos4, centos5, centos6,
  28. debian5, debian6, freebsd7, freebsd8, solaris10/intel sunpro, openbsd49, netbsd.
  29. With the respective default gcc and clang compilers, with the latest address-sanitizer
  30. versions.
  31. Not so regurarily on darwin 10.4/ppc, strawberry-5.10.1, strawberry-5.12.2,
  32. strawberry-5.14, strawberry-5.16 and activeperl-5.10.1/msvc8
  33. List of failed tests.
  34. CORE (old)
  35. ----
  36. 5.6.2:
  37. t/bytecode 3,6,8..10,12,15,16,18,28,31,35,38,39
  38. t/c 8,15,16,22,27,28,31 | 27 worked in 5.6.2!
  39. t/c_o1 8,15,16,22,27,28,31
  40. t/c_o2 8,15,16,22,27,28,31
  41. t/cc 15,18,21,25,27,28,30..32
  42. t/cc_o1 15,18,21,25,27,28,30..32
  43. t/cc_o2 10,15,16,18,21,25,26,27,28,30..32
  44. 5.8: | non-threaded
  45. t/bytecode 27,44,33,39
  46. t/c 11,14,15,20,23,27..29,31,101,102 | 5,7-12,14-20,22-23,25,27,28,30,31
  47. t/c_o1 1,3-8,10..12,14,15,17..25,27..29,31,101,102| 7-12,14-20,22-23,25,27,28,30,31
  48. t/c_o2 1,3-12,14,15,17..25,27..29,31,101,102 | 7-12,14-20,22-23,25,27,28,30,31
  49. t/cc 7,11,14,15,18..21,23..25,28..32,101..103
  50. t/cc_o1 7,11,14,15,18..21,23..32,101..103
  51. t/cc_o2 7,10,11,14..16,18-21,23..32,101..103
  52. Recipe:
  53. p=perl5.6.2
  54. t/testc.sh -q -c
  55. for t in $(seq -f"%02.0f" 32); do rm ccode 2>/dev/null; $p -MO=C,-occode.c ccode$t.pl 2>/dev/null && $p script/cc_harness ccode.c -o ccode >/dev/null; echo -n "$t: "; $p ccode$t.pl; echo -n " => "; ./ccode; echo; done
  56. p=perl5.8.9
  57. for t in $(seq -f"%02.0f" 35); do rm ccode 2>/dev/null; $p -MO=C,-occode.c ccode$t.pl 2>/dev/null && $p script/cc_harness -Bstatic ccode.c -o ccode >/dev/null; echo -n "$t: "; $p ccode$t.pl; echo -n " => "; ./ccode; echo; done
  58. p=perl5.8.9d-nt
  59. for t in $(seq -f"%02.0f" 35); do rm ccode 2>/dev/null; $p -MO=C,-occode.c ccode$t.pl 2>/dev/null && $p script/cc_harness -Bdynamic ccode.c -o ccode >/dev/null; echo -n "$t: "; $p ccode$t.pl; echo -n " => "; ./ccode; echo; done
  60. B::C (new)
  61. ----
  62. t/testc.sh -q -c; t/testcc.sh -q -c or make test TEST_VERBOSE=1
  63. 5.6.2:
  64. t/bytecode broken/not used
  65. t/c 15,41-43,50
  66. t/c_o1,2 +44,45
  67. t/cc 15,21,30,35,41-46,50,103-105
  68. 5.8.[45]:
  69. t/bytecode -
  70. t/c -
  71. t/cc 3,7,15,21,27,29,30,44-46,50,103,105
  72. 5.8.9:
  73. t/bytecode -
  74. t/c -
  75. t/cc 21,30,46,50,103,105
  76. 5.10.1:
  77. t/bytecode 27,42,43
  78. t/c -
  79. t/cc 14,21,30,46,50,103,105
  80. 5.12.4:
  81. t/bytecode 32,46
  82. t/c 21
  83. t/cc 14,21,30,46,50,103,105
  84. 5.14.2:
  85. t/bytecode 27,46
  86. t/c -
  87. t/cc 14,21,30,46,50,103,105
  88. 5.16.1:
  89. t/bytecode 27,46
  90. t/c -
  91. t/cc 14,21,30,46,50,103,105
  92. CPAN Modules
  93. ------------
  94. See t/modules.t:is_todo() We only try to compile use module, not the testsuite.
  95. We only try B::C so far.
  96. The full module testsuite is run with t/testm.sh -t [OPTS] Module
  97. Compile-time status from top100:
  98. generally: pass 100%
  99. 5.6.2 pass 100%
  100. 5.8.9 pass 100%
  101. 5.10.1 pass 100%
  102. 5.12.4 pass 100%
  103. 5.14.2 pass 100%
  104. 5.16.1 fail 4% (unshare_hek) Moose MooseX::Types DateTime DateTime::TimeZone
  105. 5.17.6 ??
  106. Run-time tests not yet fully done
  107. 5.19.x status
  108. -----------
  109. PADLIST support not yet stable.
  110. 5.18 status
  111. -----------
  112. PADLIST support not yet stable.
  113. op_static fixed since 5.17.6, 5.17.2-5.17.5 are unusable without -fno-destruct
  114. 5.16 status
  115. -----------
  116. new XSLoader:load_file
  117. hang at hfree_next_entry issue78 (runtime load of Carp), esp. problematic non-debugging
  118. unshare_hek issues in dynamic scope
  119. 5.10, 5.12, 5.14 status
  120. -----------------------
  121. TODO for B::C
  122. tests 21,41-43: B destruction,46,50
  123. Encode qr-copy issue 71
  124. restricted hashes in 5.10.0
  125. r-magic (e.g. Template::Stash 5.10.0 only)
  126. check t/testcore and testm.sh -t
  127. see google issues (71,59)
  128. Fix CC
  129. several other issues detected (and mostly fixed) by Heinz Knutzen
  130. minimize pad copies from local to pad
  131. label not defined (utf8::SWASHNEW)
  132. DONE
  133. ----
  134. fixed with 1.37:
  135. fixed wrong test 46, test for Exporter STASH in *main:: STASH
  136. copy-on-grow with LEN=0 and FAKE clash with share_hek
  137. share_hek re-implemented
  138. init of READONLY hash keys
  139. re-hash everything at startup (oCERT-2011-003)
  140. find UNIVERSAL methods, load SelectSaver with IO
  141. hv_clear_placeholders
  142. %+, %-, %!
  143. %SIG
  144. magic->PTR when SV (>5.6)
  145. attributes::reftype
  146. inc_cleanup (partially)
  147. CV prototypes (>5.10)
  148. ignore aelemfast SPECIAL pads (5.8.[45])
  149. strip version object overload from XS packages (i91)
  150. restore stdio handles from BEGIN blocks (Test::NoWarnings)
  151. B::COP::stashflags (>5.15.4)
  152. lost PL_regex_pad, (5.15 threaded)
  153. fixed with 1.36:
  154. 5.15 XSLoader and hash init
  155. support lexical warnings
  156. better __DATA__ detection and support,
  157. still IO::File not IO::Scalar handle though
  158. fixed test 29 mostly (use IO)
  159. fixed with 1.35:
  160. improve package_pv detection for methods,
  161. detect previously missing packages within the main source file
  162. run-time %ENV
  163. fixed with 1.32:
  164. improved scanner, try_isa, mark_package force, ...
  165. do not gp_free shared GPs
  166. Internals::V
  167. dl_init of cached deleted packages
  168. fixed with 1.30:
  169. cc_queue sort 18 ccpp
  170. dl_init regression
  171. xs_init (soname by context)
  172. 5.14 support
  173. package_pv detection for method_named
  174. AUTOLOAD goto xsub and SelfLoader esp. on 5.8 (27).
  175. use AutoLoader works okay. (test 27, 31)
  176. >5.11.3 test 32 catch evaltry die
  177. fixed test 29 >5.10 DEBUGGING for -O0 (use IO)
  178. fixed xpvio off-by-one error for 5.10 (test 29)
  179. mark a package which is autoloaded from XS
  180. fixed forbidden REGEXP IVX/NVX access since 5.12
  181. fixed evaltry (test 12), NVX was shared with 2 xpad_cop_seq ints
  182. which accidently just worked before 1.17, but not after using the %g
  183. representation changed with 1.16. Also fixed in Bytecode, fixing tests 9,10,12.
  184. fixed several minor bugs only in modules, no short testcases yet. See Changes
  185. fixed PP_ENTEREVAL (CC test 12) for 5.10 with 1.14.
  186. Nullify ending retop for the string to CALLRUNOPS.
  187. fixed __DATA__ IO (test 15) on 5.10 and 5.11 with 1.12.
  188. On 5.6 it is hard to fix (re-implement PerlIO::scalar).
  189. fixed RV => IV on blead (test 16 tiearray magic obj HVref) with 1.11
  190. fixed GV -> BM magic (index) without needing fbm_compile with 1.09. Just 5.8.9 not.
  191. fixed non-xsub AUTOLOAD (31) with 1.08
  192. ccode17_o1 namepad[1] to PL_sv_undef
  193. GVCV for 5.11 (27)
  194. runtime require $scalar (28)
  195. RVs for 5.11 (29)
  196. index (fbm_compile) for GVs fixed with 1.04_31
  197. test 14+23 destruction of GvPVX of the empty main:: stash fixed by adding a dummy.
  198. cccode19 sort failure via custom sortcv fixed with B::CC 1.02_03. endless loop
  199. autoload subs from main::, from packages it works ok (test 8)
  200. fixed with 1.04_25
  201. panic: illegal pad in pad_new: 0x18c4368[0x18cf6e8] with DEBUGGING only
  202. CvPADLIST: curpad<=>comppad
  203. fixed with 1.04_22
  204. pvx: seems to be fixed now in bc, and c
  205. With the move of the pvx field from xpv to the sv, we have to solve
  206. that differently for the Bytecode and C backend.
  207. Bytecode can simply mimic the old XPV behaviour of a 3 field struct
  208. (pvx, cur, len) to simplify pv handling.
  209. hv: crash at invalid entry in hv_store in B::HV::save fixed
  210. hek: new implementation, needs static optimization via heksect
  211. regexp: match works, split still broken
  212. bc 10: padv+sassign => Modification of a read-only value attempted at
  213. bytecode10.pl line 1. Only on cygwin, not on linux!
  214. The bytecode is exactly the same, it must be pp_entersub() with &$cv()
  215. Is FAKE flag of the padsv is missing or should we check for readonly pads?
  216. g <1> entersub[t4] vKS/TARG,1
  217. => Perl_sv_force_normal_flags()
  218. if (SvREADONLY(sv) && (!SvFAKE(sv)) && (IN_PERL_RUNTIME)) => die
  219. SV = NULL(0x0) at 0x12207c0
  220. REFCNT = 2147483129
  221. FLAGS = (READONLY)
  222. -Dt crash fixed by core patch pl-dump-const.patch
  223. cop_io status?
  224. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-05/msg00770.html
  225. 5.8 status
  226. ----------
  227. I've restored full 5.8 backwards compatibility, mainly for test comparison.
  228. But since the new B::C compiler is better than the CORE compiler, it is installed.
  229. Details
  230. --------
  231. Test::Harness:
  232. t/testm.sh -D- Test::Harness; gdb ./test_harness
  233. enter nextstate pushmark const(PV("ok"\0)) print leave
  234. cxstack is corrupt at leave
  235. 5.8.9d-nt test 27 AUTOLOAD:
  236. gdb --args ccode27
  237. start
  238. b Perl_gv_autoload4
  239. => The Fcntl stash misses AUTOLOAD
  240. -fcog: (13) unshare_hek tricky assertion fails
  241. he: "Find the shared he which is just before us in memory"
  242. ./ccode13_o1 Assertion he->shared_he_he.hent_hek == hek failed: file "hv.c", line 2327.
  243. Maybe call our own destruct handler on >=510, which resets all such pv's to NULL beforehand.
  244. cccode12_o2: 5.10.1d-nt
  245. Program received signal SIGSEGV, Segmentation fault.
  246. 0x521ab445 in Perl_pop_scope () at scope.c:103
  247. 103 const I32 oldsave = PL_scopestack[--PL_scopestack_ix];
  248. (gdb) p PL_scopestack_ix
  249. $1 = -272716323
  250. (gdb) bt
  251. #0 0x521ab445 in Perl_pop_scope () at scope.c:103
  252. #1 0x52121784 in Perl_pp_leave () at pp_hot.c:1904
  253. #2 0x00401ca5 in _fu23__PL_ppaddr () at cccode12_o2.c:246
  254. #3 0x520d95d1 in Perl_runops_debug () at dump.c:1968
  255. bytecode11 - 5.11d
  256. assertion "isGV_with_GP(shplep)" failed: file "B.c", line 4961
  257. #0 XS_B__GV_GP (my_perl=0x14222d0, cv=0x152a750) at B.c:15887
  258. #1 0x521ca568 in Perl_pp_entersub () from /usr/local/bin/cygperl5_11d.dll
  259. #2 0x52165d4c in Perl_runops_debug () from /usr/local/bin/cygperl5_11d.dll
  260. #3 0x521a9730 in Perl_call_sv () from /usr/local/bin/cygperl5_11d.dll
  261. #4 0x521b1640 in Perl_call_list () from /usr/local/bin/cygperl5_11d.dll
  262. #5 0x521a596f in perl_parse () from /usr/local/bin/cygperl5_11d.dll
  263. #6 0x00401136 in main (argc=4, argv=0x14221a0, env=0x1420090)
  264. (gdb) p *gv
  265. $2 = {sv_any = 0x14d1d48, sv_refcnt = 3, sv_flags = 32777 (0x8009), sv_u = {
  266. svu_iv = -5931823458977729848, svu_uv = 12514920614731821768,
  267. svu_rv = 0x14db2c8, svu_pv = 0x14db2c8 "ðúE\001", svu_array = 0x14db2c8,
  268. svu_hash = 0x14db2c8, svu_gp = 0x14db2c8}}
  269. cccode3.c - 5.11 dstr assert
  270. XPUSHs(GvSV(PL_curpad[1])); /* oops, this GV is empty */
  271. /* stack = */
  272. /* BINOP (0x15ec140) sassign [OPf_STACKED] */
  273. dst = POPs; src = TOPs; /* empty var dst at stack ! */
  274. MAYBE_TAINT_SASSIGN_SRC(src);
  275. SvSetSV(dst, src);
  276. ccode3 - 5.10 (fixed via workaround, dynamic init)
  277. -------------
  278. SEGV $_ = "xyxyx"; %j=(1,2); s/x/$j{print("z")}/g; print $_
  279. empty data. cause: no pv flag and refcnt in the sv
  280. #0 0x004a38c3 in Perl_fbm_instr (my_perl=0x18926d0, big=0x18d4bc8 "xyxyx",
  281. bigend=0x18d4bcd "", littlestr=0x0, flags=0) at util.c:577
  282. #1 0x006481d4 in Perl_re_intuit_start (my_perl=0x18926d0, prog=0x18d2088,
  283. sv=0x18d3fb8, strpos=0x18d4bc8 "xyxyx", strend=0x18d4bcd "", flags=0,
  284. data=0x0) at regexec.c:561
  285. #2 0x005a13f3 in Perl_pp_subst (my_perl=0x18926d0) at pp_hot.c:2105
  286. (gdb) p *rx
  287. $7 = {engine = 0x6a06a0, mother_re = 0x0, extflags = 1126170624, minlen = 0,
  288. minlenret = 0, gofs = 0, substrs = 0x18c0908, nparens = 0, intflags = 0,
  289. pprivate = 0x18d1588, lastparen = 0, lastcloseparen = 0, swap = 0x0,
  290. offs = 0x18cf748, subbeg = 0x0, sublen = 0, prelen = 0,
  291. precomp = 0x18ab870 ")", wrapped = 0x18ab868 "(?-xism:)", wraplen = 9,
  292. seen_evals = 0, paren_names = 0x0, refcnt = 1}
  293. ccode2 - 5.11 (fixed via workaround, dynamic init)
  294. -------------
  295. match with /\d/
  296. (gdb) p *pm
  297. $1 = {op_next = 0x66513c, op_sibling = 0x665198, op_ppaddr = 0x59a6e9 <Perl_pp_match>, op_targ = 0, op_type = 31,
  298. op_opt = 0, op_latefree = 1, op_latefreed = 0, op_attached = 0, op_spare = 0, op_flags = 2 '\002',
  299. op_private = 64 '@', op_first = 0x0, op_last = 0x0, op_pmoffset = 46, op_pmflags = 0, op_pmreplrootu = {
  300. op_pmreplroot = 0x0, op_pmtargetoff = 0}, op_pmstashstartu = {op_pmreplstart = 0x0, op_pmstashpv = 0x0}}
  301. (gdb) n
  302. 1216 register REGEXP *rx = PM_GETRE(pm);
  303. (gdb) p *rx
  304. $2 = {engine = 0x69f690, mother_re = 0x0, extflags = 52428800, minlen = 1, minlenret = 1, gofs = 0,
  305. substrs = 0x1920188, nparens = 0, intflags = 0, pprivate = 0x1915448, lastparen = 0, lastcloseparen = 0,
  306. swap = 0x0, offs = 0x191f6c8, subbeg = 0x0, sublen = 0, prelen = 1, precomp = 0x18fb870 "0)",
  307. wrapped = 0x18fb868 "(?-xism:0)", wraplen = 10, seen_evals = 0, paren_names = 0x0, refcnt = 1}
  308. TEST COVERAGE
  309. -------------
  310. Bytecode:
  311. coverage for ret(0) ldsv(1) ldop(2) stsv(3) stop(4) stpv(5) ldspecsv(6)
  312. ldspecsvx(7) newsv(8) newsvx(9) nop(10) newop(11) newopx(12) newopn(13)
  313. newpv(14) pv_cur(15) pv_free(16) sv_upgrade(17) sv_refcnt(18) sv_refcnt_add(19)
  314. sv_flags(20) xrv(21) xpv(22) xpv_cur(23) xpv_len(24) xiv(25) xnv(26)
  315. xlv_targoff(27) xlv_targlen(28) xlv_targ(29) xlv_type(30) xbm_useful(31)
  316. xbm_previous(32) xbm_rare(33) xfm_lines(34) comment(35) xio_lines(36) xio_page(37)
  317. xio_page_len(38) xio_lines_left(39) xio_top_name(40) xio_top_gv(41) xio_fmt_name(42)
  318. xio_fmt_gv(43) xio_bottom_name(44) xio_bottom_gv(45) xio_type(46) xio_flags(47)
  319. xcv_xsubany(48) xcv_stash(49) xcv_start(50) xcv_root(51) xcv_gv(52) xcv_file(53)
  320. xcv_depth(54) xcv_padlist(55) xcv_outside(56) xcv_outside_seq(57) xcv_flags(58)
  321. av_extend(59) av_pushx(60) av_push(61) xav_fill(62) xav_max(63) xav_flags(64)
  322. xhv_name(65) hv_store(66) sv_magic(67) mg_obj(68) mg_private(69) mg_flags(70)
  323. mg_name(71) mg_namex(72) xmg_stash(73) gv_fetchpv(74) gv_fetchpvx(75) gv_stashpv(76)
  324. gv_stashpvx(77) gp_sv(78) gp_refcnt(79) gp_refcnt_add(80) gp_av(81) gp_hv(82)
  325. gp_cv(83) gp_file(84) gp_io(85) gp_form(86) gp_cvgen(87) gp_line(88) gp_share(89)
  326. xgv_flags(90) op_next(91) op_sibling(92) op_ppaddr(93) op_targ(94) op_type(95)
  327. op_opt(96) op_latefree(97) op_latefreed(98) op_attached(99) op_first(102) op_last(103)
  328. op_pmreplroot(105) op_pmreplstart(106) op_pmreplrootpo(108) op_pmstash(109)
  329. op_pmreplrootgv(110) pregcomp(111) op_pmflags(112) unused(113) op_reflags(114)
  330. op_sv(115) op_pv(117) op_pv_tr(118) op_redoop(119) op_nextop(120) op_lastop(121)
  331. cop_label(122) cop_stash(125) cop_filegv(126) push_begin(134) push_init(135)
  332. push_end(136) curstash(137) defstash(138) data(139) incav(140) load_glob(141)
  333. regex_padav(142) comppad_name(144) xgv_stash(145) signal(146) formfeed(147)
  334. JIT PLANS
  335. ---------
  336. Jit came alive March 2010 on github and now CPAN.
  337. It works to do profiling, but is not finished.
  338. B-C-1.04_10:
  339. Playing with the idea to target against parrot pir instead of lightning
  340. and use the parrot jit, with pbc_to_exe or exec_save.
  341. Then we need no jit support in the ByteLoader and get rid of all the Jit
  342. stuff for now.
  343. => B::PIR, Doing mentoring for Google Soc 2008
  344. B-C-1.04_03:
  345. added Jit and Asm layout, with the idea of using either
  346. lightning as jit backend (Jit), or creating our own assembler (Asm)
  347. to be able to use a high-level language.
  348. Abbrevations
  349. ------------
  350. bc B::ByteCode
  351. c B::C
  352. cc B::CC
  353. -D -DDEBUGGING perl, also used as d version suffix, eg 5.8.8d
  354. -nt not threaded perl
  355. 2012-01-26 rurban