Project

General

Profile

Actions

Bug #5237

closed

osmo-bts-omldummy segfaults upon connecting to BSC

Added by neels 3 months ago. Updated 2 months ago.

Status:
Resolved
Priority:
Immediate
Assignee:
Category:
-
Target version:
-
Start date:
09/23/2021
Due date:
% Done:

100%

Spec Reference:

Description

Trying to hack on BSC_Tests using SCCPlite, I found that osmo-bts-omldummy segfaults upon connecting to the BSC.

<0012> ../../../src/libosmo-abis/src/input/ipaccess.c:898 received ID_GET for unit ID 1234/0/0

Program received signal SIGSEGV, Segmentation fault.
0x00005555555851d2 in st_op_disabled_notinstalled (fi=0x5555555df660, event=0, data=0x0) at ../../../../src/osmo-bts/src/common/nm_bts_fsm.c:80
80                struct phy_link *plink = pinst->phy_link;
(gdb) bt
#0  0x00005555555851d2 in st_op_disabled_notinstalled (fi=0x5555555df660, event=0, data=0x0) at ../../../../src/osmo-bts/src/common/nm_bts_fsm.c:80

details follow...


Files

osmo-bsc.cfg osmo-bsc.cfg 9.74 KB neels, 09/23/2021 07:21 PM
BSC_Tests.cfg BSC_Tests.cfg 793 Bytes neels, 09/23/2021 07:21 PM
Actions #1

Updated by neels 3 months ago

▶ gdb --args osmo-bts-omldummy 127.0.0.1 1234 1
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from osmo-bts-omldummy...done.
(gdb) run
Starting program: /usr/local/bin/osmo-bts-omldummy 127.0.0.1 1234 1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
<000d> ../../../../src/osmo-bts/src/common/abis.c:146 A-bis connection establishment to BSC (127.0.0.1) in progress...
<0012> ../../../src/libosmo-abis/src/input/ipaccess.c:1078 enabling ipaccess BTS mode, OML connecting to 127.0.0.1:3002
<0012> ../../../src/libosmo-abis/src/input/ipa.c:128 127.0.0.1:3002 connection done
<0012> ../../../src/libosmo-abis/src/input/ipaccess.c:898 received ID_GET for unit ID 1234/0/0

Program received signal SIGSEGV, Segmentation fault.
0x00005555555851d2 in st_op_disabled_notinstalled (fi=0x5555555df660, event=0, data=0x0) at ../../../../src/osmo-bts/src/common/nm_bts_fsm.c:80
80                struct phy_link *plink = pinst->phy_link;
(gdb) bt
#0  0x00005555555851d2 in st_op_disabled_notinstalled (fi=0x5555555df660, event=0, data=0x0) at ../../../../src/osmo-bts/src/common/nm_bts_fsm.c:80
#1  0x00007ffff7e51c93 in _osmo_fsm_inst_dispatch (fi=0x5555555df660, event=0, data=0x0, file=0x55555558d3c8 "../../../../src/osmo-bts/src/common/bts.c", line=432)
    at ../../../src/libosmocore/src/fsm.c:877
#2  0x000055555556405e in bts_link_estab (bts=0x5555555dbda0) at ../../../../src/osmo-bts/src/common/bts.c:432
#3  0x000055555555c0ad in abis_link_connected_onenter (fi=0x5555555e4520, prev_state=1) at ../../../../src/osmo-bts/src/common/abis.c:200
#4  0x00007ffff7e51420 in state_chg (fi=0x5555555e4520, new_state=2, keep_timer=false, timeout_ms=0, T=0, file=0x55555558b648 "../../../../src/osmo-bts/src/common/abis.c", 
    line=184) at ../../../src/libosmocore/src/fsm.c:699
#5  0x00007ffff7e51483 in _osmo_fsm_inst_state_chg (fi=0x5555555e4520, new_state=2, timeout_secs=0, T=0, file=0x55555558b648 "../../../../src/osmo-bts/src/common/abis.c", 
    line=184) at ../../../src/libosmocore/src/fsm.c:748
#6  0x000055555555bfd2 in abis_link_connecting (fi=0x5555555e4520, event=0, data=0x0) at ../../../../src/osmo-bts/src/common/abis.c:184
#7  0x00007ffff7e51c93 in _osmo_fsm_inst_dispatch (fi=0x5555555e4520, event=0, data=0x0, file=0x55555558b648 "../../../../src/osmo-bts/src/common/abis.c", line=370)
    at ../../../src/libosmocore/src/fsm.c:877
#8  0x000055555555c5fb in sign_link_up (unit=0x5555555d8d70, line=0x5555555e47e0, type=E1INP_SIGN_OML) at ../../../../src/osmo-bts/src/common/abis.c:370
#9  0x00007ffff7f5cc91 in ipaccess_bts_read_cb (link=0x5555555f0810, msg=0x5555555d8d70) at ../../../src/libosmo-abis/src/input/ipaccess.c:958
#10 0x00007ffff7f57f75 in ipa_client_read (link=0x5555555f0810) at ../../../src/libosmo-abis/src/input/ipa.c:72
#11 0x00007ffff7f5833c in ipa_client_fd_cb (ofd=0x5555555e4dd0, what=1) at ../../../src/libosmo-abis/src/input/ipa.c:136
#12 0x00007ffff7e4a117 in poll_disp_fds (n_fd=1) at ../../../src/libosmocore/src/select.c:361
#13 0x00007ffff7e4a20d in _osmo_select_main (polling=0) at ../../../src/libosmocore/src/select.c:393
#14 0x00007ffff7e4a22b in osmo_select_main (polling=0) at ../../../src/libosmocore/src/select.c:432
#15 0x000055555555b1a7 in main (argc=4, argv=0x7fffffffe578) at ../../../../src/osmo-bts/src/osmo-bts-omldummy/main.c:156
(gdb) 

