Bug 1971676

Summary: ECalBackendFile: Free interval tree only when being allocated
Product: Red Hat Enterprise Linux 8 Reporter: Yaniv Ferszt <yferszt>
Component: evolution-data-serverAssignee: Milan Crha <mcrha>
Status: CLOSED ERRATA QA Contact: Michal Odehnal <modehnal>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.4CC: mcrha, modehnal, sbarcomb, tpopela
Target Milestone: betaKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: evolution-data-server-3.28.5-17.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 17:54:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yaniv Ferszt 2021-06-14 14:25:06 UTC
Description of problem:
On a fresh installed RHEL 8.4 with GUI. A logout prints the following to the system log:
---------------
Jun 14 13:53:26 example.lab.example.com evolution-calen[10189]: e_intervaltree_destroy: assertion 'E_IS_INTERVALTREE (tree)' failed
---------------

Version-Release number of selected component (if applicable):
# rpm -qa| grep -i "evolution"
evolution-data-server-langpacks-3.28.5-15.el8.noarch
evolution-data-server-3.28.5-15.el8.x86_64


How reproducible:
Installed RHEL 8.4 with GUI. Login & logout. Check system logs



Steps to Reproduce:
1. Fresh installed RHEL 8.4 with GUI
2. Login to the GUI
3. Logout
4. Check "/var/log/messages"

Actual results:
GUI Logout prints at "/var/log/messages"
---------------
Jun 14 13:53:26 example.lab.example.com evolution-calen[10189]: e_intervaltree_destroy: assertion 'E_IS_INTERVALTREE (tree)' failed
---------------


Expected results:
This message not being printed in the log.

Comment 2 Milan Crha 2021-06-14 15:05:11 UTC
Thanks for a bug report. I've a fresh RHEL 8 installation and it doesn't print any such message in the system log. I suppose it depends what calendars, memo lists and/or task lists are configured. I have only those default, On This Computer/Personal.

Comment 10 Milan Crha 2021-06-16 13:25:03 UTC
I get this at step 4):

> Active Subscription Required
> 
> You will need an active subscription before you can download this software.

I applied for the evaluation (Try It) which let me move forward.

The SHA256 sum matches. But I did not see the message. I did not use ssh, but it might not matter, as I used the text console (Ctrl+Alt+F3).

Finally, I disabled libvirtd services (they blocked the internet connection for the machine for me), rebooted and logged in as my new user, then logged out and viola, the runtime warning was there.

I can see the warning also when I `kill -TERM `pidof evolution-calendar-factory` `, no need to login/out to get it. I'll investigate this further and let you know.

Comment 11 Milan Crha 2021-06-16 13:49:49 UTC
This is the place:

#0  e_intervaltree_destroy (tree=0x0)
    at /usr/src/debug/evolution-data-server-3.28.5-15.el8.x86_64/src/calendar/libedata-cal/e-cal-backend-intervaltree.c:735
#1  0x00007f6514e10c1d in free_calendar_data (cbfile=<optimized out>)
    at /usr/src/debug/evolution-data-server-3.28.5-15.el8.x86_64/src/calendar/backends/file/e-cal-backend-file.c:301
#2  0x00007f6514e147fb in e_cal_backend_file_dispose (object=0x56552fa883a0)
    at /usr/src/debug/evolution-data-server-3.28.5-15.el8.x86_64/src/calendar/backends/file/e-cal-backend-file.c:331
#3  0x00007f6533148868 in g_object_unref () from /lib64/libgobject-2.0.so.0
#4  0x00007f6532e5555f in g_hash_table_remove_all_nodes.part ()
   from /lib64/libglib-2.0.so.0
#5  0x00007f6532e56468 in g_hash_table_remove_all ()
   from /lib64/libglib-2.0.so.0
#6  0x00007f653121608a in subprocess_factory_dispose (object=0x56552fa37470)
    at /usr/src/debug/evolution-data-server-3.28.5-15.el8.x86_64/src/libebackend/e-subprocess-factory.c:125
#7  0x00007f6533148868 in g_object_unref () from /lib64/libgobject-2.0.so.0
#8  0x000056552e639fcf in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/evolution-data-server-3.28.5-15.el8.x86_64/src/calendar/libedata-cal/evolution-calendar-factory-subprocess.c:226


It shows the `tree` is NULL, thus not allocated yet. I'll handle this on the file backend.

Comment 12 Milan Crha 2021-06-16 14:03:16 UTC
Fixed upstream [1] for 3.41.1+ and 3.40.3+.

The On This Computer/Personal task list did not load properly, which leads to this issue on the calendar factory close. The function is called from a dispose(), which can be called several times, thus it makes sense to fix it also upstream.

[1] https://gitlab.gnome.org/GNOME/evolution-data-server/-/commit/057b57ca1

Comment 15 Michal Odehnal 2021-06-22 06:52:13 UTC
All tests were executed with the new version installed and a full pass as a result. Switching to Verified:Tested.

Comment 20 errata-xmlrpc 2021-11-09 17:54:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (evolution, evolution-data-server, evolution-ews bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4180