Ticket #1036 (reopened defect)

Opened 5 years ago

Last modified 5 years ago

[REGRESSION TESTCASE] Format detection called on deleted objects

Reported by: Graham Cobb Owned by: dgollub
Priority: normal Milestone: OpenSync 0.40
Component: OpenSync: Testsuite Version: 0.38
Severity: normal Keywords:
Cc:

Description

I sync from GPE to filesync and create some files. Then I delete one of the files and try the sync.

The following error is logged:

GLib-CRITICAL **: g_pattern_match_simple: assertion `string != NULL' failed

The problem is that detect_plain_as_xmlformat_contact is being called with data and size as 0, presumably for the change report for the deleted file.

It is not clear to me if this is an xmlformat bug (it should handle the detector being called with a NULL pointer) or an engine bug. It seems like an engine bug: what is a format detector supposed to do if passed no data?

Note that vformat, xmlformat and xmlformat-doc are all installed during this test.

Attachments

opensync_engine.patch (819 bytes) - added by Graham Cobb 5 years ago.
Patch to not detect format of DELETED changes

Change History

Changed 5 years ago by Graham Cobb

Patch to not detect format of DELETED changes

comment:1 Changed 5 years ago by Graham Cobb

I propose the attached patch.

comment:2 Changed 5 years ago by dgollub

  • Status changed from new to closed
  • Resolution set to fixed

Slightly modified with r5145.

Since detect function didn't provide a very helpful error-handling. Since we would need to check always for osync_error_set(). Changed the API - and also protected the function to not call any detection when there is no data provided by the caller.

In the engine we avoid this call at all, by determine the ChangeType?, like you have done in your original patch!

Thanks for finding and fixing this!

comment:3 Changed 5 years ago by dgollub

  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Summary changed from Format detection called on deleted objects to [REGRESSION TESTCASE] Format detection called on deleted objects

Reopened - we need for this a regression testcase.

Instrument mockformat's detect function and fail if detect get called and the instrumentation environment variable got set.

comment:4 Changed 5 years ago by dgollub

  • Component changed from OpenSync to OpenSync: Testsuite
Note: See TracTickets for help on using tickets.