Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library for getting stacktraces from arbitrary exceptions #147

Merged
merged 14 commits into from
Feb 7, 2024

Conversation

apolukhin
Copy link
Member

@apolukhin apolukhin commented Nov 22, 2023

No description provided.

@coveralls
Copy link

coveralls commented Dec 2, 2023

Coverage Status

coverage: 92.462% (-0.1%) from 92.573%
when pulling 9f4de7e on from-exception
into 3de5aea on develop.

@apolukhin apolukhin merged commit 0d8aed6 into develop Feb 7, 2024
6 of 9 checks passed
@apolukhin apolukhin deleted the from-exception branch February 7, 2024 08:27
@pdimov
Copy link
Member

pdimov commented Feb 7, 2024

This doesn't build on macOS

clang-darwin.compile.c++ bin.v2/libs/stacktrace/build/clang-darwin-13/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/from_exception.o
In file included from libs/stacktrace/build/../src/from_exception.cpp:10:
./boost/stacktrace/safe_dump_to.hpp:37:31: error: no type named 'size_t' in namespace 'std'; did you mean simply 'size_t'?
    BOOST_STACKTRACE_FUNCTION std::size_t from_dump(const char* filename, native_frame_ptr_t* out_frames);
                              ^~~~~~~~~~~
                              size_t

and Windows

compile-c-c++ bin.v2\libs\stacktrace\build\msvc-14.2\release\link-static\threading-multi\from_exception.obj
from_exception.cpp
.\boost/stacktrace/safe_dump_to.hpp(37): error C2039: 'size_t': is not a member of 'std'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stddef.h(23): note: see declaration of 'std'

(https://github.com/boostorg/boost/actions/runs/7812285701/job/21309026607)

Your CI seems incomplete. :-)

@pdimov
Copy link
Member

pdimov commented Feb 12, 2024

Now that this has been merged to master, it breaks the master build of Boost as well.

https://github.com/boostorg/boost/actions/runs/7863976420

@apolukhin
Copy link
Member Author

Ouch. Fixing that...

@apolukhin
Copy link
Member Author

Should be fixed in develop and master now

@pdimov
Copy link
Member

pdimov commented Feb 13, 2024

Isn't, although the errors are different this time. :-)

https://github.com/boostorg/boost/actions/runs/7876917683

clang-darwin.compile.c++ bin.v2/libs/stacktrace/build/clang-darwin-13/release/cxxstd-11-iso/link-static/threading-multi/visibility-hidden/from_exception.o
In file included from libs/stacktrace/build/../src/from_exception.cpp:10:
In file included from ./boost/stacktrace/safe_dump_to.hpp:219:
./boost/stacktrace/detail/collect_unwind.ipp:33:2: error: "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define `_GNU_SOURCE` macro or `BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED` if _Unwind_Backtrace is available without `_GNU_SOURCE`."
#error "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define `_GNU_SOURCE` macro or `BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED` if _Unwind_Backtrace is available without `_GNU_SOURCE`."
 ^
1 error generated.

on macOS, and

compile-c-c++ bin.v2\libs\stacktrace\build\msvc-14.2\release\link-static\threading-multi\from_exception.obj
from_exception.cpp
libs\stacktrace\build\..\src\from_exception.cpp(13): fatal error C1083: Cannot open include file: 'dlfcn.h': No such file or directory

on Windows.

As I said you need Mac/Windows CI. :-)

@apolukhin
Copy link
Member Author

There is a windows CI :)

windows:
strategy:
fail-fast: false
matrix:
include:
- toolset: msvc
cxxstd: "14,17,latest"
addrmd: 64
os: windows-2022
- toolset: msvc-14.2
cxxstd: "14,17,latest"
addrmd: 64
os: windows-2019

The failure is about something different. The library should not build at all at Windows, but it does. Looks like some error in my Jamfile, some b2 commands trigger the build

@pdimov
Copy link
Member

pdimov commented Feb 14, 2024

I see nothing in the build/Jamfile that would prevent the library from building on Windows.

@apolukhin
Copy link
Member Author

apolukhin commented Feb 14, 2024

Oh, it does not build in tests because the tests for that particular library are disabled on Windows. However, that does not prevents from building the library itself.

My fault, fix is coming...

apolukhin added a commit that referenced this pull request Feb 14, 2024
apolukhin added a commit that referenced this pull request Feb 15, 2024
jschueller added a commit to jschueller/stacktrace that referenced this pull request Aug 31, 2024
Fixes build on mingw where the posix/dlsym path will fail to build even if a dlfcn wrapper is provided , its simpler to just use the msvc path for all windows targets

/cc @apolukhin from boostorg#147
@jschueller jschueller mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants