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

crash: specialized _ContiguousArrayBuffer.init(_uninitializedCount:minimumCapacity:) + [ : 0] #629

Open
wyxuan opened this issue Nov 1, 2024 · 0 comments

Comments

@wyxuan
Copy link

wyxuan commented Nov 1, 2024

crash 1:

0 libswiftCore.dylib 0x000000018cdda338 swift::hashable_support::findHashableBaseType(swift::TargetMetadataswift::InProcess const*) [clone .cold.1] + [ : 16]
1 libswiftCore.dylib 0x000000018cd03e68 swift_slowDealloc
2 libswiftCore.dylib 0x000000018cd042c0 swift_allocObject + [ : 1108]
0x00000001029fbeac specialized _ContiguousArrayBuffer.init(_uninitializedCount:minimumCapacity:) + [ : 52]
4 app 0x00000001029fb9f4 $ss22_ContiguousArrayBufferV20_consumeAndCreateNew14bufferIsUnique15minimumCapacity13growForAppendAByxGSb_SiSbtFSi_s6UInt64Vt_Tg5 + [ : 0]
5 app 0x00000001029fb8a4 $ss15ContiguousArrayV16_createNewBuffer14bufferIsUnique15minimumCapacity13growForAppendySb_SiSbtFSi_s6UInt64Vt_Tg5 + [ : 0]
6 app 0x00000001029dd964 $ss14_ArrayProtocolPsE6filterySay7ElementQzGSbAEKXEKFSaySi_s6UInt64VtG_Tg5059$s6MS19MSBandwidthTrackerC9bandwidth12timeNanosNowSds6E17V_tFSbSi_AGtXEfU_AH6MS0hI0CTf1cn_n + [ : 0]
crash 1 code :
let bw = bandwidthTracker.bandwidth(timeNanosNow: DispatchTime.now().rawValue)
if bw > MAX_BANDWIDTH_KB_PER_SECOND {
loopDelayMs = 1_000
return
}

        let spansDict = spanDb.fetch(count: spanCount)
        let spans = spansDict.map{ $0.1 }
        if spans.isEmpty {
            return
        }
        
        let body = Opentelemetry_Proto_Collector_Trace_V1_ExportTraceServiceRequest.with {
            $0.resourceSpans = SpanAdapter.toProtoResourceSpans(spanDataList: spans)
        }

crash 2:
0 libswiftCore.dylib 0x0000000196016338 swift::hashable_support::findHashableBaseType(swift::TargetMetadataswift::InProcess const*) [clone .cold.1] + [ : 16]
1 libswiftCore.dylib 0x0000000195f3fe68 swift_slowDealloc
2 libswiftCore.dylib 0x0000000195f402c0 swift_allocObject + [ : 1108]
3 Foundation 0x00000001961ba930 $ss12_ArrayBufferV20_consumeAndCreateNew14bufferIsUnique15minimumCapacity13growForAppendAByxGSb_SiSbtF10Foundation7JSONMapC5ValueO_Tg5 + [ : 128]
4 Foundation 0x00000001961b7c48 closure #1 in JSONDecoder.decode(:from:) + [ : 880]
5 Foundation 0x00000001961b78d0 partial apply for closure #1 in JSONDecoder.decode(:from:) + [ : 24]
6 Foundation 0x00000001961b7580 closure #1 in static JSONDecoder.withUTF8Representation(of::) + [ : 124]
7 Foundation 0x00000001961b74fc partial apply for closure #1 in static JSONDecoder.withUTF8Representation(of:
:) + [ : 24]
8 Foundation 0x00000001961b74d0 closure #1 in Data.withBufferView(:) + [ : 40]
9 Foundation 0x00000001961b74a0 partial apply for closure #1 in Data.withBufferView(
:) + [ : 24]
10 Foundation 0x0000000196866be0 __DataStorage.withUnsafeBytes(in:apply:) + [ : 96]
11 Foundation 0x0000000196829a28 static JSONDecoder.withUTF8Representation(of::) + [ : 432]
12 Foundation 0x00000001961b7114 JSONDecoder.decode(
:from:) + [ : 112]
13 Foundation 0x00000001961b709c dispatch thunk of JSONDecoder.decode(_:from:) + [ : 56]
crash 2 code:
func decodeSpanData(from rawData: UnsafePointer?, length: Int) -> SpanData? {
guard let rawData = rawData else { return nil }

    let jsonData = Data(bytes: rawData, count: length)

    do {
        let decoder = JSONDecoder()
        let spanData = try decoder.decode(SpanData.self, from: jsonData)
        return spanData
    } catch {
        print("Error decoding Data to SpanData: \(error)")
        return nil
    }
}
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

No branches or pull requests

1 participant