apache / incubator-gluten

Gluten is a middle layer responsible for offloading JVM-based SQL engines' execution to native engines.
https://gluten.apache.org/
Apache License 2.0
1.14k stars 415 forks source link

[VL][VCPKG] error stacktrace empty string problem when build with vcpkg #7037

Open Z1Wu opened 2 weeks ago

Z1Wu commented 2 weeks ago

Problem description

Please describe how you were trying to build velox and what issue occured

When running with gluten library build with vcpkg, exeception stacktrace threw from velox side will be empty. The problem exists in current CI pipeline:

image

The reason of empty stack is lack of libdwarf. According to the code in velox, it needs folly built with libdrawf and libelf to get symbol from address.

https://github.com/facebookincubator/velox/blob/763c19c0c767035ce03573ca2dc852b1303eeb6f/velox/common/process/StackTrace.cpp#L17-L25

https://github.com/facebookincubator/velox/blob/763c19c0c767035ce03573ca2dc852b1303eeb6f/velox/common/process/StackTrace.cpp#L158-L184

But in current vcpkg building pipeline, folly does not build with libdrawf, as we can see in folly-config.h created by cmake.

/* #undef FOLLY_HAVE_DWARF */
#define FOLLY_HAVE_ELF 1
#define FOLLY_HAVE_SWAPCONTEXT 1
#define FOLLY_HAVE_BACKTRACE 1
#define FOLLY_USE_SYMBOLIZER 1
#define FOLLY_DEMANGLE_MAX_SYMBOL_SIZE 1024

A possible fix is adding libdwarf dependency in folly vcpkg.json manifest which was removed in PR https://github.com/apache/incubator-gluten/pull/5314/files

System information

Velox System Info v0.0.2 Commit: d4d3bee96dd40d127545d513bd7a688123c2ff14 CMake Version: 3.17.5 System: Linux-3.10.0-957.el7.x86_64 Arch: x86_64 CPU Name: Model name: Intel Core Processor (Skylake, IBRS) C++ Compiler: /opt/rh/devtoolset-9/root/usr/bin/c++ C++ Compiler Version: 9.3.1 C Compiler: /opt/rh/devtoolset-9/root/usr/bin/cc C Compiler Version: 9.3.1 CMake Prefix Path: /usr/local;/usr;/;/usr;/usr/local;/usr/X11R6;/usr/pkg;/opt

CMake log

No response

zhztheplayer commented 2 weeks ago

Thanks for your findings. And AFAIK we still need to switch to e.g., RelWithDebInfo build to obtain the symbols in CI. We are using Release so far if I remember correctly.

Z1Wu commented 2 weeks ago

AFAIK, cmake build with Release does not strip .symtab section of output file. I guess velox only needs .symtab section to get the symbol of address , and doesn't need debug info. https://github.com/facebookincubator/velox/blob/763c19c0c767035ce03573ca2dc852b1303eeb6f/velox/common/process/StackTrace.cpp#L158-L184

Sample error stacktrace looks like below :

image