[MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
#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
 installation\\
 {{{
 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
 Glib::ConvertError

 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
 fix it.
 }}}

 No matter if launched as current user or root, from XQuartz or from the
 standard Terminal.app\\

 As suggested in https://github.com/caskformula/homebrew-
 caskformula/issues/4#issuecomment-283505030 , \\
 tried to delete/rename ~/.config/inkscape and ~/.cache/inkscape , no
 success\\

 As suggested in https://github.com/caskformula/homebrew-
 caskformula/issues/4#issuecomment-343905781 \\
 tried to launch:\\
 {{{
 LANG="en_US.UTF-8" inkscape
 LANG="en_US" inkscape
 LANG=en_US inkscape
 LANG=en_US.UTF-8 inkscape
 LANG=C inkscape
 }}}
 with no success.\\

 Tried also to clean/reinstall/compile again with no success\\

 Some hints maybe here: https://github.com/caskformula/homebrew-
 caskformula/issues/41 \\

 If the problem is related to the language/locale, mine is
 {{{
  locale
 LANG="it_IT.UTF-8"
 LC_COLLATE="it_IT.UTF-8"
 LC_CTYPE="it_IT.UTF-8"
 LC_MESSAGES="it_IT.UTF-8"
 LC_MONETARY="it_IT.UTF-8"
 LC_NUMERIC="it_IT.UTF-8"
 LC_TIME="it_IT.UTF-8"
 LC_ALL=
 }}}

 but also the commands
 {{{
 LANG="it_IT.UTF-8" inkscape
 LANG="it_IT" inkscape
 LANG=it_IT inkscape
 LANG=it_IT.UTF-8 inkscape
 }}}
 lead all to the same error.

 Thank you very much for the help and fixes

--
Ticket URL: <https://trac.macports.org/ticket/56214>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------
Changes (by mf2k):

 * status:  new => assigned
 * owner:  (none) => dbevans
 * port:  inkscape @0.92.2_2 => inkscape
 * cc: dbevans (removed)


--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------
Changes (by dbevans):

 * status:  assigned => accepted


Comment:

 I've just seen the same issue after upgrading to 0.92.3 on High Sierra
 10.13.4 with Xcode 9.3.  No answers yet but looking.

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by wilya7):

 I believe is the same issue I reported here:
 [https://trac.macports.org/ticket/52632#comment:30]

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by neverpanic):

 From a quick look, it seems the the thrown Glib::ConvertError means that a
 character conversion problem has occurred.

 The relevant code is in glibmm,
 [https://github.com/GNOME/glibmm/blob/master/glib/glibmm/ustring.cc#L1366-L1404
 glib/glibmm/ustring.cc]. Our glibmm is configured with
 `GLIBMM_HAVE_WIDE_STREAM`, so that already limits the code paths that
 could be used. I'm not yet sure whether `__STDC_ISO_10646__` is defined in
 our build or whether we are using `g_convert`.

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by neverpanic):

 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:

 {{{
 #!cpp
 /* clang++ -std=c++11 -Wall -Werror $(pkg-config --cflags --libs
 glibmm-2.4) test.cpp -o test */
 #include <glibmm.h>
 #include <iostream>
 #include <string>

 int main() {
         std::wstring str = L"Fööööö";
         GError* error = nullptr;
         gsize n_bytes;
         const auto buf = g_convert(reinterpret_cast<const
 char*>(str.data()), str.size() * sizeof(std::wstring::value_type),
 "UTF-8", "WCHAR_T", nullptr, &n_bytes, &error);

         if (error) {
                 std::cout << error->message << std::endl;
         } else {
                 std::cout << buf << std::endl;
         }
 }
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by neverpanic):

 Replacing `WCHAR_T` with `UTF-32LE` works, so I guess
 clang/libc++/libSystem are using that as internal representation for
 WCHAR_T, while gcc/libstdc++/glibc are using something else.

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by neverpanic):

 Upstream glibmm related: https://bugzilla.gnome.org/show_bug.cgi?id=583992

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:8>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by streincorp):

 @neverpanic
 I think that should be better to open a separate ticket at gnome.org to
 track the WCHAR_T crash in glibmm and/or advise the developers of iconv to
 fix (or reject) WCHAR_T on macOS.

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by neverpanic):

 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
 stacktrace.

 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))`.

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:10>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+----------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  accepted
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:              |   Keywords:
      Port:  inkscape    |
-------------------------+----------------------

Comment (by neverpanic):

 Got it solved, filed https://bugzilla.gnome.org/show_bug.cgi?id=795338
 with a patch. Will apply the fix to our copy of glibmm shortly.

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+---------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  closed
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:  fixed       |   Keywords:
      Port:  inkscape    |
-------------------------+---------------------
Changes (by neverpanic):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"e864b2340be9ef003d8ff4aef92e7151d06287dd/macports-ports"
 e864b2340be9ef003d8ff4aef92e7151d06287dd/macports-ports]:
 {{{
 #!ConfigurableCommitTicketReference repository="macports-ports"
 revision="e864b2340be9ef003d8ff4aef92e7151d06287dd"
 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.

 Closes: https://trac.macports.org/ticket/56214
 }}}

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:12>
MacPorts <https://www.macports.org/>
Ports system for macOS
Reply | Threaded
Open this post in threaded view
|

Re: [MacPorts] #56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError

MacPorts
In reply to this post by MacPorts
#56214: inkscape @ 0.92.2_2 all variants: libc++abi.dylib Glib::ConvertError
-------------------------+---------------------
  Reporter:  streincorp  |      Owner:  dbevans
      Type:  defect      |     Status:  closed
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.4.2
Resolution:  fixed       |   Keywords:
      Port:  inkscape    |
-------------------------+---------------------

Comment (by dbevans):

 Yes, this does the trick, Clemens.  Thanks for your help in figuring out
 and explaining the issues involved,

 inkscape updated to latest version 0.92.3 in
 [changeset:605ff8491cd8b43ce5bacdcb5de7c4ad034abfb8/macports-ports]

--
Ticket URL: <https://trac.macports.org/ticket/56214#comment:13>
MacPorts <https://www.macports.org/>
Ports system for macOS