Project

General

Profile

Actions

Bug #50292

open

FMT Cmake code does not work on FreeBSD with system libfmt

Added by Willem Jan Withagen about 3 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
common
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When libfmt is installed on FreeBSD you get version 7.1.3 (at the moment of reporting this)

The problem below might be a reason to actually build with header only fmt.
That way it does not matter what version is used, there will be no possibility for a library mismatch.

This crashes several unittest-s, like:
unittest_rgw_bencode
gdb tells that the system library is being used as expected.

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000800d8b8a4 in ?? () from /usr/local/lib/libfmt.so.7
(gdb) bt
#0 0x0000000800d8b8a4 in ?? () from /usr/local/lib/libfmt.so.7
#1 0x00000008007202fd in objlist_call_init (list=<optimized out>, lockstate=<optimized out>)
at /usr/src/libexec/rtld-elf/rtld.c:2820
#2 0x000000080071f03d in _rtld (sp=0x7fffffffe8d8, exit_proc=0x7fffffffe8a0, objp=0x7fffffffe8a8)
at /usr/src/libexec/rtld-elf/rtld.c:811
#3 0x000000080071c8c9 in rtld_start () at /usr/src/libexec/rtld-elf/amd64/rtld_start.S:39
#4 0x0000000000000000 in ?? ()

I suspect it might be due to header usage of the version imported into the ceph-tree,
which conflicts with the version 7.

Removing the installed package on FreeBSD, and rebuilding, seems to fix it problem.

This is the Cmake code:
find_package(fmt 6.0.0 QUIET)
if(fmt_FOUND)
include_directories(SYSTEM "${fmt_INCLUDE_DIR}")
else()
message(STATUS "Could not find fmt, will build it")
add_subdirectory(fmt)
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/src/fmt/include")
endif()

No data to display

Actions

Also available in: Atom PDF