[MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
Reporter: streincorp | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.4.2
Keywords: | Port: inkscape @0.92.2_2
On Mac OS X 10.12.6 (Sierra) with Xcode 9.2 regular build and
sudo port -ns install inkscape inkscape-textext inkscape-app
---> Computing dependencies for inkscape
---> Fetching distfiles for inkscape
---> Verifying checksums for inkscape
---> Extracting inkscape
---> Applying patches to inkscape
---> Configuring inkscape
---> Building inkscape
---> Staging inkscape into destroot
---> Installing inkscape @0.92.2_2+x11
---> Activating inkscape @0.92.2_2+x11
---> Cleaning inkscape
---> Computing dependencies for inkscape-textext
---> Fetching distfiles for inkscape-textext
---> Verifying checksums for inkscape-textext
---> Extracting inkscape-textext
---> Configuring inkscape-textext
---> Building inkscape-textext
---> Staging inkscape-textext into destroot
---> Installing inkscape-textext @0.4.4_2+pygtk+python27
---> Activating inkscape-textext @0.4.4_2+pygtk+python27
---> Cleaning inkscape-textext
---> Computing dependencies for inkscape-app
---> Fetching distfiles for inkscape-app
---> Verifying checksums for inkscape-app
---> Extracting inkscape-app
---> Configuring inkscape-app
---> Building inkscape-app
---> Staging inkscape-app into destroot
---> Installing inkscape-app @0.92_1
---> Activating inkscape-app @0.92_1
---> Cleaning inkscape-app
but the command "inkscape" lead to the error\\
libc++abi.dylib: terminating with uncaught exception of type
Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can
No matter if launched as current user or root, from XQuartz or from the
As suggested in https://github.com/caskformula/homebrew- caskformula/issues/4#issuecomment-343905781 \\
tried to launch:\\
with no success.\\
Tried also to clean/reinstall/compile again with no success\\
If the problem is related to the language/locale, mine is
but also the commands
lead all to the same error.
I think the problem may be that iconv is used for character set conversion
from a `std::wstring`'s internal memory representation and iconv assumes
what the actual encoding is (despite the C++ standard not specifying one).
Here's a minimal reproducer:
Sure, but I have a feeling I'm close to a solution anyway, since I've
noticed using the same code that's used for g++/libstdc++ in glibmm also
works for clang++/libc++. However, it seems patching the two places in
`glib/glibmm/ustring.cc` are not enough to actually make the crash go
away, so I'd still like to do a debug build of inkscape to get a new
If anybody wants to help out with that, that would be welcome. I'm
currently not at the machine with the WIP patch, but it doesn't do
anything but replacing `defined(__STDC_ISO_10646__)` with
`(defined(__STDC_ISO_10646__) || defined(_LIBCPP_VERSION))`.
glibmm: Fix character set conversion with libc++
glibmm contains code that attempts to convert between std::wstring and
glibmm's Glib::ustring string class, which stores characters in UTF-8.
This conversion code was using a fallback solution that eventually calls
iconv to convert from the "WCHAR_T" character set to UTF-8.
On macOS, iconv --list does not show WCHAR_T as supported character set
and comments in the libiconv code handling WCHAR_T suggest it was
written for glibc, which is not used on macOS. Consequently, the
conversion failed, which caused Glib::ustring to throw an exception.
This exception was not caught by inkscape and caused a crash when
starting inkscape, rendering it useless.
Fortunately, glibmm already contained code to deal with libc++'s
std::wstrings, but it was guaded by a check for the __STDC_ISO_10646__
prepocessor define. Allowing _LIBCPP_VERSION in addition to
__STDC_ISO_10646__ makes code compiled against libc++ use this code path
and solves the issue.