using build from today's master branches

▶ gits do rev-parse HEAD

===== docker-playground =====
+ git -C docker-playground rev-parse HEAD
14270502f27af1f86e3475de9b78d3ac00d2edcf

===== libasn1c =====
+ git -C libasn1c rev-parse HEAD
97ae853ef5ea858de9b0bfff37adc584f966f45c

===== libosmo-abis =====
+ git -C libosmo-abis rev-parse HEAD
dd48e257ab0448d70b1caa237b57c6c2954b6e90

===== libosmo-netif =====
+ git -C libosmo-netif rev-parse HEAD
5967fa00580f07ddb428df0558e4d49aa1b7a7d1

===== libosmo-sccp =====
+ git -C libosmo-sccp rev-parse HEAD
76985a9aa2ec11b4816cc5f22153f9f451608dd2

===== libosmocore =====
+ git -C libosmocore rev-parse HEAD
ca5ce0d84966c998e353b606a7054f8bc8366cae

===== libsmpp34 =====
+ git -C libsmpp34 rev-parse HEAD
09726c1cb1ce191cb2f5a848c3feda0f57755951

===== osmo-bsc =====
+ git -C osmo-bsc rev-parse HEAD
df612507d656305d92e1bae12983af6d51ddf35c

===== osmo-bts =====
+ git -C osmo-bts rev-parse HEAD
0c44a9219762eef3d23a0d9f6ed8d4164ca5bccc

===== osmo-ci =====
+ git -C osmo-ci rev-parse HEAD
c1bdb5b9ce182652f04d9ad6b7f12eaccbf662c0

===== osmo-ggsn =====
+ git -C osmo-ggsn rev-parse HEAD
6ee5fa939a4ae3176b839f6f33f8b68b690e3ff3

===== osmo-hlr =====
+ git -C osmo-hlr rev-parse HEAD
bfeea69cab53eaac542e41e53b902e5a9899d5bd

===== osmo-iuh =====
+ git -C osmo-iuh rev-parse HEAD
1f6c117d0747e476018d64df9411c2502ce37da4

===== osmo-mgw =====
+ git -C osmo-mgw rev-parse HEAD
a0b69f189617278fb2e23fde0e92f328183109dd

===== osmo-msc =====
+ git -C osmo-msc rev-parse HEAD
4ac59538e993da911189ff2d879f535267016f62

===== osmo-pcu =====
+ git -C osmo-pcu rev-parse HEAD
ea7cb48c9c4aeb9727e25449187ef1a97bc8f5f3

===== osmo-python-tests =====
+ git -C osmo-python-tests rev-parse HEAD
be9f0bba946a6ac695bc39bc1a760dc659bc0fde

===== osmo-sgsn =====
+ git -C osmo-sgsn rev-parse HEAD
c0e146467ae2896840c836e638742d1e8fafa235

===== osmo-sip-connector =====
+ git -C osmo-sip-connector rev-parse HEAD
1c76aadeed2acbef4ee93870bfc675b6aec05788

===== osmo-smlc =====
+ git -C osmo-smlc rev-parse HEAD
44a2a85202773ae7c453c9738537e9076f5ee7dc

===== osmo-trx =====
+ git -C osmo-trx rev-parse HEAD
bb2cb9d54bf9681f07ff3fe0affc02e7b2ac047e

===== osmo-ttcn3-hacks =====
+ git -C osmo-ttcn3-hacks rev-parse HEAD
c117e8bc3a1fb49e326464d2a61854da0a1cf4a8
Actions #2

Updated by neels 3 months ago

It is not related to SCCPlite. Found the same error on AoIP tests. An earlier osmo-bts version works well.
Bisect reveals:

4ddc37ce7140e5ce6ca6cce5aeeefedc0d395d22 is the first bad commit
commit 4ddc37ce7140e5ce6ca6cce5aeeefedc0d395d22
Author: Pau Espin Pedrol <pespin@sysmocom.de>
Date:   Mon Sep 20 18:20:43 2021 +0200

    nm_bts_fsm: Make sure PHYs are opened when SW_ACTivating it

    Since recently we support shutting down phys when BTS goes into shutdown
    mode. Let's make sure they are opened again when we connect again to the
    BSC.

    Change-Id: Ia1df6f4a1e0e6daeffe7303d518776a04b023930

:040000 040000 cc449757b0dc1b4a48ca54416cd15079c7ca6b45 2107dd627bf4a7d0ac73d9e30c86a64e5645782a M    src
Actions #3

Updated by neels 3 months ago

reverting only that commit seems to work (even though 7 commits follow it)

Actions #4

Updated by neels 3 months ago

  • Assignee set to pespin
  • Priority changed from Normal to Immediate
Actions #5

Updated by neels 3 months ago

  • Subject changed from osmo-bts-omldummy segfault for SCCPlite BSC_Tests to osmo-bts-omldummy segfaults upon connecting to BSC
Actions #7

Updated by neels 3 months ago

I verified that pespin's fix works: https://gerrit.osmocom.org/c/osmo-bts/+/25565

Actions #8

Updated by pespin 2 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)