subzero
subzero copied to clipboard
see-stdioesock-serve failing when running subzero
@alokmenghrajani any idea what would be causing this?
cc @lacombar
% /opt/nfast/bin/see-stdioesock-serv --machine subzero-unsigned.ar --userdata-raw userdata.cpio --trace
nC SEE bsdlib machine booting
AF_UNIX bound to hardserver emulation.
Hardserver IO thread started.
AF_UNIX using hardserver emulation for /opt/nfast/sockets/nserver
/proc mounted.
SEE job device IO thread started.
bsdsee nshield (12.63.0-63-43553d3)
ncseevfs_hostcall_open( "/dev/seejobs/6e432f48432f7374646f6520", ... )
setup provision /dev/seejobs/6e432f48432f7374646f6520 hostcall
:outstand_want = 4
:outstand_max = 8
allocate 100 spare tags
spare tags ready
provision /dev/seejobs/6e432f48432f7374646f6520 hostcall ready
/dev/seejobs/ job with unhandled prefix
!!jobs=1 0ctrl [6e432f48432f7374646f6520]
job starts [6e432f48432f737464696f65]...
*** abort() called
Are you using the USB-PCI adapter?
Also, are you able to start/test any of the other sample apps provided by nCipher? This seems to be failing super early (probably before any of our code gets called).
Did you figure this out?
Short story: Yes, we did.
Long story: The problem lied with the newer version of the HSM/CodeSafe SDK we are using. They added a compile-time plugin system which enables features on a need-to basis. Compile-time features are expected to match against a specific runtime environment. Features combinations are socket-only
, std{out,err}
, std{in,out,err}
or std{in,out,err}+socket
. We were linking against the std{out,err} library (as the provided examples all do!) and tried to run against the std{in,out,err}+socket
environment, thus the failure. Figuring out the right library to use was a bit tricky as it is burried in the SDK subdirectories :-)
Also, in the std{out,err}
environment, calls to socket(2)
would completely fail. Linking against the right library fixed the socket initialization issues we were facing in my original port.
It is a known issue that 12.63.0 and newer don't work. As a result (and it's in the docs), we are using CodeSafe-linux64-dev-12.50.2.iso and firmware 12.50.11.
If you got things running on a newer SDK, we would appreciate if you could share any changes you made. This might even allow is to make a release sooner than planned (https://subzero.readthedocs.io/en/master/releases/ lists 2020Q4 as our next planned release).