Skip to content
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

Imager segfaults on T1 tests #108

Closed
shawnlaffan opened this issue Jun 26, 2023 · 9 comments
Closed

Imager segfaults on T1 tests #108

shawnlaffan opened this issue Jun 26, 2023 · 9 comments

Comments

@shawnlaffan
Copy link
Contributor

shawnlaffan commented Jun 26, 2023

Extract of the failing component below.

I have not yet checked if RC1 also fails but assume it does. 5.36 needs to be checked also as this is flagged to ignore test failures.

Note that the LC_ALL needs to be set for compilation under 5.38. (Edit: This was under the Docker instance which does not set this variable. It should be OK for normal machines).

EDIT - it also fails under 5.36.

gmake[1]: Entering directory 'C:/spbuild/msys64/.cpanm/work/1687746800.2752/Imager-1.019/T1'
"C:\strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- T1.bs ..\blib\arch\auto\Imager\Font\T1\T1.bs
 644
"C:\strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test
_harness(0, '..\blib\lib', '..\blib\arch')" t/*.t
t/t10type1.t ... Dubious, test returned 5 (wstat 1280, 0x500)
All 20 subtests passed
t/t20oo.t ...... Dubious, test returned 5 (wstat 1280, 0x500)
Failed 13/14 subtests
t/t30thread.t .. Dubious, test returned 5 (wstat 1280, 0x500)
Failed 8/8 subtests
t/t90std.t ..... Dubious, test returned 5 (wstat 1280, 0x500)
Failed 21/21 subtests

Test Summary Report
-------------------
t/t10type1.t (Wstat: 1280 (exited 5) Tests: 20 Failed: 0)
  Non-zero exit status: 5
  Parse errors: No plan found in TAP output
t/t20oo.t    (Wstat: 1280 (exited 5) Tests: 1 Failed: 0)
  Non-zero exit status: 5
  Parse errors: Bad plan.  You planned 14 tests but ran 1.
t/t30thread.t (Wstat: 1280 (exited 5) Tests: 0 Failed: 0)
  Non-zero exit status: 5
  Parse errors: Bad plan.  You planned 8 tests but ran 0.
t/t90std.t   (Wstat: 1280 (exited 5) Tests: 0 Failed: 0)
  Non-zero exit status: 5
  Parse errors: Bad plan.  You planned 21 tests but ran 0.
Files=4, Tests=21,  1 wallclock secs ( 0.05 usr +  0.00 sys =  0.05 CPU)
Result: FAIL
Failed 4/4 test programs. 0/21 subtests failed.
gmake[1]: *** [makefile:837: test_dynamic] Error 5
gmake[1]: Leaving directory 'C:/spbuild/msys64/.cpanm/work/1687746800.2752/Imager-1.019/T1'
gmake: *** [makefile:1357: subdirs-test_dynamic] Error 2
@shawnlaffan shawnlaffan changed the title SP 5.38.0.1 RC2 Imager fails tests [SP 5.38.0.1 RC2] Imager fails tests Jun 26, 2023
@shawnlaffan shawnlaffan changed the title [SP 5.38.0.1 RC2] Imager fails tests Imager fails tests Jun 26, 2023
@shawnlaffan
Copy link
Contributor Author

gdb backtrace:

(gdb) set args -Mblib t\t20oo.t
(gdb) set disable-randomization off
(gdb) run
Starting program: D:\5.38.0RC2_20230626\perl\bin\perl.exe -Mblib t\t20oo.t
[New Thread 19928.0x3348]
[New Thread 19928.0x4e18]
[New Thread 19928.0x1974]
1..14
ok 1 - make output directory

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff9db08d763 in strncpy () from C:\WINDOWS\System32\msvcrt.dll
(gdb) bt
#0  0x00007ff9db08d763 in strncpy () from C:\WINDOWS\System32\msvcrt.dll
#1  0x00000000567d958f in ?? () from D:\5.38.0RC2_20230626\c\bin\libt1-5__.dll
#2  0x00000000567e9552 in ?? () from D:\5.38.0RC2_20230626\c\bin\libt1-5__.dll
#3  0x00000000567e01a4 in ?? () from D:\5.38.0RC2_20230626\c\bin\libt1-5__.dll
#4  0x00007ff9a945315d in boot_Imager__Font__T1 ()
   from D:\5.38.0RC2_20230626\data\.cpanm\work\1687769011.2088\Imager-1.019\blib\arch\auto\Imager\Font\T1\T1.xs.dll
