Device tree create device at root - driver

I'm writing a UBoot driver for bitbanged NAND and need to add it to the device tree.
Because this device is not on any bus and only references GPIO pins, I want to put it directly at the device tree root (like it's done for gpio-leds):
/ {
nand {
status = "ok";
compatible = "onfi,bitbang-nand";
pinctrl-0 = <&nand_pins>;
pinctrl-names = "default";
nand-bus-width = <8>;
data-gpios = <&gpio 40 0>,
<&gpio 41 0>,
<&gpio 42 0>,
<&gpio 43 0>,
<&gpio 44 0>,
<&gpio 45 0>,
<&gpio 46 0>,
<&gpio 47 0>;
ale-gpios = <&gpio 38 0>;
cle-gpios = <&gpio 39 0>;
nre-gpios = <&gpio 36 0>;
nwe-gpios = <&gpio 35 0>;
nce-gpios = <&gpio 44 0>;
nwp-gpios = <&gpio 44 0>;
rdy-gpios = <&gpio 47 0>;
};
};
When the device is declared as such, UBoot does not recognize the device, and it's not even present in device tree node binding log. When I add a subnode to the device, UBoot recognizes nand as a device:
/ {
nand {
compatible = "onfi,bitbang-nand";
#address-cells = <1>;
#size-cells = <1>;
pinctrl-0 = <&nand_pins>;
pinctrl-names = "default";
nand#0 {
status = "ok";
nand-bus-width = <8>;
data-gpios = <&gpio 40 0>,
<&gpio 41 0>,
<&gpio 42 0>,
<&gpio 43 0>,
<&gpio 44 0>,
<&gpio 45 0>,
<&gpio 46 0>,
<&gpio 47 0>;
ale-gpios = <&gpio 38 0>;
cle-gpios = <&gpio 39 0>;
nre-gpios = <&gpio 36 0>;
nwe-gpios = <&gpio 35 0>;
nce-gpios = <&gpio 44 0>;
nwp-gpios = <&gpio 44 0>;
rdy-gpios = <&gpio 47 0>;
};
};
};
Why the first example is not considered a device and the second one is? I couldn't find anything relevant in the specification.

This was a silly mistake. According to the specification, the right status value is okay, not ok. So, the node nand was read by dm_scan_fdt_node in drivers/core/root.c and discarded as disabled. Second version was found because absent status field is equivalent to the enabled device.

Related

How to Convert String into bytearray(EUC-KR)?

Hello There i am using swift 5.0 and developing BLE App.
As we have android app there are using default function as below
byte nByte[] = Name.getBytes( charsetName: "EUC-KR")
Output of android
Value[0] = 32 Value[1] = 30 Value[2] = 32 Value[3] =
32 Value[4] = 31 Value[5] = 31 Value[6] = 32 Value[7] = 37 Value[8] = 2d Value[9] = c3 Value[10] =
e6 Value[11] = ba Value[12] = cf Value[13] = 38 Value[14] = 30 Value[15] = c0 Value[16] = da Value[17] =
39 Value[18] = 30 Value[19] = 31 Value[20] = 35 Value[21] = 2d Value[22] = 58 Value[23] = 2d Value[24] =
30 Value[25] = 32 Value[26] = 2d Value[27] = 31 Value[28] = 32 Value[29] = 31 Value[30] = 32 Value[31] =
31 Value[32] = 32 Value[33] = 31 Value[34] = 2e Value[35] = 54 Value[36] = 58 Value[37] = 54
We used in iOS different type of string convert as below
Code 1
let rawEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringEncoding(CFStringEncodings.EUC_KR.rawValue))
let encoding = String.Encoding(rawValue: rawEncoding)
let strEUCData = "20221127-충북80자9015-X-02-1212121.TXT".data(using: encoding) ?? Data()
Output of iOS
bytes : 38 elements
0 : 50
1 : 48
2 : 50
3 : 50
4 : 49
5 : 49
6 : 50
8 : 45
9 : 195
10 : 230
11 : 186
12 : 207
13 : 56
14 : 48
15 : 192
16 : 218
17 : 57
18 : 48
19 : 49
20 : 53
21 : 45
22 : 88
23 : 45
24 : 48
25 : 50
26 : 45
27 : 49
28 : 50
29 : 49
30 : 50
31 : 49
32 : 50
33 : 49
34 : 46
35 : 84
36 : 88
37 : 84
Code 2
let strEUCData1 = "20221127-충북80자9015-X-02-1212121.TXT".data(using: String.Encoding(rawValue: 0x80000940)) ?? Data()
All above functions given wrong byte array.
Any help will be appreciated.
Thank you.
They are the same data. The Android output is in Hex (base 16) number and the iOS output is in decimal (base 10) number:
Android (Hex) iOS (Decimal)
32 50
30 48
32 50
32 50
31 49
31 49
32 50
37 55
2d 45
c3 195
e6 230
ba 186
cf 207
38 56
30 48
c0 192
da 218
39 57
30 48
31 49
35 53
2d 45
58 88
2d 45
30 48
32 50
2d 45
31 49
32 50
31 49
32 50
31 49
32 50
31 49
2e 46
54 84
58 88
54 84

iOS Webrtc - Crash in RTCPeerConnectionFactory.VideoSourceWithCapturer

I am using static library "libWebRTC.a" to create IOS App by binding it using Xamarin binding.
when I call _factory.VideoSourceWithCapturer(capturer, mediaConstraints); in this code the application crashes
RTCVideoTrack CreateLocalVideoTrack()
{
RTCVideoTrack localVideoTrack = null;
AVCaptureDevice.RequestAccessForMediaType(AVMediaType.Video, (bool isAccessGranted) =>
{
if (isAccessGranted)
{
String cameraID = "";
for (int i = 0; i < AVCaptureDevice.DevicesWithMediaType(AVMediaType.Video).Length; i++)
{
if (AVCaptureDevice.DevicesWithMediaType(AVMediaType.Video)[i].Position == AVCaptureDevicePosition.Front)
{
cameraID = AVCaptureDevice.DevicesWithMediaType(AVMediaType.Video)[i].LocalizedName;
break;
}
}
//do something
RTCVideoCapturer capturer = RTCVideoCapturer.CapturerWithDeviceName(cameraID);
RTCMediaConstraints mediaConstraints = DefaultMediaStreamConstraints();
RTCVideoSource videoSource = _factory.VideoSourceWithCapturer(capturer, mediaConstraints);
localVideoTrack = _factory.VideoTrackWithID(#"ARDAMSv0", videoSource);
}
else
{
}
});
return localVideoTrack;
}
and this is the message :
Native stacktrace:
critical: 0 libmonosgen-2.0.dylib 0x0000000100a18184 mono_handle_native_sigsegv + 260
critical: 1 libmonosgen-2.0.dylib 0x0000000100a23618 mono_sigsegv_signal_handler + 220
critical: 2 libsystem_platform.dylib 0x0000000185a08348 _sigtramp + 52
critical: 3 TestRTC 0x000000010020b1fc _ZN7cricket13VideoCapturer15SetCaptureStateENS_12CaptureStateE + 52
critical: 4 TestRTC 0x0000000100214764 _ZN7cricket19WebRtcVideoCapturer5StartERKNS_11VideoFormatE + 1084
critical: 5 TestRTC 0x000000010020b190 _ZN7cricket13VideoCapturer14StartCapturingERKNS_11VideoFormatE + 52
critical: 6 TestRTC 0x0000000100202020 _ZN7cricket14CaptureManager26StartWithBestCaptureFormatEPNS_18VideoCapturerStateEPNS_13Vi
deoCapturerE + 204
critical: 7 TestRTC 0x0000000100201ea0 _ZN7cricket14CaptureManager17StartVideoCaptureEPNS_13VideoCapturerERKNS_11VideoFormatE + 196
critical: 8 TestRTC 0x000000010028c658 _ZN3rtc21FunctorMessageHandlerIbNS_14MethodFunctor2IN7cricket14CaptureManagerEMS3_FbPNS2_13VideoCapturerERKNS2_11VideoFormatEEbS5_S8_EEE9OnMessageEPNS_7MessageE + 24
critical: 9 TestRTC 0x00000001001f10c4 ZN3rtc6Thread22ReceiveSendsFromThreadEPKS0 + 116
critical: 10 TestRTC 0x00000001001dc338 _ZN3rtc12MessageQueue3GetEPNS_7MessageEib + 156
critical: 11 TestRTC 0x00000001001f0df0 _ZN3rtc6Thread15ProcessMessagesEi + 108
TestRTC[634:2

Attempting to Display Array on to UITableView

I am attempting to display an array which I receive from a JSON Dictionary onto a UITableView but I keep getting an error. I am trying to display all the comments for a given Instagram Picture onto a Table. Here is how I am attempting to display the cells:
MessageTableViewCell *cell = (MessageTableViewCell *)[self.tableView dequeueReusableCellWithIdentifier:MessengerCellIdentifier];
NSDictionary *instaPics = self.instagramData;
NSArray *commentArray = instaPics[#"comments"][#"data"];
NSString *commentText = [commentArray valueForKey:#"text"]; // Error occurs here
Message *message = self.messages[indexPath.row];
cell.titleLabel.text = message.username;
cell.bodyLabel.text = commentText;
Here is the error I receive:
-[__NSArrayI length]: unrecognized selector sent to instance 0x7f913052db10
2015-05-05 22:16:08.848 Floadt[6061:514032] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0x7f913052db10'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107d60c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010763cbb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000107d680ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000107cbe13c ___forwarding___ + 988
4 CoreFoundation 0x0000000107cbdcd8 _CF_forwarding_prep_0 + 120
5 UIKit 0x0000000106543ab4 -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 65
6 UIKit 0x000000010654390f -[UILabel textRectForBounds:limitedToNumberOfLines:] + 76
7 UIKit 0x00000001065473b9 -[UILabel _intrinsicSizeWithinSize:] + 170
8 UIKit 0x0000000106547499 -[UILabel intrinsicContentSize] + 76
9 UIKit 0x00000001069e5b6c -[UIView(UIConstraintBasedLayout) _generateContentSizeConstraints] + 33
10 UIKit 0x00000001069e5930 -[UIView(UIConstraintBasedLayout) _updateContentSizeConstraints] + 422
11 UIKit 0x00000001069ecd25 -[UIView(AdditionalLayoutSupport) updateConstraints] + 162
12 UIKit 0x0000000106547304 -[UILabel updateConstraints] + 274
13 UIKit 0x00000001069ec346 -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 242
14 UIKit 0x00000001069ec53e -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124
15 CoreFoundation 0x0000000107c67354 CFArrayApplyFunction + 68
16 UIKit 0x00000001069ec2ed -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153
17 Foundation 0x0000000105b021be -[NSISEngine withBehaviors:performModifications:] + 155
18 UIKit 0x00000001069ec53e -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124
19 CoreFoundation 0x0000000107c67354 CFArrayApplyFunction + 68
20 UIKit 0x00000001069ec2ed -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153
21 UIKit 0x00000001069ec53e -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124
22 UIKit 0x00000001069eca0e __60-[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded]_block_invoke + 96
23 UIKit 0x00000001069ec6d6 -[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded] + 231
24 UIKit 0x00000001067d7531 -[UITableViewCellContentView updateConstraintsIfNeeded] + 94
25 UIKit 0x00000001069ecdde -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeeded] + 146
26 UIKit 0x00000001063e4a3d -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 114
27 UIKit 0x00000001063f0a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
28 QuartzCore 0x00000001061b4ec2 -[CALayer layoutSublayers] + 146
29 QuartzCore 0x00000001061a96d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
30 UIKit 0x00000001063e4675 -[UIView(Hierarchy) layoutBelowIfNeeded] + 607
31 Floadt 0x0000000104195848 -[SLKTextViewController viewWillAppear:] + 296
32 UIKit 0x00000001064a4fa1 -[UIViewController _setViewAppearState:isAnimating:] + 487
33 UIKit 0x00000001064c6395 -[UINavigationController _startCustomTransition:] + 887
34 UIKit 0x00000001064d23bf -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
35 UIKit 0x00000001064d2f0e -[UINavigationController __viewWillLayoutSubviews] + 43
36 UIKit 0x000000010661d715 -[UILayoutContainerView layoutSubviews] + 202
37 UIKit 0x00000001063f0a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
38 QuartzCore 0x00000001061b4ec2 -[CALayer layoutSublayers] + 146
39 QuartzCore 0x00000001061a96d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
40 QuartzCore 0x00000001061a9546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
41 QuartzCore 0x0000000106115886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
42 QuartzCore 0x0000000106116a3a _ZN2CA11Transaction6commitEv + 462
43 UIKit 0x000000010636d626 _UIApplicationHandleEventQueue + 2140
44 CoreFoundation 0x0000000107c94431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
45 CoreFoundation 0x0000000107c8a2fd __CFRunLoopDoSources0 + 269
46 CoreFoundation 0x0000000107c89934 __CFRunLoopRun + 868
47 CoreFoundation 0x0000000107c89366 CFRunLoopRunSpecific + 470
48 GraphicsServices 0x0000000109716a3e GSEventRunModal + 161
49 UIKit 0x0000000106370900 UIApplicationMain + 1282
50 Floadt 0x0000000104218c5f main + 111
51 libdyld.dylib 0x0000000109f2b145 start + 1
52 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Here is an example copy of the JSON:
{
attribution = "<null>";
caption = {
"created_time" = 1430877943;
from = {
"full_name" = "Shreya M.";
id = 25085898;
"profile_picture" = "https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-19/10890672_320752588135679_1815913692_a.jpg";
username = "shreya_mandava";
};
id = 978597576956579585;
text = "9+10????";
};
comments = {
count = 2;
data = (
{
"created_time" = 1430878007;
from = {
"full_name" = "Aleesha Toteja";
id = 17117902;
"profile_picture" = "https://instagramimages-a.akamaihd.net/profiles/profile_17117902_75sq_1373927314.jpg";
username = leeshtotes;
};
id = 978598112887967529;
text = "DIRT \Ud83d\Ude3b";
},
{
"created_time" = 1430878307;
from = {
"full_name" = "Shritha M.";
id = 375799796;
"profile_picture" = "https://igcdn-photos-f-a.akamaihd.net/hphotos-ak-xpf1/t51.2885-19/10454159_1056687271012469_2048676049_a.jpg";
username = "shritha_m";
};
id = 978600630846098439;
text = sigh;
}
);
};
"created_time" = 1430877943;
filter = Normal;
id = "978597574314167442_25085898";
images = {
"low_resolution" = {
height = 306;
url = "https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s306x306/e15/11241842_1401517966839213_670743424_n.jpg";
width = 306;
};
"standard_resolution" = {
height = 640;
url = "https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/e15/11241842_1401517966839213_670743424_n.jpg";
width = 640;
};
thumbnail = {
height = 150;
url = "https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s150x150/e15/11241842_1401517966839213_670743424_n.jpg";
width = 150;
};
};
likes = {
count = 22;
data = (
{
"full_name" = "Ronak Chopra";
id = 347652824;
"profile_picture" = "https://scontent.cdninstagram.com/hphotos-xpa1/t51.2885-19/11142328_1644920965736964_1040275960_a.jpg";
username = "conak_rhopra";
},
{
"full_name" = "emily bach";
id = 292615252;
"profile_picture" = "https://igcdn-photos-a-a.akamaihd.net/hphotos-ak-xap1/t51.2885-19/10454121_1558984144374824_122699173_a.jpg";
username = "emily_bach_";
},
{
"full_name" = "\Ud83c\Udf38Trisha\Ud83c\Udf38";
id = 303629882;
"profile_picture" = "https://igcdn-photos-g-a.akamaihd.net/hphotos-ak-xfp1/t51.2885-19/10955125_708435799269374_749376734_a.jpg";
username = trishddishh;
},
{
"full_name" = "Shritha M.";
id = 375799796;
"profile_picture" = "https://igcdn-photos-f-a.akamaihd.net/hphotos-ak-xpf1/t51.2885-19/10454159_1056687271012469_2048676049_a.jpg";
username = "shritha_m";
}
);
};
link = "https://instagram.com/p/2UrU8bDgyS/";
location = {
id = 772010926;
latitude = "38.913782928";
longitude = "-77.383238738";
name = "ft. dirt";
};
tags = (
);
type = image;
user = {
"full_name" = "Shreya M.";
id = 25085898;
"profile_picture" = "https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-19/10890672_320752588135679_1815913692_a.jpg";
username = "shreya_mandava";
};
"user_has_liked" = 0;
"users_in_photo" = (
{
position = {
x = "0.6703125";
y = "0.246875";
};
user = {
"full_name" = "John Nguyen";
id = 1477626916;
"profile_picture" = "https://igcdn-photos-d-a.akamaihd.net/hphotos-ak-xfp1/t51.2885-19/11018467_1431648953794187_659343544_a.jpg";
username = bumbonguyen;
};
}
);
}
You are trying to get a value from key in a NSArray on:
[commentArray valueForKey:#"text"];
NSArray is not a dictionary has not keys (has multiple comments), should be accessed by his index.
[[commentArray objectAtIndex:0] valueForKey:#"text"];
Probably you will want, iterate over the comments and on each comment get his "text"
You can replace this line :
NSString *commentText = [commentArray valueForKey:#"text"];
with
for (NSDictionary *comment in commentArray ) {
NSString *commentText = [comment valueForKey:#"text"];
cell.bodyLabel.text = commentText;
}
Gonzalo is right. Your accessing commentArray like a NSDictionary but it is actually a NSArray. That causes the crash.
NSArray *commentArray = instaPics[#"comments"][#"data"];
It looks like a wrong access of key value..
As per my understanding you are trying to get value of comments.
your Json data contains root & child key value like,
comments
count
Data
caption
images
likes
...
Here your Comments having child value like count,data.
So can write the code to fetch value of comment > data>text
--------1--------
NSMutableDictionary *response = [[[json valueForKey:#"comments"] objectAtIndex:0]mutableCopy];
NSMutableDictionary *data = [[[response valueForKey:#"data"] objectAtIndex:0]mutableCopy];
NSString *text = [data valueForKey:#"text"];
----OR----2--------
NSMutableDictionary *response = [[[json valueForKey:#"comments"] objectAtIndex:0]mutableCopy];
NSArray *textarr=[response valueForKey:#"text"];

SIGSEV on [S3Request configureURLRequest:] on Amazon AWS iOS SDK

I have an intermittent crash bug when posting images to an S3 bucket using the iOS SDK.
These crash bugs are formed of 2 errors, but originate in the same area of the SDK.
SEGSEV
0 ofs staff 0x00282616 testflight_backtrace + 382
1 ofs staff 0x00283264 TFSignalHandler + 264
2 libsystem_c.dylib 0x3b656e92 _sigtramp + 42
3 ofs staff 0x001c74a6 -S3Request configureURLRequest (S3Request.m:41)
4 ofs staff 0x001b3c1a -S3AbstractPutRequest configureURLRequest (S3AbstractPutRequest.m:27)
5 ofs staff 0x001c61ee -S3PutObjectRequest configureURLRequest (S3PutObjectRequest.m:62)
6 ofs staff 0x001b2bfe -AmazonS3Client signS3Request: (AmazonS3Client.m:579)
7 ofs staff 0x001b22aa -AmazonS3Client invoke: (AmazonS3Client.m:450)
8 ofs staff 0x001b1298 -AmazonS3Client putObject: (AmazonS3Client.m:134)
9 ofs staff 0x000d511e -OFSAmazonS3Client putObject: (OFSAmazonS3Client.m:41)
10 ofs staff 0x00099b02 -OFSAWSFileUploader upload:forTask:toAWSBucket:accessKey:secret:error: (OFSAWSFileUploader.m:120)
11 ofs staff 0x000d442c -OFSPhotoActivityUploadCell startUpload (OFSPhotoActivityUploadCell.m:104)
12 UIKit 0x354260c4 -UIApplication sendAction:to:from:forEvent: + 72
13 UIKit 0x35426076 -UIApplication sendAction:toTarget:fromSender:forEvent: + 30
14 UIKit 0x35426054 -UIControl sendAction:to:forEvent: + 44
15 UIKit 0x3542590a -UIControl(Internal) _sendActionsForEvents:withEvent: + 502
16 UIKit 0x35425e00 -UIControl touchesEnded:withEvent: + 488
17 UIKit 0x35344420 _UIGestureRecognizerUpdate + 5768
18 CoreFoundation 0x335086cc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
19 CoreFoundation 0x335069c0 __CFRunLoopDoObservers + 276
20 CoreFoundation 0x33506d16 __CFRunLoopRun + 742
21 CoreFoundation 0x33479ebc CFRunLoopRunSpecific + 356
22 CoreFoundation 0x33479d48 CFRunLoopRunInMode + 104
23 GraphicsServices 0x3703d2ea GSEventRunModal + 74
24 UIKit 0x3538f300 UIApplicationMain + 1120
25 ofs staff 0x00082e36 main (main.m:16)
26 libdyld.dylib 0x3b60fb1f start + 3
-__NSCFNumber requestFormat: unrecognized selector sent to instance 0x1d43cfc0
0 CoreFoundation 0x335332a3 __exceptionPreprocess + 163
1 libobjc.A.dylib 0x3b1d897f objc_exception_throw + 31
2 CoreFoundation 0x33536e07 -NSObject(NSObject) doesNotRecognizeSelector: + 171
3 CoreFoundation 0x33535531 ___forwarding___ + 393
4 CoreFoundation 0x3348cf68 _CF_forwarding_prep_0 + 24
5 ofs staff 0x001f84a7 -S3Request configureURLRequest (S3Request.m:41)
6 ofs staff 0x001e4c1b -S3AbstractPutRequest configureURLRequest (S3AbstractPutRequest.m:29)
7 ofs staff 0x001f71ef -S3PutObjectRequest configureURLRequest (S3PutObjectRequest.m:64)
8 ofs staff 0x001e3bff -AmazonS3Client signS3Request: (AmazonS3Client.m:579)
9 ofs staff 0x001e32ab -AmazonS3Client invoke: (AmazonS3Client.m:450)
10 ofs staff 0x001e2299 -AmazonS3Client putObject: (AmazonS3Client.m:134)
11 ofs staff 0x0010611f -OFSAmazonS3Client putObject: (OFSAmazonS3Client.m:41)
12 ofs staff 0x000cab03 -OFSAWSFileUploader upload:forTask:toAWSBucket:accessKey:secret:error: (OFSAWSFileUploader.m:120)
13 ofs staff 0x0010542d -OFSPhotoActivityUploadCell startUpload (OFSPhotoActivityUploadCell.m:104)
14 UIKit 0x354260c5 -UIApplication sendAction:to:from:forEvent: + 73
15 UIKit 0x35426077 -UIApplication sendAction:toTarget:fromSender:forEvent: + 31
16 UIKit 0x35426055 -UIControl sendAction:to:forEvent: + 45
17 UIKit 0x3542590b -UIControl(Internal) _sendActionsForEvents:withEvent: + 503
18 UIKit 0x35425e01 -UIControl touchesEnded:withEvent: + 489
19 UIKit 0x35344421 _UIGestureRecognizerUpdate + 5769
20 CoreFoundation 0x335086cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
21 CoreFoundation 0x335069c1 __CFRunLoopDoObservers + 277
22 CoreFoundation 0x33506d17 __CFRunLoopRun + 743
23 CoreFoundation 0x33479ebd CFRunLoopRunSpecific + 357
24 CoreFoundation 0x33479d49 CFRunLoopRunInMode + 105
25 GraphicsServices 0x3703d2eb GSEventRunModal + 75
26 UIKit 0x3538f301 UIApplicationMain + 1121
27 ofs staff 0x000b3e37 main (main.m:16)
28 libdyld.dylib 0x3b60fb20 start + 0
Both errors are focussed around line 41 of S3Request.m which reads
[self.urlRequest setValue:self.host forHTTPHeaderField:kHttpHdrHost];
These errors are intemittent and so far I have been unable to replicate the issue exactly, so don't know what the value of self.host when the app crashes.
When the upload succeeds, the value for host is the correct bucket name.
To try and replicate this I have tried to run the requests with the host name set to nil, set to an incorrect bucket name, on wifi, 3G and with no connectivity but none of these conditions causes either condition to occur.
Does anyone know what is causing these issues and therefore what I may have to do to fix them?
===UPDATE===
I finally managed to replicate it, i have no idea how. I just got the SIGSEV.
This is the status of the request object at the the S3Request object at the time of the error
(S3PutObjectRequest) S3PutObjectRequest = {
S3AbstractPutRequest = {
S3Request = {
AmazonServiceRequest = {
NSObject = {
isa = OFSS3PutObjectRequest
}
httpMethod = 0x004bde08 #"GET"
parameters = 0x00000000
endpoint = 0x004c3a38 #"https://s3.amazonaws.com"
userAgent = 0x1d427b60 #"aws-sdk-iOS/1.4.4 iPhone-OS/6.0.1 en_GB"
credentials = 0x00000000
urlRequest = 0x1d1165f0
urlConnection = 0x1d04d680
responseTimer = 0x00000000
requestTag = 0x00000000
serviceName = 0x00000000
regionName = 0x00000000
hostName = 0x00000000
delegate = 0x1c567ba0
}
authorization = 0x00000000
contentLength = 0
contentType = 0x004b9e28 #"image/jpeg"
date = 0x1d0e8340 <not an Objective-C object>
securityToken = 0x00000000
bucket = 0x1d4464f0 #"*****"
key = 0x1d1eb040 #"id_C78ACBEA_58163_0.jpg"
subResource = 0x00000000
}
cannedACL = 0x00000000
fullACL = 0x00000000
storageClass = 0x00000000
serverSideEncryption = 0x00000000
metadata = 0x1d2d6700 0 key/value pairs
}
expiresSet = NO
cacheControl = 0x00000000
contentDisposition = 0x00000000
contentEncoding = 0x00000000
contentMD5 = 0x00000000
filename = 0x00000000
data = 0x1d1a9f00 3814479 bytes
stream = 0x00000000
expect = 0x00000000
generateMD5 = NO
expires = 0
redirectLocation = 0x00000000
}

App crashes after Monotouch update to 5.2.13

After I have updated monotouch to Version 5.2.13 my App crashes when I touched inside a UIButton.
About my Code: (it's a question of a LoginView):
I have a UIViewController which includes a ScrollView.
For each User the ScrollView provides a UIView (the UserImageView).
This UserImageView contains a UserImage, Username and so on. Over the UserImage lays a UIButton which should catches the Touch-Events to selected a User.
This Button causes the Exception below more precisely the HitTest method from the UIView.
I get the following Stacktrace:
Stacktrace:
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at MF.Stationaer.iPad.Application.Main (string[]) <IL 0x00028, 0x00073>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Native stacktrace:
0 MFiPad_MD 0x0009061c mono_handle_native_sigsegv + 284
1 MFiPad_MD 0x000059a8 mono_sigsegv_signal_handler + 248
2 libsystem_c.dylib 0x92cd259b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 UIKit 0x0228c741 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke_0 + 96
5 CoreFoundation 0x0116cf1a __NSArrayChunkIterate + 362
6 CoreFoundation 0x01138635 __NSArrayEnumerate + 997
7 CoreFoundation 0x01138026 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 102
8 UIKit 0x0228c66b -[UIView(Geometry) hitTest:withEvent:] + 646
9 UIKit 0x0228c765 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke_0 + 132
10 CoreFoundation 0x0116cf1a __NSArrayChunkIterate + 362
11 CoreFoundation 0x01138635 __NSArrayEnumerate + 997
12 CoreFoundation 0x01138026 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 102
13 UIKit 0x0228c66b -[UIView(Geometry) hitTest:withEvent:] + 646
14 UIKit 0x022a1157 -[UIScrollView hitTest:withEvent:] + 79
15 UIKit 0x0228c765 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke_0 + 132
16 CoreFoundation 0x0116cf1a __NSArrayChunkIterate + 362
17 CoreFoundation 0x01138635 __NSArrayEnumerate + 997
18 CoreFoundation 0x01138026 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 102
19 UIKit 0x0228c66b -[UIView(Geometry) hitTest:withEvent:] + 646
20 UIKit 0x0228c765 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke_0 + 132
21 CoreFoundation 0x0116cf1a __NSArrayChunkIterate + 362
22 CoreFoundation 0x01138635 __NSArrayEnumerate + 997
23 CoreFoundation 0x01138026 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 102
24 UIKit 0x0228c66b -[UIView(Geometry) hitTest:withEvent:] + 646
25 UIKit 0x0228c765 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke_0 + 132
26 CoreFoundation 0x0116cf1a __NSArrayChunkIterate + 362
27 CoreFoundation 0x01138635 __NSArrayEnumerate + 997
28 CoreFoundation 0x01138026 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 102
29 UIKit 0x0228c66b -[UIView(Geometry) hitTest:withEvent:] + 646
30 UIKit 0x02286dbd +[UIWindow _hitTestToPoint:pathIndex:forEvent:] + 378
31 UIKit 0x02258ca0 _UIApplicationHandleEvent + 1648
32 GraphicsServices 0x047c5ef5 PurpleEventCallback + 1274
33 CoreFoundation 0x011a9195 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
34 CoreFoundation 0x0110dff2 __CFRunLoopDoSource1 + 146
35 CoreFoundation 0x0110c8da __CFRunLoopRun + 2218
36 CoreFoundation 0x0110bd84 CFRunLoopRunSpecific + 212
37 CoreFoundation 0x0110bc9b CFRunLoopRunInMode + 123
38 GraphicsServices 0x047c47d8 GSEventRunModal + 190
39 GraphicsServices 0x047c488a GSEventRun + 103
40 UIKit 0x02258626 UIApplicationMain + 1163
41 ??? 0x0b96e514 0x0 + 194438420
42 ??? 0x0b96d6c0 0x0 + 194434752
43 ??? 0x0b96d33c 0x0 + 194433852
44 ??? 0x0b96d42f 0x0 + 194434095
45 MFiPad_MD 0x00009d12 mono_jit_runtime_invoke + 722
46 MFiPad_MD 0x00169e4e mono_runtime_invoke + 126
47 MFiPad_MD 0x0016df34 mono_runtime_exec_main + 420
48 MFiPad_MD 0x001732e5 mono_runtime_run_main + 725
49 MFiPad_MD 0x00066f15 mono_jit_exec + 149
50 MFiPad_MD 0x002115d5 main + 2837
51 MFiPad_MD 0x00002d65 start + 53
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.
Here is the important Part of my Code:
public class LoginViewController : UIViewController
{
...
public override void ViewDidLoad()
{
...
BuildUserUI();
...
}
private void BuildUserUI()
{
currentIconLocation = new PointF(50, 10);
for (var i = 0; i < UserList.List.Count; i++)
CreateUserInGrid(UserList.GetUserByIndex(i));
}
private void CreateUserInGrid(LoginUser user)
{
var imgFrame = new RectangleF(currentIconLocation.X, currentIconLocation.Y, 140, 170);
var loginImg = new UILoginImage(imgFrame);
loginImg.Image = user.Image ?? defaultUserImage.CGImage;
loginImg.Name = user.Nachname;
if (!string.IsNullOrEmpty(user.Vorname))
loginImg.Name += ", " + user.Vorname;
loginImg.Tag = user.UserIndex;
loginImg.AddTarget(this, new Selector("ShowNumberPad:"), UIControlEvent.TouchUpInside);
loginImg.LoginUser = user;
scrollView.AddSubview(loginImg);
loginImages.Add(loginImg);
limitedScrollView.UserInteractionEnabled = false;
var newSize = new SizeF(scrollView.Frame.Size.Width, currentIconLocation.Y + imgFrame.Size.Height + 20);
scrollView.ContentSize = newSize;
limitedScrollView.ContentSize = new SizeF(limitedScrollView.Frame.Size.Width, limitedScrollView.Frame.Size.Height);
currentIconLocation.X += imgFrame.Size.Width;
if (currentIconLocation.X + imgFrame.Size.Width > scrollView.Frame.Size.Width)
{
currentIconLocation.Y += imgFrame.Size.Height;
currentIconLocation.X = 50;
}
}
[Export("ShowNumberPad:")]
private void ShowNumberPad(NSObject sender)
{
...
}
}
public class UILoginImage : UIView
{
[Export("initWithFrame:")]
public UILoginImage(RectangleF frame)
: base(frame)
{
var shadowFrame = new RectangleF(0, 0, 117, 148);
wrapperControl = new UIControl(shadowFrame);
AddSubview(wrapperControl);
shadowImage = new UIImageView(shadowFrame);
shadowImage.Image = ImageCache.GetResourceImage("Images/Login/LoginSchatten.png");
wrapperControl.AddSubview(shadowImage);
var mainBackFrame = new RectangleF(8, 9, 98, 128);
whiteBackgroundImage = new UIImageView(mainBackFrame);
whiteBackgroundImage.Image = ImageCache.GetResourceImage("Images/Login/Singlewhite.png");
wrapperControl.AddSubview(whiteBackgroundImage);
var imageFrame = new RectangleF(13, 15, 87, 116);
clickHelper = UIButton.FromType(UIButtonType.Custom);
clickHelper.Frame = imageFrame;
wrapperControl.AddSubview(clickHelper);
userImage = new UIImageView(imageFrame);
AddSubview(userImage);
var mitarbeiterlabelFrame = new RectangleF(-12, 137, 140, 25);
mitarbeiterNameLabel = new FontSizeLabel(mitarbeiterlabelFrame);
mitarbeiterNameLabel.TextAlignment = UITextAlignment.Center;
mitarbeiterNameLabel.Font = UIFont.SystemFontOfSize(12);
mitarbeiterNameLabel.Opaque = false;
mitarbeiterNameLabel.BackgroundColor = UIColor.Clear;
AddSubview(mitarbeiterNameLabel);
var benutzerlabelFrame = new RectangleF(mitarbeiterlabelFrame.X, mitarbeiterlabelFrame.Y + 13, 140, 25);
benutzerNameLabel = new FontSizeLabel(benutzerlabelFrame);
benutzerNameLabel.TextAlignment = UITextAlignment.Center;
benutzerNameLabel.Font = UIFont.SystemFontOfSize(10);
benutzerNameLabel.Opaque = false;
benutzerNameLabel.BackgroundColor = UIColor.Clear;
benutzerNameLabel.TextColor = UIColor.DarkGray;
AddSubview(benutzerNameLabel);
}
public void AddTarget(NSObject target, Selector action, UIControlEvent controlEvents)
{
clickHelper.AddTarget(target, action, controlEvents);
}
public void RemoveTarget(NSObject target, Selector action, UIControlEvent controlEvents)
{
clickHelper.RemoveTarget(target, action, controlEvents);
}
}
I'm not sure your use of AddTarget is a good way to hook up a UIButton's click.
You should be using clickHelper.TouchUpInside to wire up click events. This is a standard C# event.
Another option would be to wire up an action to this event inside your XIB file in XCode.

Resources