apache / apache/gluten

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

Open
#7,037 2 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
Scala
Stars
1.6k
Forks
657
Avg merge
2d 14h
Merged PRs (30d)
80

Description

### 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](https://github.com/user-attachments/assets/a9d34984-3caf-4e0f-b408-1c734b4fc595)

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_

Contributor guide

Open the contributing guide

Research direction

Start with Velox's velox/common/process/StackTrace.cpp references and inspect the folly vcpkg.json manifest used by the current build pipeline. Reproduce the vcpkg build, check the generated folly-config.h for FOLLY_HAVE_DWARF, and verify that the resulting Velox exception stacktrace is no longer empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.