Bug #6025


asn1c ASN__STACK_OVERFLOW_CHECK() fails with gcc 13 and AddressSanitizer enabled

Added by pespin 27 days ago. Updated 16 days ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


osmo-iuh unit tests (hnbap) started failing today after I upgraded by system to gcc 13.1.1 20230429.

A bit of debugging resulted in _ASN_STACK_OVERFLOW_CHECK() in our libasn1c sometimes returning an error. After disabling building with AddressSAnitizer (I usually build with --enable-sanitize), then the tests started passing.
When debugging with ASan enabled, I saw the stack pointers doing some interesting jumps in the address space (going and coming back to close values) every time a new call frame was entered.

Reading what may probably have changed, I stumbled upon :
"AddressSanitizer defaults to detect_stack_use_after_return=1 on GNU/Linux targets. For compatibility, it can be disabled with env ASAN_OPTIONS=detect_stack_use_after_return=0."

Indeed, using "export ASAN_OPTIONS=detect_stack_use_after_return=0" makes test pass again.
In any case, it was concluded that it's not a good idea to have such in-code check when building/running with ASan enabled.

Hence, I submitted a patch for our libasn1c.git to gerrit which disables the check when building with ASan:

Upstream as1nc repositories still seem to have the same issue:

So I submitted patches for both upstream repos too:

Once those are merged, we may want to use the new mouse07410 vlm_master and generate new skeletons code for osmo-cbc.git/src/sbcap/skel. I think since we generated the code there has been some extra fixes upstream.

Actions #1

Updated by pespin 27 days ago

  • Status changed from New to Feedback
  • Assignee changed from pespin to laforge

laforge it seems in order to submit a PR to GH vlm/asn1c I need to agree with a CLA:
Waiting for you on feedback on how should I submit it, not sure if that was solved already (since I so far only contributed to mouse07410/asn1c.git I think).

Actions #2

Updated by laforge 27 days ago

sysmocom has signed a corporate CLA for asn1c years ago, I'm quite sure.

Actions #3

Updated by pespin 26 days ago

  • Assignee changed from laforge to pespin

PR for has been merged.
I accepted the CLA as it was already in place for

Actions #4

Updated by pespin 16 days ago

I updated SBcAP generated code from asn1c in osmo-cbc.git with the already merged patch in upstream: sbcap: Update asn1c skeleton files


Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)