Closed Bug 1583192 Opened 5 years ago Closed 5 years ago

gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc:442:21: error: reinterpret_cast from 'nullptr_t' to 'sfntly::ReadableFontData *' is not allowed

Categories

(Core :: Graphics: Text, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox-esr68 --- wontfix
firefox69 --- unaffected
firefox70 --- wontfix
firefox71 --- wontfix
firefox72 --- fixed

People

(Reporter: jbeich, Assigned: jbeich)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

FreeBSD and OpenBSD define NULL as nullptr for C++11 or later.
https://github.com/freebsd/freebsd/commit/c8ed04c26b6758354853a6bed4629f71d0d01a7d
https://github.com/openbsd/src/commit/6ecde746dea9a5d17abf3bafa06c232b9189b33b

$ c++ --version
FreeBSD clang version 9.0.0 (tags/RELEASE_900/final 372316) (based on LLVM 9.0.0)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin

$ ./mach bootstrap
$ ./mach build
[...]
In file included from Unified_cpp_gfx_sfntly_cpp_src2.cpp:20:
gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc:442:21: error: reinterpret_cast from 'nullptr_t' to 'sfntly::ReadableFontData *' is not allowed
    : CMap::Builder(reinterpret_cast<ReadableFontData*>(NULL),
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc:566:34: error: reinterpret_cast from 'nullptr_t' to 'sfntly::WritableFontData *' is not allowed
                               : reinterpret_cast<WritableFontData*>(NULL),
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc:577:34: error: reinterpret_cast from 'nullptr_t' to 'sfntly::ReadableFontData *' is not allowed
                               : reinterpret_cast<ReadableFontData*>(NULL),
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc:961:21: error: reinterpret_cast from 'nullptr_t' to 'sfntly::ReadableFontData *' is not allowed
    : CMap::Builder(reinterpret_cast<ReadableFontData*>(NULL),
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gfx/sfntly/cpp/src/sfntly/table/core/cmap_table.cc:969:21: error: reinterpret_cast from 'nullptr_t' to 'sfntly::ReadableFontData *' is not allowed
    : CMap::Builder(reinterpret_cast<ReadableFontData*>(NULL),
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 errors generated.

I'd recommend fixing this upstream (https://github.com/googlefonts/sfntly/) and then one can submit a pull-from-upstream patch for this bug.

Attached patch v1Splinter Review

Sorry, I can't submit on Phabricator due to bug 1536716.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=499f2bb97e191dbd5966bc3ecbc199b09daca919

Patch generated by:

$ rg -l 'reinterpret_cast<.*>\(NULL\)' |
   xargs sed -i '' 's/reinterpret_cast<\(.*\)>(NULL)/static_cast<\1>(NULL)/'
Whiteboard: Add bug 1581145 (restricted) to "Regressed by" field

Bug 1581145 was uplifted to 70beta and 68esr, updating tracking flags.

What needs to happen next, here? Jan do you need someone else or can you land this?

Flags: needinfo?(jbeich)

I need a reviewer. Can you help?

(In reply to Nathan Froyd [:froydnj] [away until 28 October] from comment #1)

https://github.com/googlefonts/sfntly/

Looks semi-abandoned. README.md says: "This project is not developed any further. Only Bug fixes will be merged, but new features won't."
Upstream is unlikely to fix FreeBSD support on their own or switch to C++11 then convert NULL to nullptr.

Flags: needinfo?(jbeich) → needinfo?(jfkthame)

I've tried submitting a PR upstream; let's see if that gets any response.
https://github.com/googlefonts/sfntly/pull/111

Leaving ni? flag to remind me to check on this later.

The readme mentions a maintained fork at https://github.com/rillig/sfntly — maybe worth switching to it?

Component: Printing: Output → Graphics: Text

This bug is making bisecting on FreeBSD harder. Maybe Skia PDF should be disabled on GTK platforms due to bug 1322653.

(In reply to greg v [:myfreeweb] from comment #10)

https://github.com/rillig/sfntly

Doesn't look actively maintained either: last change on 2018-11-13, no explicit -std=, still uses reinterpret_cast<...>(NULL). Firefox effort to use Skia PDF for printing appears stalled. Another SkPDF consumer, Project Mortar (port PDFium from Chromium), was canned in bug 1503537.

Fwiw, this is also harming development on OpenBSD, as m-c builds are broken since a while. Can we get the patch somehow commited to ease our lives ? Upstream seems dead/not responding to the PR..

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Assignee: nobody → jbeich

Do we need to uplift this to Beta & ESR68? If so, please nominate :)

Flags: needinfo?(jfkthame) → needinfo?(jbeich)

We have shipped our last beta for 71, marking as wontfix for 71.

sfntly is only built by default on Nightly and cannot be used on Linux/BSD/Solaris due to bug 1322653. Backporting isn't necessary.
https://searchfox.org/mozilla-central/rev/581466eef926/toolkit/moz.configure#842-843

Flags: needinfo?(jbeich)
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: