Building cst on Ubuntu 22.04 (gcc 11.3.0) results in a binary that gives a segmentation fault

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Building cst on Ubuntu 22.04 (gcc 11.3.0) results in a binary that gives a segmentation fault

ソリューションへジャンプ
1,295件の閲覧回数
HectorPalacios
Senior Contributor I

I'm building cst-3.3.0 using Ubuntu 22.04 with gcc 11.3.0. The resulting binary cst (which on previous versions was around 2.4MiB large) is now some Kb large:

 

 

-rwxrwxr-x 1 user user 234896 Jan 27 13:57 ./code/obj.linux64/cst
-rwxrwxr-x 1 user user 127008 Jan 27 13:57 ./release/linux64/bin/cst

 

 

When I try to use it to sign/encrypt, I get a segfault:

 

 

Install SRK
Install CSFK
Segmentation fault (core dumped)

 

 

 

Can you properly build cst with similar environment?

Thanks

Héctor

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
1,244件の閲覧回数
HectorPalacios
Senior Contributor I

Ubuntu 18.04 works fine. The problem is Ubuntu 22.04.

Apparently there is an issue with binutils (version >= 2.37) objcopy --weaken that is used by cst-tool Makefile. I could fix it with a patch to code/cst/code/build/make/rules.mk. See https://github.com/digi-embedded/meta-digi/commit/fbc92e45b3d19ca0313f80245a1d5574eb69ff3a

Regards

元の投稿で解決策を見る

3 返答(返信)
1,165件の閲覧回数
psangster
Contributor I

Wow this solution was a life saver. I was just trying to build cst 3.3.1 from source using the all of the NXP defaults along with openssl 1.1.1q on Ubuntu 22.04.2 using gcc 11.3.0. The build looks totally clean until run-time when calls are made to openssl when it SEGVs.

Beware this is a nasty bug that corrupts the dynamic linkage of the cst code to openssl's interfaces (it was BIO_s_file() in my case). All of this mess just so a dev could overload err_msg().

0 件の賞賛
返信
1,270件の閲覧回数
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Please try to use  CST (3.3.0)  with OpenSSL 1.0.2. and ubuntu 18.04

 

https://community.nxp.com/message/1316736 

 

Regards

0 件の賞賛
返信
1,245件の閲覧回数
HectorPalacios
Senior Contributor I

Ubuntu 18.04 works fine. The problem is Ubuntu 22.04.

Apparently there is an issue with binutils (version >= 2.37) objcopy --weaken that is used by cst-tool Makefile. I could fix it with a patch to code/cst/code/build/make/rules.mk. See https://github.com/digi-embedded/meta-digi/commit/fbc92e45b3d19ca0313f80245a1d5574eb69ff3a

Regards