Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aper: Fix printf formatting on 32bit archs #101

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

pespin
Copy link

@pespin pespin commented Jul 18, 2022

No description provided.

@mouse07410
Copy link
Owner

I think we tried something like this a while ago, and people complained because it presumably broke something...

I'll give this PR a little time for others to try, and since it seems to pass the CI, merge it - unless there are complaints.

@mouse07410
Copy link
Owner

@pespin it's not related to this PR - but would you be able to take a look at #103 and maybe figure why it fails the tests? Does it look like a minor thing, or that PR really breaks the ASN.1 compiler?

@pespin
Copy link
Author

pespin commented Jul 19, 2022

Hi, Regarding this PR, I tested it in both x86_64 and armv7l (raspbian, 32bit) and it seems to be working fine on both and removing tons of warnings in the later.
I'm waiting for this to be merged in order to incorporate it to osmo-cbc. Hopefully that fixes the segfault I'm seeing in osmo-cbc unit test when encoding SBc-AP with asn1c (only happening in 32 bit arm in OBS, not happening when I compile manually in a rpi with raspbian...).
So I hope his gets merged soon.

https://obs.osmocom.org/package/live_build_log/osmocom:nightly/osmo-cbc/Raspbian_10/armv7l

[  508s] stderr:
[  508s] Encoding "SBC-AP-PDU" using ALIGNED PER
[  508s] Encoding SBC-AP-PDU as CHOICE using ALIGNED PER
[  508s] Encoding SBC-AP-PDU CHOICE element 0
[  508s] [PER put 1 bits 0 to 0xfff8c8b0+0 bits]
[  508s] [PER out 1 0/0 (t=0,o=1) 32&0=0]
[  508s] [PER out 0/0 => 00 buf+0]
[  508s] [PER put 2 bits 0 to 0xfff8c8b0+1 bits]
[  508s] [PER out 2 0/0 (t=1,o=3) 0&80=0]
[  508s] [PER out 0/0 => 00 buf+0]
[  508s] Encoding InitiatingMessage as SEQUENCE (APER)
[  508s] first_extension = -1, elements = 3
[  508s] About to encode ProcedureCode
[  508s] Encoding InitiatingMessage->procedureCode
[  508s] Encoding NativeInteger ProcedureCode 0 (APER)
[  508s] Value 0 (00/1) lb 0 ub 0 (null)
[  508s] Encoding integer 0 (0) with range 0 bits
[  508s] Aligning 5 bits
[  508s] [PER put 5 bits 0 to 0xfff8c8b0+3 bits]
[  508s] [PER out 5 0/0 (t=3,o=8) 0&e0=0]
[  508s] [PER out 0/0 => 00 buf+0]
[  508s] [PER put 8 bits 0 to 0xfff8c8b0+8 bits]
[  508s] [PER out 8 0/0 (t=0,o=8) 0&0=0]
[  508s] [PER out 0/0 => 00 buf+1]
[  508s] Freeing INTEGER as a primitive type
[  508s] About to encode Criticality
[  508s] Encoding InitiatingMessage->criticality
[  508s] Encoding Criticality as NativeEnumerated
[  508s] [PER put 2 bits 0 to 0xfff8c8b1+8 bits]
[  508s] [PER out 2 0/0 (t=0,o=2) 0&0=0]
[  508s] [PER out 0/0 => 00 buf+2]
[  508s] About to encode value
[  508s] Encoding InitiatingMessage->value
[  508s] Encoding value OPEN TYPE element 0
[  508s] Open type put Write-Replace-Warning-Request ...
[  508s] Encoding Write-Replace-Warning-Request as SEQUENCE (APER)
[  508s] [PER put 1 bits 0 to 0xfff8c678+0 bits]
[  508s] [PER out 1 0/0 (t=0,o=1) d4&0=0]
[  508s] [PER out 0/0 => 00 buf+0]
[  508s] Element ptr wtv Write-Replace-Warning-Request->protocolExtensions is absent
[  508s] [PER put 1 bits 0 to 0xfff8c678+1 bits]
[  508s] [PER out 1 0/0 (t=1,o=2) 0&80=0]
[  508s] [PER out 0/0 => 00 buf+0]
[  508s] first_extension = 2, elements = 2
[  508s] About to encode ProtocolIE-Container
[  508s] Encoding Write-Replace-Warning-Request->protocolIEs
[  508s] Encoding ProtocolIE-Container as SEQUENCE OF size (8) using ALIGNED PER
[  508s] /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/1/test-source: line 14: 61396 Segmentation fault      (core dumped) $abs_top_builddir/tests/sbcap/sbcap_test

@mouse07410 mouse07410 merged commit 23751fc into mouse07410:vlm_master Jul 19, 2022
@pespin pespin deleted the pespin/fix-aper32 branch July 19, 2022 13:16
@pespin
Copy link
Author

pespin commented Jul 20, 2022

FYI, this PR seems to have fixed the crash above on 32bit armv7l raspbian 10.

@mouse07410
Copy link
Owner

mouse07410 commented Jul 20, 2022

Good! Which issue does this PR fix (so I can close it)?

@pespin
Copy link
Author

pespin commented Jul 20, 2022

no associated ticket, I was tracking this crash internally ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants