Skip to content

Commit

Permalink
thread: do not use fortify source
Browse files Browse the repository at this point in the history
It causes problems with longjmp

    *** longjmp causes uninitialized stack frame ***: terminated
    Aborting on shard 0.
    Backtrace:

which was taken care of in the cmake build, but needs to be fixed in our
bazel build. reference: #2344

Closes #2522
  • Loading branch information
dotnwat authored and nyh committed Oct 28, 2024
1 parent 2d57e30 commit c96444f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,6 @@ add_library (seastar
src/websocket/server.cc
)

# We disable _FORTIFY_SOURCE because it generates false positives with longjmp() (src/core/thread.cc)
set_source_files_properties(src/core/thread.cc
PROPERTIES COMPILE_FLAGS -U_FORTIFY_SOURCE)

add_library (Seastar::seastar ALIAS seastar)

add_dependencies (seastar
Expand Down
5 changes: 5 additions & 0 deletions src/core/thread.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// If _FORTIFY_SOURCE is defined then longjmp ends up using longjmp_chk
// which asserts that you're jumping to the same stack. However, here we
// are intentionally switching stacks when longjmp'ing, so undefine this
// option to always use normal longjmp.
#undef _FORTIFY_SOURCE
/*
* This file is open source software, licensed to you under the terms
* of the Apache License, Version 2.0 (the "License"). See the NOTICE file
Expand Down

0 comments on commit c96444f

Please sign in to comment.