Project

General

Profile

Actions

Bug #5377

closed

segfault when executing 'no instance' command

Added by fixeria over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
12/28/2021
Due date:
% Done:

100%

Spec Reference:

Description

We want to employ osmo-config-merge in docker-playground for generating the configuration files:

https://gerrit.osmocom.org/c/docker-playground/+/20622

however the generated osmo-bts.cfg for OML tests (see attached) provokes a segfault:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000560f15c98d3b in phy_instance_destroy ()
(gdb) bt
#0  0x0000560f15c98d3b in phy_instance_destroy ()
#1  0x0000560f15ca5447 in cfg_phy_no_inst ()
#2  0x00007fafaee29c14 in cmd_execute_command_strict () from /usr/lib/x86_64-linux-gnu/libosmovty.so.9
#3  0x00007fafaee29d98 in config_from_file () from /usr/lib/x86_64-linux-gnu/libosmovty.so.9
#4  0x00007fafaee2d221 in vty_read_config_filep () from /usr/lib/x86_64-linux-gnu/libosmovty.so.9
#5  0x00007fafaee2da1a in vty_read_config_file () from /usr/lib/x86_64-linux-gnu/libosmovty.so.9
#6  0x0000560f15c98343 in bts_main ()
#7  0x0000560f15c595d4 in main ()

Files

osmo-bts.cfg osmo-bts.cfg 2.2 KB fixeria, 12/28/2021 01:20 PM
Actions #1

Updated by fixeria over 2 years ago

I recompiled osmo-bts with "-O0 -g", and this is what I get:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000560f15c98d3b in phy_instance_destroy (pinst=0x560f16aa01a0) at phy_link.c:133
133             OSMO_ASSERT(pinst->trx->pinst == pinst);

So the problem is that pinst->trx is NULL at the moment of calling phy_instance_destroy():

(gdb) p pinst
$1 = (struct phy_instance *) 0x560f16aa01a0
(gdb) p pinst->trx
$2 = (struct gsm_bts_trx *) 0x0
Actions #2

Updated by fixeria over 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

https://gerrit.osmocom.org/c/osmo-bts/+/26692 phy_instance_destroy(): fix NULL pointer dereference [NEW]

This patch fixes the segfault, but the configuration file is still not understood correctly:

Error occurred during reading the below line:
  phy 0 instance 1

% phy0 instance 1 does not exit

Not really related to this ticket, rather a conceptual problem of osmo-config-merge.

Actions #3

Updated by fixeria over 2 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)