Skip to content

Commit 6bbbde3

Browse files
andrewjcgfacebook-github-bot
authored andcommitted
Add a libFollySegFault.so convenience lib
Summary: As per glibc's `libSegFault.so`, provide a standalone DSO that non-fbcode binaries can `LD_PRELOAD` to get symbolification via folly's symbolizer on signals/crashes. Reviewed By: mzlee Differential Revision: D52861325 fbshipit-source-id: f26329a431ae1abeb0aba208c2d3fce6a84b080a
1 parent 0777795 commit 6bbbde3

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include <folly/experimental/symbolizer/SignalHandler.h>
18+
19+
static void __attribute__((constructor)) install_handler(void) {
20+
folly::symbolizer::installFatalSignalHandler();
21+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
/* We don't export anything, since our constructor does all the work. */
3+
local: *;
4+
};

0 commit comments

Comments
 (0)