Project

General

Profile

Actions

Bug #6292

closed

"static _thread" buffer crash of osmo-bts-sysmo on symoBTS 1002

Added by jolly 5 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
-
Target version:
-
Start date:
12/06/2023
Due date:
% Done:

100%

Spec Reference:

Description

osmo-bts running on Sysmo-BTS hardware causes a crash when executing osmo_str_tolower() from libosmocore.

osmo_str_tolower() stores the return value in a static string declared as this:

static __thread char capsbuf[128];

When removing "__thread" keyword and installing this changed libosmocore to Sysmo-BTS, the function above does not fail.

To reproduce this error, add "gsmtap-sapi enable-all" below "bts 0" in config file and execute "show run" at VTY.


Files

segfault.txt segfault.txt 8.61 KB jolly, 12/07/2023 09:00 AM

Related issues

Related to libosmocore - Bug #4062: vty tests fails on arm (raspberry pi)Resolvedpespin06/16/2019

Actions
Related to libosmocore - Bug #5079: osmo_str_tolower() segfaults on sysmoBTS (arm-poky-linux-gnueabi)Resolvedfixeria03/17/2021

Actions
Actions #1

Updated by laforge 5 months ago

oh my. I think I recall some problems in the past where we were hitting
gcc or binutils bugs related to thread-local storage on arm.

See #4062 and https://gerrit.osmocom.org/c/libosmocore/+/15037

Actions #2

Updated by laforge 5 months ago

  • Subject changed from "static _thread" buffer crash on Sysmo-BTS to "static _thread" buffer crash of osmo-bts-sysmo on symoBTS 1002
  • Assignee set to jolly
  • Priority changed from Normal to High

See also https://gerrit.osmocom.org/c/libosmocore/+/15024 which introudced that capsbuf.

In case anyone has an idea what is happening here, and why all of a sudden we see that kind of problem with years without any gcc/binutils changes of our yocto for sysmobts, please provide feedback here.

Actions #3

Updated by laforge 5 months ago

  • Related to Bug #4062: vty tests fails on arm (raspberry pi) added
Actions #4

Updated by laforge 5 months ago

  • Related to Bug #5079: osmo_str_tolower() segfaults on sysmoBTS (arm-poky-linux-gnueabi) added
Actions #5

Updated by laforge 5 months ago

In fact #5079 is likely the solution. We are actually defining __thread to NULL when building on that platform - I wonder how you ended up with it enabled?

Actions #6

Updated by jolly 5 months ago

When I cross compile without "--disable-detect-tls-gcc-arm-bug" at configure, linker gets a segmentation fault. That's why I always used that option. See attachment.

Actions #7

Updated by jolly 5 months ago

  • Status changed from New to Resolved
  • Priority changed from High to Low
  • % Done changed from 0 to 100

I resolved it by installing the nightly build libraries. But still I can't compile it without "--disable-detect-tls-gcc-arm-bug".

Actions #8

Updated by laforge 5 months ago

On Fri, Dec 08, 2023 at 10:56:38AM +0000, jolly wrote:

I resolved it by installing the nightly build libraries. But still I can't compile it without "--disable-detect-tls-gcc-arm-bug".

can you not do exactly what we do when we build the programs in the first place?
https://gitea.osmocom.org/cellular-infrastructure/meta-telephony/src/commit/4886ef55ea741a8ce8891702b2a620cae3e3d5cf/recipes-osmocom/libosmocore/libosmocore_git.bb#L29
points to
https://gitea.sysmocom.de/sysmo-bts/meta-sysmocom-bsp/src/branch/201705/recipes-sysmobts/libosmocore/libosmocore_git.bbappend

Actions #9

Updated by jolly 5 months ago

Yes, removing the __thread attributes works for me.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)