#5  0x00007ff9a94529b0 in ?? ()
   from D:\5.38.0RC2_20230626\data\.cpanm\work\1687769011.2088\Imager-1.019\blib\arch\auto\Imager\Font\T1\T1.xs.dll
#6  0x00007ff958df2fec in perl538!Perl_clear_defarray () from D:\5.38.0RC2_20230626\perl\bin\perl538.dll
#7  0x00007ff958e47982 in perl538!Perl_runops_standard () from D:\5.38.0RC2_20230626\perl\bin\perl538.dll
#8  0x00007ff958e0368b in perl_run () from D:\5.38.0RC2_20230626\perl\bin\perl538.dll
#9  0x00007ff958e56e73 in perl538!RunPerl () from D:\5.38.0RC2_20230626\perl\bin\perl538.dll
#10 0x00007ff7f6821340 in ?? ()
#11 0x00007ff7f6821146 in ?? ()
#12 0x00007ff9db197614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#13 0x00007ff9dd0226f1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#14 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

@shawnlaffan shawnlaffan changed the title Imager fails tests Imager segfaults on T1 tests Jul 3, 2023
@shawnlaffan
Copy link
Contributor Author

I have removed libt1 from the builds for now (commit pending push).

@sisyphus
Copy link

sisyphus commented Jul 3, 2023

Maybe @tonycoz could take a look ?

@shawnlaffan
Copy link
Contributor Author

Maybe @tonycoz could take a look ?

I've already reported the issue to the Imager repo at tonycoz/imager#510

@shawnlaffan
Copy link
Contributor Author

This is a wontfix.

To summarise from tonycoz/imager#510 :
Debian dropped support for t1lib about a decade ago. Adobe has also EOL'd support for T1 fonts as of January this year.

It's also worth noting that MSYS2 also do not include t1lib.

Strawberry Perl can follow suit. The latest releases already exclude t1lib but we should explicitly exclude it in the config files (syntax in tonycoz/imager#510 (comment)).

@genio - FYI.

@genio
Copy link
Member

genio commented Jul 8, 2023

👍

@PhilterPaper
Copy link

Debian dropped support for t1lib about a decade ago. Adobe has also EOL'd support for T1 fonts as of January this year.

Interesting. The RedHat packaging team requested that .t1 font file support be added to PDF::Builder earlier this year. I realize that Adobe is in the process of abandoning T1 fonts, but it was a small matter to add .t1 (in addition to existing .pfa and .pfb support) so I did it. It doesn't use t1lib.

Does anyone know Adobe's (or other major PDF Reader players') plans for supporting just the reading (display) of PDF files with T1 fonts? Even if they don't want to support authoring with T1, I would hope they would continue to read PDF files that use T1 for quite some time to come.

When and if most PDF Readers can no longer support T1 fonts, I may remove support from PDF::Builder. In the meantime, the documentation reminds users that T1 is no longer a preferred font format (neither are CJK fonts), and they should try using TTF/OTF or core fonts instead.

@shawnlaffan
Copy link
Contributor Author

I'm not aware of any support plans by the various vendors, but that's apropos of nothing.

The issue from the Strawberry Perl perspective is that the t1lib library needs to be patched. If someone can provide such a patch then we can consider reinstating it.

@tonycoz
Copy link

tonycoz commented Jul 31, 2023

I would hope they would continue to read PDF files that use T1 for quite some time to come.

From the adobe announcement:

If a document/job uses and embeds a Type 1 font, the text will continue to be rendered using the Type 1 font. If the Type 1 font is not embedded in the PDF file or PostScript print stream, then the Type 1 font must be resident on printer. This is unchanged.

So I expect readers will continue to support embedded Type1 fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants