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

UnsafePointer Crash #241

Closed
zaigham-mt opened this issue Nov 23, 2015 · 15 comments
Closed

UnsafePointer Crash #241

zaigham-mt opened this issue Nov 23, 2015 · 15 comments

Comments

@zaigham-mt
Copy link

Thread : Crashed: com.apple.root.default-qos
0 CoreFoundation 0x1845a0e00 __CFStringCreateImmutableFunnel3 + 32
1 CoreFoundation 0x18452caa0 CFStringCreateFromExternalRepresentation + 104
2 CoreFoundation 0x18452caa0 CFStringCreateFromExternalRepresentation + 104
3 Foundation 0x185449a38 -[NSPlaceholderString initWithData:encoding:] + 148
4 MyTestApp-Dev 0x1001e5ab0 specialized WebSocket.(processResponse in _02D691C80E51B897C380608DCFC8AEE6)(WebSocket.WSResponse) -> Bool (WebSocket.swift)
5 MyTestApp-Dev 0x1001e1b20 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:574)
6 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
7 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
8 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
9 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
10 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
11 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
12 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
13 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
14 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
15 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
16 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
17 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
18 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
19 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
20 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
21 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
22 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
23 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
24 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
25 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
26 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
27 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
28 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
29 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
30 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
31 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
32 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
33 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
34 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
35 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
36 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
37 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
38 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
39 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
40 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
41 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
42 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
43 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
44 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
45 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
46 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)
47 MyTestApp-Dev 0x1001e1ba4 WebSocket.(processRawMessage in _02D691C80E51B897C380608DCFC8AEE6)(UnsafePointer, bufferLen : Int) -> () (WebSocket.swift:591)

@nuclearace
Copy link
Member

Does this only happen with optimizations on? If so it's a known bug that can only be fixed by lowering optimizations

@zaigham-mt
Copy link
Author

Optimization level is set to None. We have tried it for Fast but using that crash was more frequent.

@nuclearace
Copy link
Member

Do you know what message it's crashing on

@NachoSoto
Copy link
Contributor

Does this only happen with optimizations on? If so it's a known bug that can only be fixed by lowering optimizations

Curious: where are you tracking thus known bug? I'd like to bring it to the attention of the Swift compiler team if it's really a bug.

@nuclearace
Copy link
Member

daltoniam/Starscream#77

@zaigham-mt
Copy link
Author

We have tried it for optimizations off and on , but still have crashes.

On Mon, Nov 23, 2015 at 8:55 PM, NachoSoto [email protected] wrote:

Does this only happen with optimizations on? If so it's a known bug that
can only be fixed by lowering optimizations

Curious: where are you tracking thus known bug? I'd like to bring it to
the attention of the Swift compiler team if it's really a bug.


Reply to this email directly or view it on GitHub
#241 (comment)
.

Best Regards

Zaigham Maqsood
skype: zaigham.maqsood

@nuclearace
Copy link
Member

Then I'll need to know what message it's crashing on

@civocr
Copy link

civocr commented Nov 24, 2015

I'm getting the same type of crash on the following line:

if dataLength == 127 {
let bytes = UnsafePointer((buffer+offset))
** dataLength = bytes[0].bigEndian **

Socket_IO_Client_Swift`Socket_IO_Client_Swift.WebSocket.(buffer=, bufferLen=, self=) (Socket_IO_Client_Swift.WebSocket)(Swift.UnsafePointer<Swift.UInt8>, bufferLen : Swift.Int) -> () + 5948 at WebSocket.swift:495, queue = 'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN, address=0x16a3880a)

It only seems to crash if I'm using an SSL connection. Optimisation is set to None -00

@zaigham-mt
Copy link
Author

I am getting same message as civocr.

On Tue, Nov 24, 2015 at 7:01 AM, civocr [email protected] wrote:

I'm getting the same type of crash on the following line:

if dataLength == 127 {
let bytes = UnsafePointer((buffer+offset))
** dataLength = bytes[0].bigEndian **

Socket_IO_Client_Swift`Socket_IO_Client_Swift.WebSocket.(buffer=,
bufferLen=, self=) (Socket_IO_Client_Swift.WebSocket)(Swift.UnsafePointer,
bufferLen : Swift.Int) -> () + 5948 at WebSocket.swift:495, queue =
'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS
(code=EXC_ARM_DA_ALIGN, address=0x16a3880a)

It only seems to crash if I'm using an SSL connection. Optimisation is set
to None -00


Reply to this email directly or view it on GitHub
#241 (comment)
.

Best Regards

Zaigham Maqsood
skype: zaigham.maqsood

@zaigham-mt
Copy link
Author

Some times I am getting another crash.Attached screenshot.

warning: could not load any Objective-C class information from the dyld
shared cache. This will significantly reduce the quality of type
information available.

On Tue, Nov 24, 2015 at 3:13 PM, Zaigham Maqsood <
[email protected]> wrote:

I am getting same message as civocr.

On Tue, Nov 24, 2015 at 7:01 AM, civocr [email protected] wrote:

I'm getting the same type of crash on the following line:

if dataLength == 127 {
let bytes = UnsafePointer((buffer+offset))
** dataLength = bytes[0].bigEndian **

Socket_IO_Client_Swift`Socket_IO_Client_Swift.WebSocket.(buffer=,
bufferLen=, self=) (Socket_IO_Client_Swift.WebSocket)(Swift.UnsafePointer,
bufferLen : Swift.Int) -> () + 5948 at WebSocket.swift:495, queue =
'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS
(code=EXC_ARM_DA_ALIGN, address=0x16a3880a)

It only seems to crash if I'm using an SSL connection. Optimisation is
set to None -00


Reply to this email directly or view it on GitHub
#241 (comment)
.

Best Regards

Zaigham Maqsood
skype: zaigham.maqsood

Best Regards

Zaigham Maqsood
skype: zaigham.maqsood

@nuclearace nuclearace mentioned this issue Nov 24, 2015
@nuclearace
Copy link
Member

Can't reproduce on OS X

@zaigham-mt
Copy link
Author

I am getting it for IOS 9.0.

On Tue, Nov 24, 2015 at 10:30 PM, Erik Little [email protected]
wrote:

Can't reproduce on OS X


Reply to this email directly or view it on GitHub
#241 (comment)
.

Best Regards

Zaigham Maqsood
skype: zaigham.maqsood

@zaigham-mt
Copy link
Author

on line s.delegate?.websocketDidReceiveMessage(s, text: str! as String) getting EXC_Bad_Access

@guilhermeKodama
Copy link

I am getting the same error when streaming a sensor signal in a high frequency (1k/s)
"could not load any Objective-C class information. This will significantly reduce the quality of type information available."

@nuclearace
Copy link
Member

Hopefully a patch in the WebSocket library will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants