Bug 1339 - g_variant_unref() assertion failures when using sigrok-cli with the "-O analog" option
Summary: g_variant_unref() assertion failures when using sigrok-cli with the "-O analo...
Status: CONFIRMED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Output: analog (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Low minor
Target Milestone: ---
Assignee: Guido Trentalancia
URL: https://github.com/sigrokproject/libs...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-08 02:46 CET by Guido Trentalancia
Modified: 2018-12-08 02:49 CET (History)
1 user (show)



Attachments
Proposed patch (16.55 KB, patch)
2018-12-08 02:46 CET, Guido Trentalancia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Trentalancia 2018-12-08 02:46:28 CET
Created attachment 501 [details]
Proposed patch

Currently, if the analog output module is explicitly requested in sigrok-cli using the "-O analog" option, the program does not exit cleanly and instead it produces a g_variant_unref() assertion failure.

This is because sigrok-cli attempts to clean the analog output module twice: sr_output_free() is called twice in session.c.

The proposed patch makes sure that the analog output module is not cleaned up more than once, even if the sr_output_free() function is called more than once. The same check is applied to the other output modules for consistency.

A few GVariant instances are also properly unreferenced in other output modules by the proposed patch, so that the memory is freed.

This bug is fixed here:

https://github.com/sigrokproject/libsigrok/pull/17/commits/435e369246de6d3534fe6df25ecf386d3fa62c07