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,583 次查看
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,532 次查看
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,453 次查看
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,558 次查看
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,533 次查看
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