xaicron / p5-win32-unicode

perl unicode-friendly wrapper for win32api.
http://blog.livedoor.jp/xaicron/
13 stars 5 forks source link

failure during make test on Strawberry perl 5.38 / crash on Win32::Unicode::Dir::find_next_file #12

Open assysttest opened 11 months ago

assysttest commented 11 months ago
The errors during make test:
C:\temp\Win32-Unicode-0.38>make test
"C:\PerlBranches\HEAD\Strawberry\perl\bin\perl.exe" "-Iinc" -MExtUtils::Command::MM -e cp_nonempty -- Unicode.bs blib\arch\auto\Win32\Unicode\Unicode.bs 644
"C:\PerlBranches\HEAD\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'inc', 'blib\lib', 'blib\arch')" t/*.t
t/00_compile.t ........... ok
t/01_load.t .............. ok
t/02_export.t ............ ok
t/03_encode.t ............ ok
t/04_print.t .............
#   Failed test at t/04_print.t line 14.
t/04_print.t ............. 1/? # STDOUT is:
#  I ♥ Perl
# not:
#  I ÔÖÑ Perl
# as expected

#   Failed test at t/04_print.t line 15.
# STDOUT is:
# [ I ♥ Perl]
# not:
# [ I ÔÖÑ Perl]
# as expected

#   Failed test at t/04_print.t line 16.
# STDOUT is:
#  I ♥ Perl
#
# not:
#  I ÔÖÑ Perl
#
# as expected
# Looks like you failed 3 tests of 13.
t/04_print.t ............. Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/13 subtests
t/05_write.t ............. ok
t/06_dir_functions.t ..... Dubious, test returned 5 (wstat 1280, 0x500)
All 3 subtests passed
t/06_dir_methods.t ....... Dubious, test returned 5 (wstat 1280, 0x500)
No subtests run
t/06_dir_tree.t .......... Dubious, test returned 5 (wstat 1280, 0x500)
No subtests run
t/07_file.t .............. 1/?
        #   Failed test 'dev'
        #   at t/07_file.t line 87.
        #          got: '2'
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 90.
        #          got: '0'
        #     expected: '4785074605158749'

        #   Failed test 'rdev'
        #   at t/07_file.t line 96.
        #          got: '2'
        #     expected: '0'

        #   Failed test 'dev'
        #   at t/07_file.t line 106.
        #          got: '2'
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 109.
        #          got: '0'
        #     expected: '4785074605158749'

        #   Failed test 'rdev'
        #   at t/07_file.t line 115.
        #          got: '2'
        #     expected: '0'
        # Looks like you failed 6 tests of 26.

    #   Failed test 'filename'
    #   at t/07_file.t line 124.

        #   Failed test 'dev'
        #   at t/07_file.t line 87.
        #          got: '2'
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 90.
        #          got: '0'
        #     expected: '4785074605158749'

        #   Failed test 'rdev'
        #   at t/07_file.t line 96.
        #          got: '2'
        #     expected: '0'

        #   Failed test 'dev'
        #   at t/07_file.t line 106.
        #          got: '2'
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 109.
        #          got: '0'
        #     expected: '4785074605158749'

        #   Failed test 'rdev'
        #   at t/07_file.t line 115.
        #          got: '2'
        #     expected: '0'
        # Looks like you failed 6 tests of 26.

    #   Failed test 'filehandle'
    #   at t/07_file.t line 124.
    # Looks like you failed 2 tests of 2.

#   Failed test 'stat'
#   at t/07_file.t line 128.

        #   Failed test 'dev'
        #   at t/07_file.t line 142.
        #          got: undef
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 145.
        #          got: undef
        #     expected: '4503599628448094'

        #   Failed test 'mode'
        #   at t/07_file.t line 146.
        #          got: undef
        #     expected: '16895'

        #   Failed test 'nlink'
        #   at t/07_file.t line 148.
        #          got: undef
        #     expected: '1'

        #   Failed test 'uid'
        #   at t/07_file.t line 149.
        #          got: undef
        #     expected: '0'

        #   Failed test 'gid'
        #   at t/07_file.t line 150.
        #          got: undef
        #     expected: '0'

        #   Failed test 'rdev'
        #   at t/07_file.t line 151.
        #          got: undef
        #     expected: '0'

        #   Failed test 'size'
        #   at t/07_file.t line 152.
        #          got: undef
        #     expected: '0'

        #   Failed test 'atime'
        #   at t/07_file.t line 153.
        #          got: undef
        #     expected: '1701677152'

        #   Failed test 'mtime'
        #   at t/07_file.t line 154.
        #          got: undef
        #     expected: '1701677152'

        #   Failed test 'ctime'
        #   at t/07_file.t line 155.
        #          got: undef
        #     expected: '1701677152'

        #   Failed test 'blksize'
        #   at t/07_file.t line 156.
        #          got: undef
        #     expected: ''

        #   Failed test 'blocks'
        #   at t/07_file.t line 157.
        #          got: undef
        #     expected: ''

        #   Failed test 'dev'
        #   at t/07_file.t line 161.
        #          got: undef
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 164.
        #          got: undef
        #     expected: '4503599628448094'

        #   Failed test 'mode'
        #   at t/07_file.t line 165.
        #          got: undef
        #     expected: '16895'

        #   Failed test 'nlink'
        #   at t/07_file.t line 167.
        #          got: undef
        #     expected: '1'

        #   Failed test 'uid'
        #   at t/07_file.t line 168.
        #          got: undef
        #     expected: '0'

        #   Failed test 'gid'
        #   at t/07_file.t line 169.
        #          got: undef
        #     expected: '0'

        #   Failed test 'rdev'
        #   at t/07_file.t line 170.
        #          got: undef
        #     expected: '0'

        #   Failed test 'size'
        #   at t/07_file.t line 171.
        #          got: undef
        #     expected: '0'

        #   Failed test 'atime'
        #   at t/07_file.t line 172.
        #          got: undef
        #     expected: '1701677152'

        #   Failed test 'mtime'
        #   at t/07_file.t line 173.
        #          got: undef
        #     expected: '1701677152'

        #   Failed test 'ctime'
        #   at t/07_file.t line 174.
        #          got: undef
        #     expected: '1701677152'

        #   Failed test 'blksize'
        #   at t/07_file.t line 175.
        #          got: undef
        #     expected: ''

        #   Failed test 'blocks'
        #   at t/07_file.t line 176.
        #          got: undef
        #     expected: ''
        # Looks like you failed 26 tests of 26.

    #   Failed test 'dirname'
    #   at t/07_file.t line 179.

        #   Failed test 'dev'
        #   at t/07_file.t line 142.
        #          got: '2'
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 145.
        #          got: '0'
        #     expected: '4503599628448094'

        #   Failed test 'rdev'
        #   at t/07_file.t line 151.
        #          got: '2'
        #     expected: '0'

        #   Failed test 'dev'
        #   at t/07_file.t line 161.
        #          got: '2'
        #     expected: '2859836225'

        #   Failed test 'ino'
        #   at t/07_file.t line 164.
        #          got: '0'
        #     expected: '4503599628448094'

        #   Failed test 'rdev'
        #   at t/07_file.t line 170.
        #          got: '2'
        #     expected: '0'
        # Looks like you failed 6 tests of 26.

    #   Failed test 'dirhandle'
    #   at t/07_file.t line 179.
    # Looks like you failed 2 tests of 2.

#   Failed test 'stat on dir'
#   at t/07_file.t line 183.
# Looks like you failed 2 tests of 8.
t/07_file.t .............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/8 subtests
t/08_error.t ............. ok
t/09_normalize.t ......... ok
t/10_read.t .............. ok
t/10_read_with_offset.t .. ok
t/11_write.t ............. Dubious, test returned 5 (wstat 1280, 0x500)
All 24 subtests passed
t/12_syswrite.t .......... ok
t/13_system.t ............ ok
t/15_flock.t ............. ok
t/15_flock_win32.t ....... ok
t/16_io_handle_like.t .... ok
t/17_slurp.t ............. ok
t/30_native.t ............ ok
t/31_native_import.t ..... ok
t/32_native_file.t ....... ok
t/33_native_dir.t ........ Dubious, test returned 5 (wstat 1280, 0x500)
No subtests run
t/34_args.t .............. ok
t/50_util.t .............. ok

Test Summary Report
-------------------
t/04_print.t           (Wstat: 768 (exited 3) Tests: 13 Failed: 3)
  Failed tests:  1-3
  Non-zero exit status: 3
t/06_dir_functions.t   (Wstat: 1280 (exited 5) Tests: 3 Failed: 0)
  Non-zero exit status: 5
  Parse errors: No plan found in TAP output
t/06_dir_methods.t     (Wstat: 1280 (exited 5) Tests: 0 Failed: 0)
  Non-zero exit status: 5
  Parse errors: No plan found in TAP output
t/06_dir_tree.t        (Wstat: 1280 (exited 5) Tests: 0 Failed: 0)
  Non-zero exit status: 5
  Parse errors: No plan found in TAP output
t/07_file.t            (Wstat: 512 (exited 2) Tests: 8 Failed: 2)
  Failed tests:  4-5
  Non-zero exit status: 2
t/11_write.t           (Wstat: 1280 (exited 5) Tests: 24 Failed: 0)
  Non-zero exit status: 5
  Parse errors: No plan found in TAP output
t/33_native_dir.t      (Wstat: 1280 (exited 5) Tests: 0 Failed: 0)
  Non-zero exit status: 5
  Parse errors: No plan found in TAP output
Files=27, Tests=260, 29 wallclock secs ( 0.09 usr +  0.12 sys =  0.22 CPU)
Result: FAIL
Failed 7/27 test programs. 5/260 subtests failed.
make: *** [makefile:1039: test_dynamic] Error 255

################################################################

When I install it without test I'm watching a crash during find_next_file (call inside fetch to return a list of all files in a folder)
assysttest commented 5 months ago

The bug is in find_first_file. Simple change xs\Dir.xs, line 52. Old: hv_stores(hv, "handle", newSVuv((DWORD)handle)); New: hv_stores(hv, "handle", newSVuv((HANDLE)handle)); This solves the problem for me.