Problems with compiling version 9.4 on Fedora 27

Get help for specific problems
Posts: 348
Joined: 7 Jan 2018

bgstack15

I have been struggling with compiling FreeFileSync 9.4 from source. I started on this version before 9.6 came out, and didn't want to change mid-stream. I'll try 9.6 eventually, though, don't worry.

I can compile the application and execute it. Most of the time, it segfaults and dumps the core (haven't found where yet). I finally learned enough about gdb to get some output.
**
Gtk:ERROR:gtkicontheme.c:4024:proxy_pixbuf_destroy: assertion failed: (icon_info->proxy_pixbuf != NULL)

Thread 8 "Icon Buffer Wor" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffcf163700 (LWP 10133)]
0x00007ffff227169b in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install <TRUNCATED...>
Another execution of the same binary produced this output in strace, but this looks like a different message.
futex(0x2b495c8, FUTEX_WAKE_PRIVATE, 2147483647) = 1
openat(AT_FDCWD, "/usr/share/icons/Numix/24/mimetypes/application-vnd.openxmlformats-officedocument.wordprocessingml.document.svg", O_RDONLY) = 10
fstat(10, {st_mode=S_IFREG|0644, st_size=1045, ...}) = 0
read(10, "<svg xmlns=\"http:/www.w3.org/20"..., 65536) = 1045
read(10, "", 65536)                     = 0
close(10)                               = 0
futex(0x2b495cc, FUTEX_WAKE_PRIVATE, 2147483647) = 1
futex(0x7fae2f0ab218, FUTEX_WAKE_PRIVATE, 1) = 0
getpeername(2, 0x7ffd794a85f0, [128])   = -1 ENOTSOCK (Socket operation on non-socket)
futex(0x7fae2ee57e88, FUTEX_WAKE_PRIVATE, 2147483647) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
getpid()                                = 8750
write(2, "\n(FreeFileSync:8750): GLib-GObje"..., 116
(FreeFileSync:8750): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
) = 116
futex(0x2b495c8, FUTEX_WAKE_PRIVATE, 2147483647) = ?
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)
I will keep investigating this issue on my own, but if anyone can help me figure out how to get the application to maybe use a generic icon or otherwise side-step this proxy_pixbuf NULL issue, that would be fantastic! I know nothing about C++ yet so am learning everything as I go.

Attached is my patch so far from the 9.4 base code. I should mention I use gtk3 as do others on this forum. I
Web references available in my next post (no links, to minimize spam according to the notice)
You do not have the required permissions to view the files attached to this post.
Posts: 348
Joined: 7 Jan 2018

bgstack15

I observed that the file I mentioned in the strace output, when it segfaulted, is a symlink. I wonder if that is the cause of the problem.

I am now compiling FreeFileSync 9.7, released a few days ago. I am still compiling on gcc 7.2.1.2.fc27.x86_64 against gtk3.

Somehow, when I package the utility up in an rpm, the built file includes the debug info. I'm still trying to figure out the flags passed to gcc (maybe -g or -Og or something like that [cf. https://www.ostechnix.com/compile-run-c-c-programs-linux/]).

I was able to get a full backtrace from gdb, when debugging that packaged up binary:
#0  0x00007ffff4cef480 in proxy_pixbuf_destroy () at /lib64/libgtk-3.so.0
#1  0x00007ffff3a38f44 in gdk_pixbuf_finalize () at /lib64/libgdk_pixbuf-2.0.so.0
#2  0x00007ffff3458689 in g_object_unref () at /lib64/libgobject-2.0.so.0
#3  0x000055555577bb3a in (anonymous namespace)::<lambda()>::operator() (__closure=<synthetic pointer>) at lib/icon_loader.cpp:87
#4  0x000055555577bb3a in zen::runScopeGuardDestructor<(anonymous namespace)::imageHolderFromGicon(GIcon*, int)::<lambda()> > (fun=<synthetic pointer>...)
    at ../../zen/scope_guard.h:58
#5  0x000055555577bb3a in zen::ScopeGuard<(zen::ScopeGuardRunMode)0, (anonymous namespace)::imageHolderFromGicon(GIcon*, int)::<lambda()> >::~ScopeGuard (this=<synthetic pointer>, __in_chrg=<optimized out>) at ../../zen/scope_guard.h:96
#6  0x000055555577bb3a in (anonymous namespace)::imageHolderFromGicon(GIcon*, int) (gicon=gicon@entry=0x555556128120, pixelSize=pixelSize@entry=24) at lib/icon_loader.cpp:87
#7  0x000055555577bd75 in zen::genericFileIcon(int) (pixelSize=24) at lib/icon_loader.cpp:122
#8  0x0000555555776407 in zen::IconBuffer::genericFileIcon(zen::IconBuffer::IconSize) (sz=sz@entry=zen::IconBuffer::SIZE_SMALL) at lib/icon_buffer.cpp:412
#9  0x0000555555709ea7 in MainDialog::MainDialog(zen::Zbase<char, zen::DefaultStoragePolicy> const&, xmlAccess::XmlGuiConfig const&, std::vector<zen::Zbase<char, zen::DefaultStoragePolicy>, std::allocator<zen::Zbase<char, zen::DefaultStoragePolicy> > > const&, xmlAccess::XmlGlobalSettings const&, bool) (this=0x555555e02e00, globalConfigFilePath=..., guiCfg=..., referenceFiles=std::vector of length 1, capacity 1 = {...}, globalSettings=..., startComparison=<optimized out>) at ui/main_dlg.cpp:564
#10 0x000055555570c906 in MainDialog::create(zen::Zbase<char, zen::DefaultStoragePolicy> const&, xmlAccess::XmlGlobalSettings const*, xmlAccess::XmlGuiConfig const&, std::vector<zen::Zbase<char, zen::DefaultStoragePolicy>, std::allocator<zen::Zbase<char, zen::DefaultStoragePolicy> > > const&, bool) (globalConfigFilePath=..., globalSettings=globalSettings@entry=0x7fffffffd030, guiCfg=..., referenceFiles=std::vector of length 1, capacity 1 = {...}, startComparison=startComparison@entry=false) at ui/main_dlg.cpp:387
#11 0x000055555570cf6c in MainDialog::create(zen::Zbase<char, zen::DefaultStoragePolicy> const&) (globalConfigFilePath=...) at ui/main_dlg.cpp:364
#12 0x00005555555ed2b9 in runGuiMode(zen::Zbase<char, zen::DefaultStoragePolicy> const&) (globalConfigFilePath=...) at application.cpp:461
#13 0x00005555555ed2b9 in Application::launch(std::vector<zen::Zbase<char, zen::DefaultStoragePolicy>, std::allocator<zen::Zbase<char, zen::DefaultStoragePolicy> > > const&) (this=0x555555b20470, commandArgs=std::vector of length 0, capacity 0) at application.cpp:365
#14 0x00005555555ee598 in Application::onEnterEventLoop(wxEvent&) (this=0x555555b20470, event=...) at application.cpp:100
#15 0x00007ffff5e3471a in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#16 0x00007ffff5e34b2a in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#17 0x00007ffff5e34bbf in wxEvtHandler::TryHereOnly(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#18 0x00007ffff5e34c73 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#19 0x00007ffff5e34cd5 in wxEvtHandler::ProcessEvent(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#20 0x00007ffff5e35e02 in wxEvtHandler::ProcessPendingEvents() () at /lib64/libwx_baseu-3.0.so.0
#21 0x00007ffff5cbc7b7 in wxAppConsoleBase::ProcessPendingEvents() () at /lib64/libwx_baseu-3.0.so.0
#22 0x00007ffff67812dd in wxApp::DoIdle() () at /lib64/libwx_gtk3u_core-3.0.so.0
#23 0x00007ffff6781403 in wxapp_idle_callback () at /lib64/libwx_gtk3u_core-3.0.so.0
#24 0x00007ffff3177597 in g_idle_dispatch () at /lib64/libglib-2.0.so.0
#25 0x00007ffff317abb7 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#26 0x00007ffff317af60 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#27 0x00007ffff317b272 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#28 0x00007ffff4d25ca5 in gtk_main () at /lib64/libgtk-3.so.0
#29 0x00007ffff679f8a5 in wxGUIEventLoop::DoRun() () at /lib64/libwx_gtk3u_core-3.0.so.0
#30 0x00007ffff5cf5ea3 in wxEventLoopBase::Run() () at /lib64/libwx_baseu-3.0.so.0
#31 0x00007ffff5cbdea6 in wxAppConsoleBase::MainLoop() () at /lib64/libwx_baseu-3.0.so.0
#32 0x00005555555ead2b in Application::OnRun() (this=0x555555b20470) at application.cpp:110
#33 0x00007ffff5d463e7 in wxEntry(int&, wchar_t**) () at /lib64/libwx_baseu-3.0.so.0
#34 0x00005555555ce5b8 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at application.cpp:32
So I pulled up file lib/icon_loader.cpp:87 from the FreeFileSync tree.
ImageHolder imageHolderFromGicon(GIcon* gicon, int pixelSize)
{
    if (gicon)
        if (GtkIconTheme* defaultTheme = ::gtk_icon_theme_get_default()) //not owned!
            if (GtkIconInfo* iconInfo = ::gtk_icon_theme_lookup_by_gicon(defaultTheme, gicon, pixelSize, GTK_ICON_LOOKUP_USE_BUILTIN)) //this may fail if icon is not installed on system
            {
                ZEN_ON_SCOPE_EXIT(::gtk_icon_info_free(iconInfo));
                if (GdkPixbuf* pixBuf = ::gtk_icon_info_load_icon(iconInfo, nullptr))
                {
                    ZEN_ON_SCOPE_EXIT(::g_object_unref(pixBuf)); //superseedes "::gdk_pixbuf_unref"!
                    return copyToImageHolder(pixBuf);
                }
            }
    return ImageHolder();
}
Line 87 is the one with the misspelled "superseedes" comment. Can you guys help me step through this backtrace and see if there's something we can modify or add a try-catch block around?