got at <unknown> <0xffffffff> stacktrace error (see code below)

-1
if (this.PendingLocalUARTCreditsCount != 0) return;

this.PendingLocalUARTCreditsCount = this.MaxLocalUARTCreditsCount - this.LocalUARTCreditsCount;
IntPtr value = (IntPtr)(this.PendingLocalUARTCreditsCount);
NSData valueData = NSData.FromBytes(value, 1);
this.CbPeripheral.WriteValue(valueData, this.UartRxCreditsCharacteristic, CBCharacteristicWriteType.WithoutResponse);

Got stacktrace error with NSData valueData = NSData.FromBytes(value, 1);

xamarin.ios
asked on Stack Overflow Apr 6, 2020 by Nick Hunter Blair • edited Apr 8, 2020 by Junior Jiang - MSFT

4 Answers

0

Native Crash Reporting

=================================================================

Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

=================================================================

answered on Stack Overflow Apr 6, 2020 by Nick Hunter Blair • edited Apr 8, 2020 by Junior Jiang - MSFT
0

I haven't solved it though in any way. I am developing in C# for an ipad app project using vs 2019 and a, Mac Nick

answered on Stack Overflow Apr 7, 2020 by Nick Hunter Blair
0

Welcome to SO ! You'd better update content all in question , then other people will know problem more clearly .

Although not knowing why NSData.FromBytes occurs error , however there is a workaround for you to check . Using NSData.FromArrayto transfer int to NSData .

int valueInt = 1234567890;
Byte[] byteData = new Byte[1];
byteData[0] = (Byte)((valueInt & 0xFF));

Console.WriteLine("-----NSData-------" + NSData.FromArray(byteData));

Then output is :

-----NSData-------{length = 1, bytes = 0xd2}

Therefore , shared code can be modified as follow :

...
Byte[] byteData = new Byte[1];
byteData[0] = (Byte)((this.PendingLocalUARTCreditsCount & 0xFF));
NSData valueData = NSData.FromArray(byteData);
...
answered on Stack Overflow Apr 8, 2020 by Junior Jiang - MSFT • edited Apr 10, 2020 by Junior Jiang - MSFT
0

I got SIGSEGV error not SIGABRT. I can discover connect and disconnect but not set rx credits on the peripheral (using Telit 4.0 Bluetooth low, energy module) and am trying to get communication to work so don't think have to set Bluetooth permissions The problem I think is the pointer (Intpr) pointing to the wrong address as app crashes, when it deferences the data. Thanks for the input though. Regards nick

answered on Stack Overflow Apr 8, 2020 by Nick Hunter Blair

User contributions licensed under CC BY-SA 3.0