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

synfig + synfigstudio: update to 1.4.2 #32358

Merged
merged 3 commits into from
Nov 16, 2021
Merged

Conversation

newbluemoon
Copy link
Contributor

General

Have the results of the proposed changes been tested?

  • I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
  • I generally don't use the affected packages but briefly tested this PR

@newbluemoon
Copy link
Contributor Author

The test passes on x86_64 and my local i686-musl build. So it might not be musl specific.
With version 1.4.1 the test passes on all targets.
No idea why there is a segmentation fault on x86_64-musl. Maybe I should open an issue upstream?
I could post a gdb backtrace if anyone is intrested. ;)

@ericonr
Copy link
Member

ericonr commented Aug 6, 2021

I could post a gdb backtrace if anyone is intrested. ;)

Please do :)

I bet on thread stack size, if the test binary is threaded :p

@newbluemoon
Copy link
Contributor Author

Here you go:

(gdb) run
Starting program: /builddir/synfigstudio-1.4.2/test/.libs/lt-app_layerduplicate 
[New LWP 23222]
[New LWP 23223]
[New LWP 23224]
[New LWP 23225]
[New LWP 23226]
[New LWP 23227]
[New LWP 23228]
[New LWP 23229]
[New LWP 23230]
[New LWP 23231]
[New LWP 23232]
[New LWP 23233]
[New LWP 23234]
[New LWP 23235]
[New LWP 23236]
[New LWP 23237]
synfig(23218) [19:29:09] info: rendering threads 16
synfig(23218) [19:29:09] warning: Cannot open ./synfig_modules.cfg
synfig(23218) [19:29:09] warning: Cannot open /tmp/.local/share/synfig/synfig_modules.cfg
synfig(23218) [19:29:09] info: Loading modules from /etc/synfig_modules.cfg
synfig(23218) [19:29:09] info: Loading lyr_std..
synfig(23218) [19:29:09] info: Loading lyr_freetype..
synfig(23218) [19:29:09] info: Loading mod_geometry..
synfig(23218) [19:29:09] info: Loading mod_gradient..
synfig(23218) [19:29:09] info: Loading mod_particle..
synfig(23218) [19:29:09] info: Loading mod_example..
synfig(23218) [19:29:09] info: Loading mod_gif..
synfig(23218) [19:29:09] info: Loading mod_imagemagick..
synfig(23218) [19:29:09] info: Loading mod_magickpp..
synfig(23218) [19:29:09] info: Loading mod_mng..
synfig(23218) [19:29:09] info: Loading mod_noise..
synfig(23218) [19:29:09] info: Loading mod_filter..
synfig(23218) [19:29:09] info: Loading mod_ffmpeg..
synfig(23218) [19:29:09] info: Loading mod_bmp..
synfig(23218) [19:29:09] info: Loading mod_dv..
synfig(23218) [19:29:09] info: Loading mod_png..
synfig(23218) [19:29:09] info: Loading mod_ppm..
synfig(23218) [19:29:09] info: Loading mod_openexr..
synfig(23218) [19:29:09] info: Loading mod_jpeg..
synfig(23218) [19:29:09] info: Loading mod_libavcodec..
synfig(23218) [19:29:09] info: Loading mod_yuv420p..
synfig(23218) [19:29:09] info: Loading mod_svg..

Thread 1 "lt-app_layerdup" received signal SIGSEGV, Segmentation fault.
0x00007ffff7d23710 in synfigapp::Action::LayerDuplicate::replace_valuenodes(std::map<etl::handle<synfig::Layer>, etl::handle<synfig::Layer>, std::less<etl::handle<synfig::Layer> >, std::allocator<std::pair<etl::handle<synfig::Layer> const, etl::handle<synfig::Layer> > > > const&, std::map<etl::rhandle<synfig::ValueNode>, etl::rhandle<synfig::ValueNode>, std::less<etl::rhandle<synfig::ValueNode> >, std::allocator<std::pair<etl::rhandle<synfig::ValueNode> const, etl::rhandle<synfig::ValueNode> > > > const&) () from /builddir/synfigstudio-1.4.2/src/synfigapp/.libs/libsynfigapp.so.0
(gdb) bt
#0  0x00007ffff7d23710 in synfigapp::Action::LayerDuplicate::replace_valuenodes(std::map<etl::handle<synfig::Layer>, etl::handle<synfig::Layer>, std::less<etl::handle<synfig::Layer> >, std::allocator<std::pair<etl::handle<synfig::Layer> const, etl::handle<synfig::Layer> > > > const&, std::map<etl::rhandle<synfig::ValueNode>, etl::rhandle<synfig::ValueNode>, std::less<etl::rhandle<synfig::ValueNode> >, std::allocator<std::pair<etl::rhandle<synfig::ValueNode> const, etl::rhandle<synfig::ValueNode> > > > const&) () from /builddir/synfigstudio-1.4.2/src/synfigapp/.libs/libsynfigapp.so.0
#1  0x00007ffff7d25ad6 in synfigapp::Action::LayerDuplicate::prepare() ()
   from /builddir/synfigstudio-1.4.2/src/synfigapp/.libs/libsynfigapp.so.0
#2  0x00007ffff7e7e1da in synfigapp::Action::Super::perform() ()
   from /builddir/synfigstudio-1.4.2/src/synfigapp/.libs/libsynfigapp.so.0
#3  0x000055555556ca4a in test_synfigapp_layerduplicate_both_layer_duplicate_and_linked_layers() ()
#4  0x000055555556186a in main ()
(gdb)

@newbluemoon
Copy link
Contributor Author

I tried to increase the stack size via -Wl,-z,stack-size=2097152, but to no avail. :(

@ericonr
Copy link
Member

ericonr commented Aug 6, 2021

Yeah segfault is in the main thread, so it would seem to be something else.

@newbluemoon
Copy link
Contributor Author

I opened an issue at synfig: synfig/synfig#2259

@sgn
Copy link
Member

sgn commented Aug 7, 2021

Hm, synfigstudio drops -g from our CFLAGS and CXXFLAGS?

@sgn
Copy link
Member

sgn commented Aug 7, 2021

 srcpkgs/synfigstudio/patches/cflags-cxxflags.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/srcpkgs/synfigstudio/patches/cflags-cxxflags.patch b/srcpkgs/synfigstudio/patches/cflags-cxxflags.patch
new file mode 100644
index 0000000000..85d84ff60a
--- /dev/null
+++ b/srcpkgs/synfigstudio/patches/cflags-cxxflags.patch
@@ -0,0 +1,26 @@
+--- synfigstudio-1.4.2.orig/configure
++++ synfigstudio-1.4.2/configure
+@@ -18015,8 +18015,8 @@ fi
+ 		;;
+ 		no|*)
+ 			debug_flags="-DNDEBUG"
+-			CXXFLAGS="`echo $CXXFLAGS | sed 's:-g[a-z-]*\s::g' | sed 's:-g[a-z-]*$::'` $debug_flags"
+-			CFLAGS="`echo $CFLAGS | sed 's:-g[a-z-]*\s::g' | sed 's:-g[a-z-]*$::'` $debug_flags"
++			CFLAGS="$CFLAGS -DNDEBUG"
++			CXXFLAGS="$CXXFLAGS -DNDEBUG"
+ 		;;
+ 	esac
+ 
+--- synfigstudio-1.4.2.orig/m4/subs.m4
++++ synfigstudio-1.4.2/m4/subs.m4
+@@ -83,8 +83,8 @@ AC_DEFUN([AC_ARG_DEBUG],
+ 		;;
+ 		no|*)
+ 			debug_flags="-DNDEBUG"
+-			CXXFLAGS="`echo $CXXFLAGS | sed 's:-g[[a-z-]]*\s::g' | sed 's:-g[[a-z-]]*$::'` $debug_flags"
+-			CFLAGS="`echo $CFLAGS | sed 's:-g[[a-z-]]*\s::g' | sed 's:-g[[a-z-]]*$::'` $debug_flags"
++			CXXFLAGS="$CXXFLAGS -DNDEBUG"
++			CFLAGS="$CFLAGS -DNDEBUG"
+ 		;;
+ 	esac
+ 

@newbluemoon
Copy link
Contributor Author

@sgn Thanks for noticing and the patch! I’ll add it.

@sgn
Copy link
Member

sgn commented Aug 9, 2021 via email

@sgn
Copy link
Member

sgn commented Aug 9, 2021

Look like a use-after-free somewhere.

rendering/task.h:227:11: runtime error: member call on address 0x7ffa3e282dd8 which does not point to an object of type 'synfig::Token'
0x7ffa3e282dd8: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/task.h:227:11 in 
rendering/software/task/../../task.h:259:22: runtime error: member call on address 0x7ffa3e285120 which does not point to an object of type 'synfig::rendering::ModeToken'
0x7ffa3e285120: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/software/task/../../task.h:259:22 in 
rendering/software/task/../../task.h:259:22: runtime error: member call on address 0x7ffa3e285120 which does not point to an object of type 'synfig::rendering::ModeToken'
0x7ffa3e285120: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/software/task/../../task.h:259:22 in 
rendering/software/task/../../task.h:259:22: runtime error: member call on address 0x7ffa3e285120 which does not point to an object of type 'synfig::rendering::ModeToken'
0x7ffa3e285120: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/software/task/../../task.h:259:22 in 
rendering/software/task/../../task.h:259:22: runtime error: member call on address 0x7ffa3e285120 which does not point to an object of type 'synfig::rendering::ModeToken'
0x7ffa3e285120: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/software/task/../../task.h:259:22 in 
rendering/software/task/../../task.h:259:22: runtime error: member call on address 0x7ffa3e285120 which does not point to an object of type 'synfig::rendering::ModeToken'
0x7ffa3e285120: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/software/task/../../task.h:259:22 in 
rendering/software/task/../../task.h:259:22: runtime error: member call on address 0x7ffa3e285120 which does not point to an object of type 'synfig::rendering::ModeToken'
0x7ffa3e285120: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/software/task/../../task.h:259:22 in 
rendering/software/task/../../task.h:259:22: runtime error: member call on address 0x7ffa3e285120 which does not point to an object of type 'synfig::rendering::ModeToken'
0x7ffa3e285120: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rendering/software/task/../../task.h:259:22 in 
�[33msynfig(4256) [15:18:34] warning: Cannot open ./synfig_modules.cfg�[0m
�[33msynfig(4256) [15:18:34] warning: Cannot open /tmp/.local/share/synfig/synfig_modules.cfg�[0m
valuenode_registry.cpp:85:9: runtime error: call to function (unknown) through pointer to incorrect function type 'synfig::LinkableValueNode *(*)(const synfig::ValueBase &, etl::loose_handle<synfig::Canvas>)'
(/lib/libsynfig.so.0+0x2520c20): note: (unknown) defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior valuenode_registry.cpp:85:9 in 
�[33msynfig(4256) [15:18:34] warning: Can't replace a null valuenode�[0m
�[33msynfig(4256) [15:18:34] warning: Can't replace a null valuenode�[0m
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==4256==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address (pc 0x7ffa39d003f0 bp 0x563d068d2ef8 sp 0x7ffd70aa3180 T4256)
==4256==The signal is caused by a READ memory access.
==4256==Hint: this fault was caused by a dereference of a high value address (see register values below).  Disassemble the provided pc to learn which register was used.
    #0 0x7ffa39d003f0  (/lib/libstdc++.so.6+0xe43f0)

UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV (/lib/libstdc++.so.6+0xe43f0) 
==4256==ABORTING

@newbluemoon
Copy link
Contributor Author

A fix for the failing test was merged upstream, I added it as a patch, because there is no new release with it, yet.
There is also a newer version 1.5, but it seems to be a development one so I left it at 1.4.2.

Comment on lines +1 to +2
Prevent synfig from filtering out the compiler’s '-g' option to produce debug
information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this has a chance of being upstreamed? It's really unfortunate that we have to carry a patch at all :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can try! :) I’ll ask upstream.

# uses synfig to create some icons
hostmakedepends+=" synfig"
fi
export DATADIRNAME=share
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If synfigstudio needed this, chances are so does synfig. Both install locale files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll have a look into it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I haven’t forgotten about it but just didn’t get to it. Something else came always up. ;) I’ll try to checkit today or tomorrow.

And regarding upstreaming the patch to not filter out the -g option: I asked upstream, but got no answer so far.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries :)
Just making sure it isn't lost.

Copy link
Contributor Author

@newbluemoon newbluemoon Nov 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my system synfig shows it’s messages according to my locale and the build log shows
-DLOCALEDIR=\"/usr/share/locale\".
So exporting DATADIRNAME doesn’t seem to be necessary.

Edit:
While synfig’s configure just has localedir="$datadir/locale"
synfigstudio uses LOCALEDIR=${prefix}/${DATADIRNAME}/locale which breaks things.
So I think it’s good to go.

@newbluemoon
Copy link
Contributor Author

newbluemoon commented Nov 15, 2021

Added libmagick-devel to synfig’s makedepends or else it’s module mod_magickpp isn’t built anymore. synfigstudio needs it then, too.

@ericonr ericonr merged commit b2caf68 into void-linux:master Nov 16, 2021
@newbluemoon newbluemoon deleted the synfig branch November 16, 2021 16:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants