Open albertodebortoli opened 10 years ago
The current version of librabbitmq-objc does not support latest versions of rabbitmq-c (https://github.com/alanxz/rabbitmq-c/releases): 0.5.0, 0.4.1 and maybe also previous ones.
My fork of librabbitmq-objc (https://github.com/albertodebortoli/librabbitmq-objc) contains an Xcode project using rabbitmq-c 0.5.0 and it crashes with a single line of code:
AMQPConnection *conn = [[AMQPConnection alloc] init];
When the AMQPConnection object is deallocated
[self disconnect];
in the dealloc method crashes the app. I think the problem relies in socketFD that is 0.
socketFD
Even calling
- (void)connectToHost:(NSString*)host onPort:(int)port
right after the creation of the object doesn't help.
rabbitmq-c static library has been built for all the architectures using the script at https://github.com/albertodebortoli/librabbitmq-objc/blob/master/rabbitmq-c/build-scripts/build-static-library.sh
The Xcode project uses CocoaPods to install librabbitmq-objc v1.0.0 (tag created on my fork) and the podspec is hosted in my CocoaPods repository at https://github.com/albertodebortoli/adbcocoapodsrepository.
With CocoaPods installed, the repo che be added as described here http://guides.cocoapods.org/making/private-cocoapods.html
basically:
$ pod repo add ADBCocoaPodsRepository https://github.com/albertodebortoli/adbcocoapodsrepository
the stack trace of the crash is
* thread #1: tid = 0x295b8, 0x01d0a952 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread, stop reason = signal SIGABRT frame #0: 0x01d0a952 libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x01dfc167 libsystem_pthread.dylib`pthread_kill + 101 frame #2: 0x0196ad8b libsystem_sim_c.dylib`abort + 140 frame #3: 0x0194ca96 libsystem_sim_c.dylib`__assert_rtn + 267 frame #4: 0x0000995c librabbitmq-objc-demo`amqp_socket_send(self=<unavailable>, buf=<unavailable>, len=<unavailable>) + 76 at amqp_socket.c:200 frame #5: 0x00003eb1 librabbitmq-objc-demo`amqp_send_frame(state=<unavailable>, frame=<unavailable>) + 337 at amqp_connection.c:508 frame #6: 0x0000b0e3 librabbitmq-objc-demo`amqp_simple_rpc [inlined] amqp_send_method(decoded=<unavailable>, id=<unavailable>, channel=0, state=0x0762a990) + 48 at amqp_socket.c:947 frame #7: 0x0000b0b3 librabbitmq-objc-demo`amqp_simple_rpc(state=0x0762a990, channel=0, request_id=655410, expected_reply_ids=0x0762a990, decoded_request_method=0xbfffd9d8) + 3 at amqp_socket.c:972 frame #8: 0x00003408 librabbitmq-objc-demo`amqp_connection_close(state=0x0762a990, code=200) + 152 at amqp_api.c:285 frame #9: 0x0000d5a9 librabbitmq-objc-demo`-[AMQPConnection disconnect](self=0x0762a830, _cmd=0x0416c975) + 73 at AMQPConnection.m:73 frame #10: 0x0000d271 librabbitmq-objc-demo`-[AMQPConnection dealloc](self=0x0762a830, _cmd=0x018feabe) + 49 at AMQPConnection.m:44 frame #11: 0x0116b9ff libobjc.A.dylib`-[NSObject release] + 47 frame #12: 0x0116a0d5 libobjc.A.dylib`objc_release + 69 frame #13: 0x0116afda libobjc.A.dylib`objc_storeStrong + 39 frame #14: 0x00002c82 librabbitmq-objc-demo`-[AppDelegate application:didFinishLaunchingWithOptions:](self=0x075318b0, _cmd=0x0085bc21, application=0x075302e0, launchOptions=0x00000000) + 658 at CTXAppDelegate.m:29 frame #15: 0x002c2157 UIKit`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266 frame #16: 0x002c2747 UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248 frame #17: 0x002c394b UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805 frame #18: 0x002d4cb5 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1022 frame #19: 0x002d5beb UIKit`-[UIApplication sendEvent:] + 85 frame #20: 0x002c7698 UIKit`_UIApplicationHandleEvent + 9874 frame #21: 0x025b0df9 GraphicsServices`_PurpleEventCallback + 339 frame #22: 0x025b0ad0 GraphicsServices`PurpleEventCallback + 46 frame #23: 0x012a7bf5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53 frame #24: 0x012a7962 CoreFoundation`__CFRunLoopDoSource1 + 146 frame #25: 0x012d8bb6 CoreFoundation`__CFRunLoopRun + 2118 frame #26: 0x012d7f44 CoreFoundation`CFRunLoopRunSpecific + 276 frame #27: 0x012d7e1b CoreFoundation`CFRunLoopRunInMode + 123 frame #28: 0x002c317a UIKit`-[UIApplication _run] + 774 frame #29: 0x002c4ffc UIKit`UIApplicationMain + 1211 frame #30: 0x00002fad librabbitmq-objc-demo`main(argc=1, argv=0xbffff0d8) + 141 at main.m:16
could you fix your wrapper library to support recent versions of rabbitmq-c please?
Have you succeeded?
Hi Alexander,
as I am not currently a Mac user, maintenance is a bit of a chore. I will spend a day on it in the near future and look into all the reported issues.
The current version of librabbitmq-objc does not support latest versions of rabbitmq-c (https://github.com/alanxz/rabbitmq-c/releases): 0.5.0, 0.4.1 and maybe also previous ones.
My fork of librabbitmq-objc (https://github.com/albertodebortoli/librabbitmq-objc) contains an Xcode project using rabbitmq-c 0.5.0 and it crashes with a single line of code:
AMQPConnection *conn = [[AMQPConnection alloc] init];
When the AMQPConnection object is deallocated
[self disconnect];
in the dealloc method crashes the app. I think the problem relies in
socketFD
that is 0.Even calling
- (void)connectToHost:(NSString*)host onPort:(int)port
right after the creation of the object doesn't help.
rabbitmq-c static library has been built for all the architectures using the script at https://github.com/albertodebortoli/librabbitmq-objc/blob/master/rabbitmq-c/build-scripts/build-static-library.sh
The Xcode project uses CocoaPods to install librabbitmq-objc v1.0.0 (tag created on my fork) and the podspec is hosted in my CocoaPods repository at https://github.com/albertodebortoli/adbcocoapodsrepository.
With CocoaPods installed, the repo che be added as described here http://guides.cocoapods.org/making/private-cocoapods.html
basically:
$ pod repo add ADBCocoaPodsRepository https://github.com/albertodebortoli/adbcocoapodsrepository
the stack trace of the crash is
could you fix your wrapper library to support recent versions of rabbitmq-c please?