Project

General

Profile

Actions

Bug #3983

open

osmo_fsm_inst_change_parent() forgets to talloc reparent

Added by neels almost 5 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
libosmocore
Target version:
-
Start date:
05/07/2019
Due date:
% Done:

0%

Spec Reference:

Description

osmo_fsm_inst_alloc_child() specifically allocates the child FSM instance as a talloc child of the parent FSM instance.
However, osmo_fsm_inst_change_parent() fails to move the child FSM instance to belong to the new parent FI's talloc context.

A distinct talloc_steal() is necessary to fix the situation, for example in osmo-msc:

    osmo_fsm_inst_change_parent(cl->fi, new_parent_fi, parent_event_term);
    talloc_steal(new_parent_fi, cl->fi);

When fixing this, we need to consider previous users of libosmocore and compatibility,
so we probably need an osmo_fsm_inst_change_parent2() which also reparents, and deprecate but keep unchanged the current osmo_fsm_inst_change_parent() function.

Actions #1

Updated by laforge almost 5 years ago

On Tue, May 07, 2019 at 10:51:09PM +0000, neels [REDMINE] wrote:

When fixing this, we need to consider previous users of libosmocore and compatibility,

I think we just have to worry if any of our own existing users is
relying on that exact broken behavior. It is a fix, obviously, and we
shouldn't let compatibility deter us from
fixing bugs.

Actions #2

Updated by laforge almost 3 years ago

  • Category set to libosmocore
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)