Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-62035

SIGSEGV: segmentation violation in je_malloc_usable_size in magma::BlockCache::BlockCtor>::memUsed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • Morpheus
    • Morpheus
    • storage-engine
    • Untriaged
    • 0
    • Unknown

    Description

      The issue was seen during BHive a read unit test on Morpheus.  The test had passed on Trinity before. (note : test links with libmagma_shared).

      The sigsegv is in cb_malloc_usable_size. We confirmed it is not related to memory corruption.  We have built magma using official morpheus manifest. It seems currently it is not safe to pass pointer to cb_malloc_usabe_size.  Unless we link libmagma_shared with platform_cb_malloc_arena, block cache code paths will run into this issue.

      Cgo StackTrace:

      SIGSEGV: segmentation violation PC=0x108872960 m=13 sigcode=1 addr=0x11c820 signal arrived during cgo execution goroutine 6 gp=0xc000116540 m=13 mp=0xc00008ad08 [syscall]: je_malloc_usable_size /Users/saptarshi.sen/ws/couchbase/morpheus/build/tlm/deps/jemalloc.exploded/lib/libjemalloc.2.dylib:0 pc=0x108872961 _ZN5magma5CacheINS_10BlockCache7BlockIDENS_9BlockDataENS1_9BlockCtorEE13AcquireObjectERS4_b /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x108331c22 _ZN5magma10BlockCache4ReadEPNS_4FileEyxmRNSt3__110shared_ptrINS_9BlockDataEEERmbNS3_8functionIFNS_6StatusEPKcmRNS3_10unique_ptrIA_cNS3_14default_deleteISE_EEEES8_EEEPNS_18BufferedFileReaderE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x108328fc9 _ZN5magma11ManagedFile4ReadERKNSt3__110shared_ptrINS_4FileEEExmRNS2_INS_9BlockDataEEERmNS_13CacheReadModeENS1_8functionIFNS_6StatusEPKcmRNS1_10unique_ptrIA_cNS1_14default_deleteISH_EEEESA_EEEPNS_18BufferedFileReaderE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x1083287e7 _ZN5magma7SSTable9readBlockERKNSt3__110shared_ptrINS_4FileEEERKNS_12BlockPointerEPNS_5BlockERNS_11ReaderStatsEbPNS_18BufferedFileReaderE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x1082bd5d6 _ZN5magma15SSTableIterator10initStacksERKNS_5SliceE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x1082c2577 _ZN5magma15SSTableIterator4SeekERKNS_5SliceE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x1082c3250 _ZN5magma15SSTableIterator4FindERKNS_5SliceE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x1082c1c26 _ZNSt3__110__function6__funcIZN5magma7LSMTree3GetERKNS2_5SliceERNS_10shared_ptrINS2_8SnapshotEEERNS2_12LookupBufferERS4_bPNS2_11ReaderStatsEE4$_24NS_9allocatorISG_EEFbRNS2_5TableEEEclESK_ /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x10831c64e _ZN5magma12TreeSnapshot16LookupTableByKeyERKNS_5SliceENSt3__18functionIFbRNS_5TableEEEEb /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x108239364 _ZN5magma7LSMTree3GetERKNS_5SliceERNSt3__110shared_ptrINS_8SnapshotEEERNS_12LookupBufferERS1_bPNS_11ReaderStatsE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x1082efeea _ZN5magma7KVStore4ReadERKNS_5SliceERNSt3__110shared_ptrINS_15KVStoreSnapshotEEERNS0_10ReadBufferERS1_SB_ /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x108309b9d _ZN5magma5Magma4Impl7GetDocsERNS0_8SnapshotERNS_10OperationsINS0_12GetOperationEEENSt3__18functionIFvNS_6StatusERKS5_RKNS_5SliceESF_EEE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x108245d22 _ZN5magma5Magma7GetDocsERNS0_8SnapshotERNS_10OperationsINS0_12GetOperationEEENSt3__18functionIFvNS_6StatusERKS4_RKNS_5SliceESE_EEE /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x1082465c5 _ZN5magma12MagmaKVStore7GetDocsEtPNS_5Magma8SnapshotEP7CRecordm /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x108358e3e MKV_Get /Users/saptarshi.sen/ws/couchbase/morpheus/install/lib/libmagma_shared.dylib:0 pc=0x10835a4c3 _cgo_01cc66a1b5b2_Cfunc_MKV_Get /private/var/folders/6d/bzlc6g5910z_mgm13ymtf2t80000gr/T/go-build2301095287/b001/magma.test:0 pc=0x1078ae200 runtime.cgocall(0x1078ae1b0, 0xc00006dc50) /Users/saptarshi.sen/.cbdepscache/exploded/x86_64/go-1.22.2/go/src/runtime/cgocall.go:157 +0x4b fp=0xc00006dc28 sp=0xc00006dbf0 pc=0x10772092b github.com/couchbase/bhive/magma._Cfunc_MKV_Get(0x6000029ed180, 0x1, 0x600002a42b60, 0xc001c38000, 0x186a0)

      notes : (relevant MB-54297 (853d1a2d8f7e458a88ec57e4f6b2f263a1151804 in platform) describes platform_cb_malloc_arena , also see MB-37484)

      Attachments

        For Gerrit Dashboard: MB-62035
        # Subject Branch Project Status CR V

        Activity

          People

            saptarshi.sen Saptarshi Sen
            saptarshi.sen Saptarshi Sen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty