Skip to content

Instantly share code, notes, and snippets.

Avatar

Casey Bodley cbodley

  • Red Hat
  • Ann Arbor, MI
View GitHub Profile
View get-empty-etag.md

when GetObj returns a fake ETag from md5sum /dev/null:

diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc
index ccb8a397aec..dbb8576ebbc 100644
--- a/src/rgw/rgw_rest_s3.cc
+++ b/src/rgw/rgw_rest_s3.cc
@@ -445,7 +445,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
     } else {
       auto iter = attrs.find(RGW_ATTR_ETAG);
       if (iter != attrs.end()) {
View get-no-etag.md

when GetObj returns no ETag header:

diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc
index ccb8a397aec..dbb8576ebbc 100644
--- a/src/rgw/rgw_rest_s3.cc
+++ b/src/rgw/rgw_rest_s3.cc
@@ -445,7 +445,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
     } else {
       auto iter = attrs.find(RGW_ATTR_ETAG);
       if (iter != attrs.end()) {
@cbodley
cbodley / radossss.py
Created March 6, 2023 17:05
lsan output from different python versions
View radossss.py
cbodley@localhost ~/ceph/build $ LD_PRELOAD=/usr/lib64/libasan.so.8 python3.8 -m radossss
/usr/bin/python3.8: No module named radossss
=================================================================
==166101==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 108160 byte(s) in 83 object(s) allocated from:
#0 0x7f26cb8ba6af in __interceptor_malloc (/usr/lib64/libasan.so.8+0xba6af)
#1 0x7f26cb503419 in PyObject_Malloc (/lib64/libpython3.8.so.1.0+0x103419)
@cbodley
cbodley / gist:9a98541c82664efd13ca3cfc19556d5b
Created March 5, 2023 19:42
asan with detect_stack_use_after_return
View gist:9a98541c82664efd13ca3cfc19556d5b
$ ASAN_OPTIONS="detect_stack_use_after_return=true" LSAN_OPTIONS="suppressions=../qa/lsan.supp" MON=1 OSD=1 RGW=1 MGR=0 MDS=0 ../src/vstart.sh -n -d
0> 2023-03-05T11:23:04.897-0500 7fcf2463fa40 -1 *** Caught signal (Segmentation fault) **
in thread 7fcf2463fa40 thread_name:radosgw-admin
ceph version Development (no_version) reef (dev)
1: (ceph::ClibBackTrace::ClibBackTrace(int)+0x17f) [0x55df2d7587b3]
2: /home/cbodley/ceph/build/bin/radosgw-admin(+0x13414f84) [0x55df2ed5bf84]
3: /lib64/libc.so.6(+0x3cb20) [0x7fcf23a5fb20]
4: (boost::asio::detail::timer_queue<boost::asio::detail::chrono_time_traits<ceph::coarse_mono_clock, boost::asio::wait_traits<ceph::coarse_mono_clock> > >::get_all_timers(boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&)+0x385) [0x55df2d491a9b]
5: (boost::asio::detail::timer_queue_set::get_all_timers(boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&)+0x113) [0x55df2b749f6f]
@cbodley
cbodley / gist:d0ab0a9a75fcfeb5341e3a09f80eee5a
Created March 5, 2023 19:32
asan warning makecontext/swapcontext
View gist:d0ab0a9a75fcfeb5341e3a09f80eee5a
setting up user testid
==139529==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
=================================================================
==139529==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6190000a04a8 at pc 0x5558ab885f43 bp 0x7fb8534d2e70 sp 0x7fb8534d2e68
READ of size 8 at 0x6190000a04a8 thread T80
#0 0x5558ab885f42 in boost::context::detail::activation_record::resume() /home/cbodley/ceph/build/boost/include/boost/context/continuation_ucontext.hpp:12
6
#1 0x5558ab893393 in boost::context::continuation::resume() && /
@cbodley
cbodley / gist:a5d7b8f74f353bae6156c32076a8f281
Created March 5, 2023 19:28
asan warning __asan_handle_no_return
View gist:a5d7b8f74f353bae6156c32076a8f281
setting up user testid
==450337==WARNING: ASan is ignoring requested __asan_handle_no_return: stack type: default top: 0x7fffcfad0000; bottom 0x7f75f30e9000; size: 0x0089dc9e7000 (592111890432)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
=================================================================
==450337==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f75f30ea530 at pc 0x7f7640661b61 bp 0x7f75f30ea500 sp 0x7f75f30e9cb0
WRITE of size 24 at 0x7f75f30ea530 thread T0
#0 0x7f7640661b60 in __interceptor_sigaltstack.part.0 (/lib64/libasan.so.8+0x61b60)
#1 0x7f76406bf163 in __asan::PlatformUnpoisonStacks() (/lib64/libasan.so.8+0xbf163)
#2 0x7f76406c561c in __asan_handle_no_return (/lib64/libasan.so.8+0xc561c)
View repair bucket instance metadata
1. identify bucket instance id for bucket named "testbucket"
~/ceph/build $ bin/radosgw-admin metadata get bucket:testbucket | grep bucket_id
"bucket_id": "4b022f22-54ca-49e5-b547-9e8225d98de1.4159.1",
2. read bucket instance metadata into testbucket.orig.json
~/ceph/build $ bin/radosgw-admin metadata get bucket.instance:testbucket:4b022f22-54ca-49e5-b547-9e8225d98de1.4159.1 > testbucket.orig.json
3. replace "num_shards": 0 with 1
View common.h.diff
diff --git a/src/neorados/cls/common.h b/src/neorados/cls/common.h
index 6b39ea4b295..b1dd4b320ab 100644
--- a/src/neorados/cls/common.h
+++ b/src/neorados/cls/common.h
@@ -95,11 +95,15 @@ auto exec(
method = std::move(method), in = std::move(in),
f = std::move(f)](auto& self) {
auto e = self.get_executor();
+ using executor_type = decltype(e);
+ using awaitable_void = asio::awaitable<void, executor_type>;
View csv-UninitCondition.xml
<error>
<unique>0x34cc</unique>
<tid>342</tid>
<kind>UninitCondition</kind>
<what>Conditional jump or move depends on uninitialised value(s)</what>
<stack>
<frame>
<ip>0x141B715</ip>
<obj>/home/cbodley/ceph/build/bin/radosgw</obj>
<fn>CSVParser::next_line()</fn>