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

[SR-7651] symbolicate-linux-fatal doesn't deal with series of stack traces properly #50192

Open
swift-ci opened this issue May 10, 2018 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-7651
Radar None
Original Reporter gmilos (JIRA User)
Type Bug
Environment

Swift 4.0.3 (and current master).

Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug
Assignee None
Priority Medium

md5: 4b5326ed80969a2d7ca1e0028e175b0d

Issue Description:

symbolicate-linux-fatal tool is designed to ingest stdin, similarly to `swift demangle`. However, only the first stack trace detected in the input stream is symbolicated correctly. The other ones are corrupt. An example attached below.

Current stack trace:
0 libswiftCore.so 0x00007fe5aa7b37d6 swift_slowAlloc + 6
1 libswiftCore.so 0x00007fe5aa7b3818 swift_allocObject + 24
2 somesrv-app 0x0000000000cb7784 NIO.SocketChannel.__allocating_init(socket: NIO.Socket, parent: Swift.Optional<NIO.Channel>, eventLoop: NIO.SelectableEventLoop) throws -> NIO.SocketChannel + 68 at SocketChannel.swift:0
3 somesrv-app 0x0000000000cbe0e2 NIO.ServerSocketChannel.readFromSocket() throws -> NIO.BaseSocketChannel<NIO.ServerSocket>.ReadResult + 1170 at SocketChannel.swift:416
4 somesrv-app 0x0000000000b838eb NIO.BaseSocketChannel.(readable0 in _9C3D3FC8F9F3D83A05D3F6063F6AE958)() -> NIO.BaseSocketChannel<A>.(ReadStreamState in _9C3D3FC8F9F3D83A05D3F6063F6AE958) + 939 at BaseSocketChannel.swift:898
5 somesrv-app 0x0000000000b852ed NIO.BaseSocketChannel.readable() -> () + 317 at BaseSocketChannel.swift:882
6 somesrv-app 0x0000000000b86959 protocol witness for NIO.SelectableChannel.readable() -> () in conformance <A where A: NIO.BaseSocket> NIO.BaseSocketChannel<A> : NIO.SelectableChannel in NIO + 9 at BaseSocketChannel.swift:0
7 somesrv-app 0x0000000000c0891f NIO.SelectableEventLoop.(handleEvent in _D5D78C61B22284700B9BD1ACFBC25157)<A where A: NIO.SelectableChannel>(NIO.SelectorEventSet, channel: A) -> () + 735 at EventLoop.swift:441
8 somesrv-app 0x0000000000c09a96 closure #&#8203;1 (NIO.SelectorEvent<NIO.NIORegistration>) -> () in closure #&#8203;1 () throws -> () in NIO.SelectableEventLoop.run() throws -> () + 262 at EventLoop.swift:488
9 somesrv-app 0x0000000000c139b6 partial apply forwarder for closure #&#8203;1 (NIO.SelectorEvent<NIO.NIORegistration>) -> () in closure #&#8203;1 () throws -> () in NIO.SelectableEventLoop.run() throws -> () + 54 at EventLoop.swift:0
10 somesrv-app 0x0000000000c09be0 reabstraction thunk helper from @callee_owned (@owned NIO.SelectorEvent<NIO.NIORegistration>) -> (@error @owned Swift.Error) to @callee_owned (@in NIO.SelectorEvent<NIO.NIORegistration>) -> (@error @owned Swift.Error) + 64 at EventLoop.swift:0
11 somesrv-app 0x0000000000c13a53 partial apply forwarder for reabstraction thunk helper from @callee_owned (@owned NIO.SelectorEvent<NIO.NIORegistration>) -> (@error @owned Swift.Error) to @callee_owned (@in NIO.SelectorEvent<NIO.NIORegistration>) -> (@error @owned Swift.Error) + 83 at EventLoop.swift:0
12 somesrv-app 0x0000000000c96c7b NIO.Selector.whenReady(strategy: NIO.SelectorStrategy, (NIO.SelectorEvent<A>) throws -> ()) throws -> () + 5739 at Selector.swift:539
13 somesrv-app 0x0000000000c0991a closure #&#8203;1 () throws -> () in NIO.SelectableEventLoop.run() throws -> () + 234 at EventLoop.swift:494
14 somesrv-app 0x0000000000c0ff2e partial apply forwarder for closure #&#8203;1 () throws -> () in NIO.SelectableEventLoop.run() throws -> () + 78 at EventLoop.swift:0
15 somesrv-app 0x000000000043d9e6 reabstraction thunk helper from @callee_owned () -> (@error @owned Swift.Error) to @callee_owned () -> (@out (), @error @owned Swift.Error) + 22 at Await.swift:0
16 somesrv-app 0x0000000000c0ffd3 reabstraction thunk helper from @callee_owned () -> (@error @owned Swift.Error) to @callee_owned () -> (@out (), @error @owned Swift.Error)partial apply forwarder with unmangled suffix ".37" + 83 at EventLoop.swift:0
17 somesrv-app 0x0000000000c04727 NIO.(withAutoReleasePool in _D5D78C61B22284700B9BD1ACFBC25157)<A>(() throws -> A) throws -> A + 71 at EventLoop.swift:258
18 somesrv-app 0x0000000000c08eaf NIO.SelectableEventLoop.run() throws -> () + 671 at EventLoop.swift:495
19 somesrv-app 0x0000000000c0c298 closure #&#8203;1 (NIO.Thread) -> () in static NIO.MultiThreadedEventLoopGroup.(setupThreadAndEventLoop in _D5D78C61B22284700B9BD1ACFBC25157)(name: Swift.String, initializer: (NIO.Thread) -> ()) -> NIO.SelectableEventLoop + 616 at EventLoop.swift:674
20 somesrv-app 0x0000000000c132fc partial apply forwarder for closure #&#8203;1 (NIO.Thread) -> () in static NIO.MultiThreadedEventLoopGroup.(setupThreadAndEventLoop in _D5D78C61B22284700B9BD1ACFBC25157)(name: Swift.String, initializer: (NIO.Thread) -> ()) -> NIO.SelectableEventLoop + 156 at EventLoop.swift:0
21 somesrv-app 0x0000000000c0c8af reabstraction thunk helper from @callee_owned (@owned NIO.Thread) -> () to @callee_owned (@in NIO.Thread) -> (@out ()) + 15 at EventLoop.swift:0
22 somesrv-app 0x0000000000cd506a partial apply forwarder for reabstraction thunk helper from @callee_owned (@owned NIO.Thread) -> () to @callee_owned (@in NIO.Thread) -> (@out ()) + 74 at Thread.swift:0
23 somesrv-app 0x0000000000cd3e0b closure #&#8203;1 (Swift.Optional<Swift.UnsafeMutableRawPointer>) -> Swift.Optional<Swift.UnsafeMutableRawPointer> in static NIO.Thread.spawnAndRun(name: Swift.Optional<Swift.String>, body: (NIO.Thread) -> ()) -> () + 2395 at Thread.swift:105
24 somesrv-app 0x0000000000cd3eb9 @objc closure #&#8203;1 (Swift.Optional<Swift.UnsafeMutableRawPointer>) -> Swift.Optional<Swift.UnsafeMutableRawPointer> in static NIO.Thread.spawnAndRun(name: Swift.Optional<Swift.String>, body: (NIO.Thread) -> ()) -> () + 9 at Thread.swift:0
25 libpthread-2.19.so 0x00007fe5aa12c182 start_thread + 194
26 libc-2.19.so 0x00007fe5a816047d clone + 109
Stack count: 1
Leak size: 56 bytes
Current stack trace:
0 libswiftCore.so 0x00007fe5aa7b37d6 swift_slowAlloc + 6
1 libswiftCore.so 0x00007fe5aa7b3818 swift_allocObject + 24
2 libswiftCore.so 0x00007fe5aa46ebce Swift._ContiguousArrayBuffer.init(_uninitializedCount: Swift.Int, minimumCapacity: Swift.Int) -> Swift._ContiguousArrayBuffer<A> + 126
3 libswiftCore.so 0x00007fe5aa49a115 static Swift.Array._copyBuffer(inout Swift._ContiguousArrayBuffer<A>) -> () + 53
4 libswiftCore.so 0x00007fe5aa46e6eb Swift.ContiguousArray.subscript.nativePinningMutableAddressor : (Swift.Int) -> A + 187
5 libswiftCore.so 0x00007fe5aa46e8cb Swift.ContiguousArray.subscript.setter : (Swift.Int) -> A + 27
6 libswiftCore.so 0x00007fe5aa46f65c protocol witness for Swift.MutableCollection.subscript.setter : (A.Index) -> A.Element in conformance <A> Swift.ContiguousArray<A> : Swift.MutableCollection in Swift + 12
7 libswiftCore.so 0x00007fe5aa47067c (extension in Swift):Swift.MutableCollection.swapAt(A.Index, A.Index) -> () + 524
8 somesrv-app 0x0000000000c39bf8 closure #&#8203;1 (SomeServerProtobuf.Rpcproto_Response.(_StorageClass in _51F12C824C4B219132AD19C616B37C94)) throws -> () in SomeServerProtobuf.Rpcproto_Response.decodeMessage<A where A: SwiftProtobuf.Decoder>(decoder: inout A) throws -> () + 20168 at someserver.pb.swift:12242
9 somesrv-app 0x0000000000c3acf8 closure #&#8203;1 (SomeServerProtobuf.Rpcproto_Response.(_StorageClass in _51F12C824C4B219132AD19C616B37C94)) throws -> () in SomeServerProtobuf.Rpcproto_Response.decodeMessage<A where A: SwiftProtobuf.Decoder>(decoder: inout A) throws -> () + 24520 at someserver.pb.swift:12253
10 somesrv-app 0x0000000000c3a548 closure #&#8203;1 (SomeServerProtobuf.Rpcproto_Response.(_StorageClass in _51F12C824C4B219132AD19C616B37C94)) throws -> () in SomeServerProtobuf.Rpcproto_Response.decodeMessage<A where A: SwiftProtobuf.Decoder>(decoder: inout A) throws -> () + 22552 at someserver.pb.swift:12247
11 somesrv-app 0x0000000000c87c30 SomeServerProtobuf.Rpcproto_Response.AssetUpload.decodeMessage<A where A: SwiftProtobuf.Decoder>(decoder: inout A) throws -> () + 64 at someserver.pb.swift:0
12 somesrv-app 0x0000000000c0a0b9 SomeServerProtobuf.Rpcproto_Request.RetrieveRecord.(_StorageClass in _51F12C824C4B219132AD19C616B37C94).init(copying: SomeServerProtobuf.Rpcproto_Request.RetrieveRecord.(_StorageClass in _51F12C824C4B219132AD19C616B37C94)) -> SomeServerProtobuf.Rpcproto_Request.RetrieveRecord.(_StorageClass in _51F12C824C4B219132AD19C616B37C94) + 329 at someserver.pb.swift:11082
13 somesrv-app 0x0000000000c1005d protocol witness for SwiftProtobuf._MessageImplementationBase._protobuf_generated_isEqualTo(other: A) -> Swift.Bool in conformance SomeServerProtobuf.Rpcproto_Request.PartitionIds : SwiftProtobuf._MessageImplementationBase in SomeServerProtobuf + 285 at someserver.pb.swift:0
14 somesrv-app 0x000000000043d9e6 reabstraction thunk helper from @callee_owned () -> (@error @owned Swift.Error) to @callee_owned () -> (@out (), @error @owned Swift.Error) + -4194282 at Await.swift:0
15 somesrv-app 0x0000000000ce6663 initializeBufferWithCopyOfBuffer value witness for SomeServerProtobuf.Rpcproto_Request.RetrieveQuotaInfo + 19 at someserver.pb.swift:0
16 somesrv-app 0x0000000000ce3205 ___lldb_unnamed_symbol2234$$somesrv-app + 149 at someserver.pb.swift:0
17 somesrv-app 0x0000000000ce3344 ___lldb_unnamed_symbol2235$$somesrv-app + 100 at someserver.pb.swift:0
18 somesrv-app 0x0000000000c08fb1 SomeServerProtobuf.Rpcproto_Request.RecordRetrieveChanges.ChangeTypes._protobuf_nameMap.unsafeMutableAddressor : SwiftProtobuf._NameMap + 17 at someserver.pb.swift:11062
19 somesrv-app 0x0000000000c0c298 SomeServerProtobuf.Rpcproto_Request.RetrieveRecord._protobuf_generated_isEqualTo(other: SomeServerProtobuf.Rpcproto_Request.RetrieveRecord) -> Swift.Bool + 584 at someserver.pb.swift:11157
20 somesrv-app 0x0000000000c132fc SomeServerProtobuf.Rpcproto_Request.DsidToUserId.traverse<A where A: SwiftProtobuf.Visitor>(visitor: inout A) throws -> () + 172 at someserver.pb.swift:11339
21 somesrv-app 0x0000000000c0c8af closure #&#8203;1 (SomeServerProtobuf.Rpcproto_Request.RetrieveRecord.(_StorageClass in _51F12C824C4B219132AD19C616B37C94), SomeServerProtobuf.Rpcproto_Request.RetrieveRecord.(_StorageClass in _51F12C824C4B219132AD19C616B37C94)) -> Swift.Bool in SomeServerProtobuf.Rpcproto_Request.RetrieveRecord._protobuf_generated_isEqualTo(other: SomeServerProtobuf.Rpcproto_Request.RetrieveRecord) -> Swift.Bool + 1311 at someserver.pb.swift:11151
22 somesrv-app 0x0000000000cd506a ___lldb_unnamed_symbol2192$$somesrv-app + 218 at someserver.pb.swift:0
23 somesrv-app 0x0000000000cd3e0b initializeWithCopy value witness for SomeServerProtobuf.Rpcproto_Request + 91 at someserver.pb.swift:0
24 somesrv-app 0x0000000000cd3eb9 assignWithCopy value witness for SomeServerProtobuf.Rpcproto_Request + 137 at someserver.pb.swift:0
25 libpthread-2.19.so 0x00007fe5aa12c182 start_thread + 194
26 libc-2.19.so 0x00007fe5a816047d clone + 109

@swift-ci
Copy link
Collaborator Author

Comment by Gregor Milos (Grzegorz Miłoś) (JIRA)

PR submitted here: #16494

@swift-ci
Copy link
Collaborator Author

Comment by Gregor Milos (Grzegorz Miłoś) (JIRA)

Updated PR: #20681

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

1 participant