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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,076 Views
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

Labels (1)
Tags (2)
0 Kudos
1 Solution
1,025 Views
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

View solution in original post

3 Replies
946 Views
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 Kudos
1,051 Views
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 Kudos
1,026 Views
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