intel / pcm

Intel® Performance Counter Monitor (Intel® PCM)
BSD 3-Clause "New" or "Revised" License
2.82k stars 476 forks source link

Docker image - error loading shared libraries libasan.so.8 #875

Closed charliekang closed 1 week ago

charliekang commented 1 week ago

Error: /usr/local/bin/pcm-sensor-server: error while loading shared libraries: libasan.so.8: cannot open shared object file: No such file or directory

Tested with current image:

https://hub.docker.com/layers/opcm/pcm/latest/images/sha256-e9839d2c70c9bdf9509ed904fac07b95781ac1142a056ee3cd3f9aff72a7cc3c?context=explore

Tested manually building Dockerfile:

https://github.com/intel/pcm/commit/9a219bb8e60144e706ca9455e7bfe6dace37432b

Executing latest image 

# docker run -d --name pcm --privileged -p 9738:9738 opcm/pcm:latest
Unable to find image 'opcm/pcm:latest' locally
latest: Pulling from opcm/pcm
f7bb57d05c2a: Already exists
414cc86bbb80: Pull complete
Digest: sha256:b6eb72c31cdba9443df2db58e6e19c9ae0e6fa3ac9369cc0ed1de76b19577b41
Status: Downloaded newer image for opcm/pcm:latest
59db5504889837b0f739c752b1237310c94c080cf341de239df63d535ca05345

# docker logs 59db550
/usr/local/bin/pcm-sensor-server: error while loading shared libraries: libasan.so.8: cannot open shared object file: No such file or directory

Workaround: From the latest changes it appears libasan should be static? Not dynamically linked?

Modified dockefile to add libasan pkg

Dockerfile

FROM fedora:40@sha256:b7b4b222c2a433e831c006a49a397009640cc30e097824410a35b160be4a176b AS builder
# Dockerfile for Intel PCM sensor server
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2020-2024 Intel Corporation

RUN dnf -y install gcc-c++ git findutils make cmake openssl openssl-devel libasan libasan-static
COPY . /tmp/pcm
RUN cd /tmp/pcm && mkdir build && cd build && cmake .. && make -j

FROM fedora:40@sha256:b7b4b222c2a433e831c006a49a397009640cc30e097824410a35b160be4a176b
COPY --from=builder /tmp/pcm/build/bin/* /usr/local/bin/

>>> RUN dnf -y install libasan

ENV PCM_NO_PERF=1

ENTRYPOINT [ "/usr/local/bin/pcm-sensor-server", "-p", "9738", "-r" ]
rdementi commented 1 week ago

thank you for reporting this issue. I have pushed a fix (https://github.com/intel/pcm/pull/876). Does it work for you?

charliekang commented 1 week ago

Can I close this issue? Or is there a separate process for handling issues?

Issue is fixed with #876 and latest docker image validates


# docker run -d --name pcm --privileged -p 9738:9738 opcm/pcm:latest
Unable to find image 'opcm/pcm:latest' locally
latest: Pulling from opcm/pcm
f7bb57d05c2a: Already exists
00b9fd8c1fac: Pull complete
Digest: sha256:917a0b52e5f22758caef14666be96c0329925ef9a7f30e59ea1ad025e25bd104
Status: Downloaded newer image for opcm/pcm:latest
5e4589f9604cabd48c585b9f24de1b7a2e735b7f05a2f44f85d8c1ba8a6b770d
root@jftel89:~#
root@jftel89:~#
root@jftel89:~#
root@jftel89:~# docker logs pcm

=====  Processor information  =====
Linux arch_perfmon flag  : yes
Hybrid processor         : no
IBRS and IBPB supported  : yes
rdementi commented 1 week ago

Thanks for testing! You can close the issue or I can do it