[英]Getting dysmutil malloc error when using nstask Tool Exited with code 134
This is the code i am using to generate ios build using nstask in my cocoa app. 这是我在可可应用程序中使用nstask生成ios构建的代码。
NSTask *task=[[NSTask alloc]init];
task.launchPath=@"/library/Frameworks/Mono.Framework/Commands/xbuild";
task.arguments= @[@"/p:Configuration=Release",@"/p:Platform=iPhone",@"/p:BuildIpa=false",@"/target:Build",@"/Users/xyz/Projects/SimpleDemo/SimpleDemo.sln"];
NSPipe *pipe=[[NSPipe alloc]init];
[task setStandardOutput:pipe];
NSFileHandle *outputFileHandle;
outputFileHandle = [[NSFileHandle alloc]init];
outputFileHandle=[pipe fileHandleForReading];
[outputFileHandle waitForDataInBackgroundAndNotify];
[[NSNotificationCenter defaultCenter] addObserverForName:NSFileHandleDataAvailableNotification object:outputFileHandle queue:nil usingBlock:^(NSNotification *notification){
NSData *output = [outputFileHandle availableData];
NSString *outStr = [[NSString alloc] initWithData:output encoding:NSUTF8StringEncoding];
NSLog(@"%@",outStr);
[outputFileHandle waitForDataInBackgroundAndNotify];
}];
@try {
[task launch];
[task waitUntilExit];
}
@catch (NSException *exception) {
NSLog(@"%@",[exception callStackSymbols]);
}
@finally {
}
i am getting this error while running the code 我在运行代码时遇到此错误
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iO S.Common.targets: error : Tool exited with code: 134. Output: warning: (armv7) could not find object file symbol for symbol _xamarin_register_modules warning: (armv7) could not find object file symbol for symbol _xamarin_register_assemblies warning: (armv7) could not find object file symbol for symbol _xamarin_setup warning: (armv7) could not find object file symbol for symbol _main warning: (armv7) could not find object file symbol for symbol _OBJC_METACLASS_$_MonoTouchAppDelegate warning: (armv7) could not find object file symbol for symbol _OBJC_CLASS_$_MonoTouchAppDelegate /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iO S.Common.targets:错误:工具退出,代码为134。输出:警告:(armv7)找不到符号的目标文件符号_xamarin_register_modules警告:(armv7)找不到符号_xamarin_register_assemblies警告:(armv7)找不到符号_xamarin_setup警告的目标文件符号:(armv7)找不到符号_main警告的目标文件符号:(armv7)找不到查找符号_OBJC_METACLASS _ $ _ MonoTouchAppDelegate的目标文件符号警告:(armv7)找不到符号_OBJC_CLASS _ $ _ MonoTouchAppDelegate的目标文件符号
dsymutil(6764,0x7fff78631000) malloc: * error for object 0x6000000fb400: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug dsymutil(6764,0x7fff78631000)malloc: *对象0x6000000fb400错误:未分配释放的指针*在malloc_error_break中设置一个断点以进行调试
In this build process error comes after .app generation means there is problem after .app generation. 在此生成过程中,.app生成后出现错误,这意味着.app生成后出现问题。
Note:if i run this command using terminal then it works without any error and .ipa gets generated.Problem is only when i use nstask to run this command. 注意:如果我使用终端运行此命令,则它将正常工作并且不会生成.ipa。问题仅在我使用nstask运行此命令时出现。
i am using el capitan and xcode 7.1.1. 我正在使用el capitan和xcode 7.1.1。 Any help would be appreciated.
任何帮助,将不胜感激。
As per the suggestion from @Itachi, issue is regarding the MallocNanoZone being enabled. 根据@Itachi的建议,问题在于是否启用了MallocNanoZone。 This needs to be removed from the environment of NSTask explicitly.
这需要从NSTask环境中明确删除。
Here is the code which I got from IPABuddy 这是我从IPABuddy获得的代码
NSTask *task=[[NSTask alloc]init];
NSMutableDictionary *theEnvironment = [[NSProcessInfo processInfo].environment mutableCopy];
if (theEnvironment[@"MallocNanoZone"])
{
[theEnvironment removeObjectForKey:@"MallocNanoZone"];
}
task.environment = theEnvironment;
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.