I setup a local ipv6 environment following https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1
I have a very simple iOS Xamarin project where i do nothing but:
WebRequest req = WebRequest.Create("http://109.68.230.138");
WebResponse response = req.GetResponse(); //exception
var dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
At line 2 i get the following exception. Would be great if anyone knows how this should behave or how to get this running. I guess passing ipv4 addresses is still a commom use case.
Unhandled Exception:
System.Net.WebException: Error: ConnectFailure (Network is unreachable) ---> System.Net.Sockets.SocketException: Network is unreachable
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000cb] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net.Sockets/Socket.cs:1313
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x001c2] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/WebConnection.cs:195
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00065] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1025
at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1037
at Test.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication application, Foundation.NSDictionary launchOptions) [0x0000d] in /Users/xxx/Projects/Test/iOS/AppDelegate.cs:26
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at Test.iOS.Application.Main (System.String[] args) [0x00008] in /Users/xxx/Projects/Test/iOS/Main.cs:17
2016-11-09 09:34:32.194 Test.iOS[763:313310] Unhandled managed exception:
Error: ConnectFailure (Network is unreachable) (System.Net.WebException)
at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00065] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1025
at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:1037
at Test.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication application, Foundation.NSDictionary launchOptions) [0x0000d] in /Users/xxx/Projects/Test/iOS/AppDelegate.cs:26
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at Test.iOS.Application.Main (System.String[] args) [0x00008] in /Users/xxx/Projects/Test/iOS/Main.cs:17
--- inner exception ---
Network is unreachable (System.Net.Sockets.SocketException)
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000cb] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net.Sockets/Socket.cs:1313
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x001c2] in /Users/builder/data/lanes/3859/b638977c/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/WebConnection.cs:195
2016-11-09 09:34:32.195 Test.iOS[763:313310] critical: Stacktrace:
2016-11-09 09:34:32.195 Test.iOS[763:313310] critical:
Native stacktrace:
2016-11-09 09:34:32.265 Test.iOS[763:313310] critical: 0 libmonosgen-2.0.dylib 0x00000001001abd0c mono_handle_native_sigsegv + 260
2016-11-09 09:34:32.266 Test.iOS[763:313310] critical: 1 libsystem_platform.dylib 0x0000000192eec348 _sigtramp + 52
2016-11-09 09:34:32.266 Test.iOS[763:313310] critical: 2 libsystem_pthread.dylib 0x0000000192ef2450 pthread_kill + 112
2016-11-09 09:34:32.266 Test.iOS[763:313310] critical: 3 libsystem_c.dylib 0x0000000192d9e3e0 abort + 140
2016-11-09 09:34:32.267 Test.iOS[763:313310] critical: 4 libxamarin-debug.dylib 0x0000000100480d90 _ZL20print_all_exceptionsP10MonoObject + 0
2016-11-09 09:34:32.267 Test.iOS[763:313310] critical: 5 libmonosgen-2.0.dylib 0x00000001001ac59c mono_invoke_unhandled_exception_hook + 100
2016-11-09 09:34:32.267 Test.iOS[763:313310] critical: 6 libmonosgen-2.0.dylib 0x00000001001ab830 mono_handle_exception_internal + 3860
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 7 libmonosgen-2.0.dylib 0x00000001001aa910 mono_handle_exception + 40
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 8 libmonosgen-2.0.dylib 0x00000001001a1be4 mono_arm_throw_exception + 216
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 9 libmscorlib.dll.dylib 0x00000001007a9918 throw_exception + 168
2016-11-09 09:34:32.268 Test.iOS[763:313310] critical: 10 libSystem.dll.dylib 0x0000000100bbac44 System_Net_HttpWebRequest_EndGetResponse_System_IAsyncResult + 388
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 11 libSystem.dll.dylib 0x0000000100bbacc0 System_Net_HttpWebRequest_GetResponse + 112
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 12 libTest.iOS.exe.dylib 0x00000001000770b4 Test_iOS_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary + 276
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 13 libmscorlib.dll.dylib 0x0000000100786db4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
2016-11-09 09:34:32.269 Test.iOS[763:313310] critical: 14 libmonosgen-2.0.dylib 0x00000001001ba1dc mono_jit_runtime_invoke + 1772
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 15 libmonosgen-2.0.dylib 0x000000010022ad0c do_runtime_invoke + 112
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 16 libmonosgen-2.0.dylib 0x000000010022ac68 mono_runtime_invoke + 208
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 17 Test.iOS 0x000000010005c62c _ZL30native_to_managed_trampoline_5P11objc_objectP13objc_selectorPP11_MonoMethodP13UIApplicationP12NSDictionaryPKcSB_SB_SB_ + 692
2016-11-09 09:34:32.270 Test.iOS[763:313310] critical: 18 Test.iOS 0x000000010005c368 -[AppDelegate application:didFinishLaunchingWithOptions:] + 96
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 19 UIKit 0x0000000199d20100 <redacted> + 400
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 20 UIKit 0x0000000199f30858 <redacted> + 3524
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 21 UIKit 0x0000000199f365c8 <redacted> + 1656
2016-11-09 09:34:32.271 Test.iOS[763:313310] critical: 22 UIKit 0x0000000199f4ae60 <redacted> + 48
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 23 UIKit 0x0000000199f335ac <redacted> + 168
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 24 FrontBoardServices 0x0000000195a018bc <redacted> + 36
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 25 FrontBoardServices 0x0000000195a01728 <redacted> + 176
2016-11-09 09:34:32.272 Test.iOS[763:313310] critical: 26 FrontBoardServices 0x0000000195a01ad0 <redacted> + 56
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 27 CoreFoundation 0x0000000193e08278 <redacted> + 24
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 28 CoreFoundation 0x0000000193e07bc0 <redacted> + 524
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 29 CoreFoundation 0x0000000193e057c0 <redacted> + 804
2016-11-09 09:34:32.273 Test.iOS[763:313310] critical: 30 CoreFoundation 0x0000000193d34048 CFRunLoopRunSpecific + 444
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 31 UIKit 0x0000000199d192b0 <redacted> + 608
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 32 UIKit 0x0000000199d14034 UIApplicationMain + 208
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 33 libXamarin.iOS.dll.dylib 0x0000000100514fb4 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 324
2016-11-09 09:34:32.274 Test.iOS[763:313310] critical: 34 libXamarin.iOS.dll.dylib 0x00000001004d61ac UIKit_UIApplication_Main_string___intptr_intptr + 44
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 35 libXamarin.iOS.dll.dylib 0x00000001004d616c UIKit_UIApplication_Main_string___string_string + 172
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 36 libTest.iOS.exe.dylib 0x0000000100076de0 Test_iOS_Application_Main_string__ + 160
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 37 libmscorlib.dll.dylib 0x0000000100786db4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
2016-11-09 09:34:32.275 Test.iOS[763:313310] critical: 38 libmonosgen-2.0.dylib 0x00000001001ba1dc mono_jit_runtime_invoke + 1772
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 39 libmonosgen-2.0.dylib 0x000000010022ad0c do_runtime_invoke + 112
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 40 libmonosgen-2.0.dylib 0x000000010022d2f0 mono_runtime_exec_main + 832
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 41 libmonosgen-2.0.dylib 0x000000010022cf0c mono_runtime_run_main + 764
2016-11-09 09:34:32.276 Test.iOS[763:313310] critical: 42 libmonosgen-2.0.dylib 0x000000010019e7f8 mono_jit_exec + 236
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical: 43 libxamarin-debug.dylib 0x000000010048dcd8 xamarin_main + 2168
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical: 44 Test.iOS 0x000000010005de50 main + 96
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical: 45 libdyld.dylib 0x0000000192d185b8 <redacted> + 4
2016-11-09 09:34:32.277 Test.iOS[763:313310] critical:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
You can't use IPv4 address literals. That's an automatic failure and app rejection, since these don't work on an IPv6-only environment. You must use a hostname instead.
Apple seems to be testing in pure ipv6 environments, so any direct call will fail. This is their comment when they failed my app yesterday:
Please run your app on a device while connected to an IPv6 network
(all apps must support IPv6) to identify the issue(s), then revise and
resubmit your app for review.
If we misunderstood the intended behavior of your app, please reply to
this message in Resolution Center to provide information on how these
features were intended to work.
For new apps, uninstall all previous versions of your app from a
device, then install and follow the steps to reproduce the issue(s).
For updates, install the new version as an update to the previous
version, then follow the steps to reproduce the issue(s).
Resources
For information about supporting IPv6 Networks, please refer to
Supporting IPv6 DNS64/NAT64 Networks and About Networking.
Related
NOTE: No error appears if the shutdown in client is deleted
// server.rs
use std::io::BufReader;
use std::io::Read;
use std::io::Write;
use std::net::Shutdown;
use std::net::TcpListener;
use std::thread;
fn main() {
let listener = TcpListener::bind("127.0.0.1:4000").unwrap();
for stream in listener.incoming() {
let mut stream = stream.unwrap();
thread::spawn(move || {
let mut reader = BufReader::new(&stream);
let mut buffer = [0; 1024];
let len = reader.read(&mut buffer).unwrap();
// no sleep no error, just simulating a time-consuming operation
thread::sleep(std::time::Duration::from_secs(1));
stream.write_all(&buffer[0..len]).unwrap();
stream.shutdown(Shutdown::Write).unwrap();
});
}
}
// client.rs
use std::io::{Read, Write};
use std::net::TcpStream;
use std::thread;
fn main() {
let mut clients = Vec::new();
for _ in 0..1000 {
clients.push(thread::spawn(move || {
let mut client = TcpStream::connect("127.0.0.1:4000").unwrap();
client.write_all("hello".as_bytes()).unwrap();
// no error if remove the following line
client.shutdown(std::net::Shutdown::Write).unwrap();
let mut buffer = Vec::new();
client.read_to_end(&mut buffer).unwrap();
println!("{}", std::str::from_utf8(&buffer).unwrap());
}));
}
for client in clients.into_iter() {
client.join().unwrap();
}
}
As I understand, shutdown the write operation will append FIN after sending the previous data, and then the peer (server) can still continue to write data. But among these 1000 clients, some error appeared:
// server
<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 107, kind: NotConnected, message: "Transport endpoint is not connected" }', src/bin/server.rs:22:46
// client
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }', src/bin/client.rs:15:45
It seems that the connection is closed after the shutdown in client.
Update1:
I used Wireshark and this is one of the wrong connections:
No. Time Source Destination Protocol Length Info
1101 13.738139 127.0.0.1 127.0.0.1 TCP 56 10628 → 4000 [SYN] Seq=0 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM=1
1104 13.738157 127.0.0.1 127.0.0.1 TCP 44 4000 → 10628 [RST, ACK] Seq=409345761 Ack=1 Win=0 Len=0
1234 14.251615 127.0.0.1 127.0.0.1 TCP 56 [TCP Retransmission] [TCP Port numbers reused] 10628 → 4000 [SYN] Seq=0 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM=1
1250 14.251690 127.0.0.1 127.0.0.1 TCP 56 [TCP Port numbers reused] 4000 → 10628 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM=1
1266 14.251726 127.0.0.1 127.0.0.1 TCP 44 10628 → 4000 [ACK] Seq=1 Ack=1 Win=2161152 Len=0
1376 14.251949 127.0.0.1 127.0.0.1 TCP 49 10628 → 4000 [PSH, ACK] Seq=1 Ack=1 Win=2161152 Len=5
1387 14.251970 127.0.0.1 127.0.0.1 TCP 44 4000 → 10628 [ACK] Seq=1 Ack=6 Win=2161152 Len=0
1402 14.251996 127.0.0.1 127.0.0.1 TCP 44 10628 → 4000 [FIN, ACK] Seq=6 Ack=1 Win=2161152 Len=0
1412 14.252013 127.0.0.1 127.0.0.1 TCP 44 4000 → 10628 [ACK] Seq=1 Ack=7 Win=2161152 Len=0
2092 15.261312 127.0.0.1 127.0.0.1 TCP 49 4000 → 10628 [PSH, ACK] Seq=1 Ack=7 Win=2161152 Len=5
2101 15.261384 127.0.0.1 127.0.0.1 TCP 44 10628 → 4000 [RST, ACK] Seq=7 Ack=6 Win=0 Len=0
Update2:
One of correct connections:
No. Time Source Destination Protocol Length Info
162 13.731960 127.0.0.1 127.0.0.1 TCP 56 10927 → 4000 [SYN] Seq=0 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM=1
166 13.731997 127.0.0.1 127.0.0.1 TCP 56 4000 → 10927 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=65495 WS=256 SACK_PERM=1
169 13.732013 127.0.0.1 127.0.0.1 TCP 44 10927 → 4000 [ACK] Seq=1 Ack=1 Win=2161152 Len=0
176 13.732035 127.0.0.1 127.0.0.1 TCP 49 10927 → 4000 [PSH, ACK] Seq=1 Ack=1 Win=2161152 Len=5
181 13.732046 127.0.0.1 127.0.0.1 TCP 44 4000 → 10927 [ACK] Seq=1 Ack=6 Win=2161152 Len=0
187 13.732059 127.0.0.1 127.0.0.1 TCP 44 10927 → 4000 [FIN, ACK] Seq=6 Ack=1 Win=2161152 Len=0
191 13.732074 127.0.0.1 127.0.0.1 TCP 44 4000 → 10927 [ACK] Seq=1 Ack=7 Win=2161152 Len=0
1495 14.746260 127.0.0.1 127.0.0.1 TCP 49 4000 → 10927 [PSH, ACK] Seq=1 Ack=7 Win=2161152 Len=5
1502 14.746369 127.0.0.1 127.0.0.1 TCP 44 10927 → 4000 [ACK] Seq=7 Ack=6 Win=2161152 Len=0
1505 14.746423 127.0.0.1 127.0.0.1 TCP 44 4000 → 10927 [FIN, ACK] Seq=6 Ack=7 Win=2161152 Len=0
1512 14.746529 127.0.0.1 127.0.0.1 TCP 44 10927 → 4000 [ACK] Seq=7 Ack=7 Win=2161152 Len=0
I strongly suspect it has to do with the backlog, the number of connections accepted by the OS TCP stack, but not yet handled by your application.
std doesn't allow you to control this number and defaults it to 128.
To control the number, I've re-implemented your server in tokio (well, it's actually just the main example on the tokio README), and set the backlog to 3000.
use std::time::Duration;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::{TcpListener, TcpSocket};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "127.0.0.1:4000".parse().unwrap();
let socket = TcpSocket::new_v4()?;
socket.bind(addr)?;
let listener: TcpListener = socket.listen(3000)?;
loop {
let (mut socket, _) = listener.accept().await?;
tokio::spawn(async move {
let mut buf = [0; 1024];
loop {
let n = match socket.read(&mut buf).await {
Ok(n) if n == 0 => return,
Ok(n) => n,
Err(e) => {
eprintln!("failed to read from socket; err = {:?}", e);
return;
}
};
tokio::time::sleep(Duration::from_secs(1)).await;
if let Err(e) = socket.write_all(&buf[0..n]).await {
eprintln!("failed to write to socket; err = {:?}", e);
return;
}
}
});
}
}
This makes the problem disappear. Reducing it to socket.listen(128) makes it reappear. (Disclaimer: I do not suggest that 3000 is a sane number for the backlog.)
I said I strongly suspect that this is the cause because I can't fully explain how the sleep causes the problem. It may be that the many sleeping threads slow down the scheduler, and thus the speed at which your server can accept connections. But that is speculation.
(Side note: My default ulimit for open files was fairly low. I had to increase it with ulimit -nS 10000 to not get in the way when testing this.)
Getting an exception when just creating a new HSSFWorkbook object using poi 3.17 on Linux but the same code works on Windows. Using Redhat Linux 7.6 and openjdk version "1.8.0_181". The same code works find on Windows.
I've tried everything I can thing of without success.
The code is pretty trivial:
public RenderForXLS(RendererProperties rendererProperties) throws MOException
{
locale = rendererProperties.getLocale();
log.debug("Locale == " + locale);
workbook = new HSSFWorkbook();
normalFont = createFont(workbook, HSSFColor.HSSFColorPredefined.BLACK.getIndex(), false);
boldFont = createFont(workbook, HSSFColor.HSSFColorPredefined.BLACK.getIndex(), true);
headerCellStyle = createHeaderCellStyle(workbook);
dataCellStyle = createDataCellStyle(workbook);
doubleNumericCellStyle = createDoubleNumericCellStyle(workbook);
integerNumericCellStyle = createIntegerNumericCellStyle(workbook);
percentageCellStyle = createPercentageCellStyle(workbook);
}
java.lang.VerifyError: Stack map does not match the one at exception handler 172
Exception Details:
Location:
org/apache/poi/POIDocument.getPropertySet(Ljava/lang/String;Lorg/apache/poi/poifs/crypt/EncryptionInfo;)Lorg/apache/poi/hpsf/PropertySet; #172: astore
Reason:
Type 'org/apache/poi/poifs/filesystem/POIFSFileSystem' (current frame, locals[4]) is not assignable to 'org/apache/poi/poifs/filesystem/NPOIFSFileSystem' (stack map, locals[4])
Current Frame:
bci: #94
flags: { }
locals: { 'org/apache/poi/POIDocument', 'java/lang/String', 'org/apache/poi/poifs/crypt/EncryptionInfo', 'org/apache/poi/poifs/filesystem/DirectoryNode', 'org/apache/poi/poifs/filesystem/POIFSFileSystem', 'java/lang/String', 'java/lang/String', 'org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor' }
stack: { 'java/io/IOException' }
Stackmap Frame:
bci: #172
flags: { }
locals: { 'org/apache/poi/POIDocument', 'java/lang/String', 'org/apache/poi/poifs/crypt/EncryptionInfo', 'org/apache/poi/poifs/filesystem/DirectoryNode', 'org/apache/poi/poifs/filesystem/NPOIFSFileSystem', 'java/lang/String' }
stack: { 'java/io/IOException' }
Bytecode:
0x0000000: 2ab4 0002 4e01 3a04 1225 3a05 2cc6 0057
0x0000010: 2cb6 0026 9900 5012 273a 052a b600 283a
0x0000020: 062d 1906 b600 299a 0024 bb00 2a59 bb00
0x0000030: 1959 b700 1a12 2bb6 001b 1906 b600 1b12
0x0000040: 2cb6 001b b600 1eb7 002d bf2c b600 2ec0
0x0000050: 002f 3a07 1907 2d19 06b6 0030 3a04 1904
0x0000060: b600 054e 2dc6 000b 2d2b b600 299a 000e
0x0000070: 013a 0619 04b8 0031 1906 b012 253a 052d
0x0000080: 2d2b b600 32b6 0033 3a06 1234 3a05 1906
0x0000090: b800 353a 0719 06b6 0036 1904 b800 3119
0x00000a0: 07b0 3a08 1906 b600 3619 08bf 3a06 1906
0x00000b0: bf3a 06bb 0021 59bb 0019 59b7 001a 1238
0x00000c0: b600 1b19 05b6 001b 1239 b600 1b2b b600
0x00000d0: 1bb6 001e 1906 b700 3abf 3a09 1904 b800
0x00000e0: 3119 09bf
Exception Handler Table:
bci [138, 149] => handler: 162
bci [162, 164] => handler: 162
bci [12, 115] => handler: 172
bci [123, 154] => handler: 172
bci [162, 172] => handler: 172
bci [12, 115] => handler: 177
bci [123, 154] => handler: 177
bci [162, 172] => handler: 177
bci [12, 115] => handler: 218
bci [123, 154] => handler: 218
bci [162, 220] => handler: 218
Stackmap Table:
full_frame(#75,{Object[#178],Object[#157],Object[#179],Object[#180],Object[#181],Object[#157],Object[#157]},{})
chop_frame(#100,1)
same_frame(#112)
same_frame(#123)
full_frame(#162,{Object[#178],Object[#157],Object[#179],Object[#180],Object[#181],Object[#157],Object[#182]},{Object[#183]})
full_frame(#172,{Object[#178],Object[#157],Object[#179],Object[#180],Object[#181],Object[#157]},{Object[#159]})
same_locals_1_stack_item_frame(#177,Object[#184])
same_locals_1_stack_item_frame(#218,Object[#183])
at com.sas.analytics.mo.services.report.RenderForXLS.<init>(RenderForXLS.java:82)
One my test flight users is experiencing a crash everytime they load the app. I have been unable to reproduce this on my test device or simulators.
I have the crash report and believe I have symbolicated it fully, following this blog.
However I can't map the error back to my code:
Date/Time: 2017-09-04 20:37:34.8879 +0100
Launch Time: 2017-09-04 20:36:50.5258 +0100
OS Version: iPhone OS 10.2.1 (14D27)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000185433014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001854fb450 pthread_kill + 112 (pthread.c:1366)
2 libsystem_c.dylib 0x00000001853a7400 abort + 140 (abort.c:91)
3 planit 0x0000000101235da8 mono_handle_native_crash (mini-exceptions.c:2548)
4 libsystem_platform.dylib 0x00000001854f5348 _sigtramp + 52 (sigtramp.c:115)
5 libsystem_pthread.dylib 0x00000001854fb450 pthread_kill + 112 (pthread.c:1366)
6 libsystem_c.dylib 0x00000001853a7400 abort + 140 (abort.c:91)
7 planit 0x0000000101333414 xamarin_printf (runtime.m:2218)
8 planit 0x0000000101271a9c mono_invoke_unhandled_exception_hook (exception.c:1084)
9 planit 0x00000001012359e4 mono_handle_exception_internal (mini-exceptions.c:1886)
10 planit 0x0000000101234a84 mono_handle_exception (mini-exceptions.c:2117)
11 planit 0x000000010122d458 mono_arm_throw_exception (exceptions-arm64.c:411)
12 planit 0x000000010041c278 throw_exception + 168
13 planit 0x000000010032289c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 44
14 planit 0x00000001003252e4 System_Runtime_CompilerServices_AsyncMethodBuilderCore__c__ThrowAsyncb__6_0_object + 84
15 planit 0x0000000100c2f808 UIKit_UIKitSynchronizationContext__Postc__AnonStorey0__m__0 (UIKitSynchronizationContext.cs:24)
16 planit 0x0000000100c1be34 Foundation_NSAsyncActionDispatcher_Apply (NSAction.cs:163)
17 planit 0x00000001003ecc24 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
18 planit 0x0000000101243010 mono_jit_runtime_invoke (mini-runtime.c:2526)
19 planit 0x00000001012a7df0 do_runtime_invoke (object.c:2829)
20 planit 0x00000001012a7d50 mono_runtime_invoke (object.c:2983)
21 planit 0x00000001000a8204 native_to_managed_trampoline_1(objc_object*, objc_selector*, _MonoMethod**, unsigned int) (registrar.m:25)
22 planit 0x00000001000a853c -[__MonoMac_NSAsyncActionDispatcher xamarinApplySelector] (registrar.m:4355)
23 Foundation 0x0000000186f79048 __NSThreadPerformPerform + 340 (NSThread.m:1247)
24 CoreFoundation 0x0000000186412b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1943)
25 CoreFoundation 0x00000001864124a4 __CFRunLoopDoSources0 + 524 (CFRunLoop.c:1989)
26 CoreFoundation 0x00000001864100a4 __CFRunLoopRun + 804 (CFRunLoop.c:2821)
27 CoreFoundation 0x000000018633e2b8 CFRunLoopRunSpecific + 444 (CFRunLoop.c:3113)
28 GraphicsServices 0x0000000187df2198 GSEventRunModal + 180 (GSEvent.c:2245)
29 UIKit 0x000000018c3857fc -[UIApplication _run] + 684 (UIApplication.m:2650)
30 UIKit 0x000000018c380534 UIApplicationMain + 208 (UIApplication.m:4092)
31 planit 0x0000000100c6fc10 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (/<unknown>:1)
32 planit 0x0000000100c2de8c UIKit_UIApplication_Main_string___intptr_intptr (UIApplication.cs:79)
33 planit 0x0000000100c2de4c UIKit_UIApplication_Main_string___string_string (UIApplication.cs:63)
34 planit 0x00000001000cbef4 planit_Application_Main_string__ (Main.cs:13)
35 planit 0x00000001003ecc24 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
36 planit 0x0000000101243010 mono_jit_runtime_invoke (mini-runtime.c:2526)
37 planit 0x00000001012a7df0 do_runtime_invoke (object.c:2829)
38 planit 0x00000001012aa7bc do_exec_main_checked (object.c:4624)
39 planit 0x000000010122cc68 mono_jit_exec (driver.g.c:1040)
40 planit 0x0000000101337168 xamarin_main (monotouch-main.m:482)
41 planit 0x00000001000c75bc main (main.m:79)
42 libdyld.dylib 0x00000001853215b8 start + 4
Can anyone point me in the right direction?
The way we keep track of exceptions that are crashing the applications we've asked our testers to look through is by hooking into the global exception handler for iOS, and to use a class we wrote to record the information to IO.
Class:
using System;
using System.IO;
using UIKit;
namespace namespace.TestingLogs
{
public static class ApplicationLog
{
private static string _filename = "LogFile-";
public static void CreateFile(string SessionFilename)
{
_filename += SessionFilename;
var docs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var filename = Path.Combine(docs, _filename);
var Device = UIDevice.CurrentDevice;
File.AppendAllText(filename, ("======Device Information======" + Environment.NewLine));
File.AppendAllText(filename, ("Battery Level: " + Device.BatteryLevel + Environment.NewLine));
File.AppendAllText(filename, ("Model: " + Device.Model + Environment.NewLine));
File.AppendAllText(filename, ("System Version: " + Device.SystemVersion + Environment.NewLine));
File.AppendAllText(filename, ("[" + DateTime.UtcNow.ToString() + "]" + "======Start Log======" + Environment.NewLine + Environment.NewLine));
Console.WriteLine("[] = " + filename);
}
public static void AppendFile(string appendText)
{
var txt = Environment.NewLine + appendText;
var docs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var filename = Path.Combine(docs, _filename);
File.AppendAllText(filename, txt);
}
}
public class ExitAppException : Exception
{
public ExitAppException() { }
public ExitAppException(string message) : base(message) { }
public ExitAppException(string message, Exception inner) :
base(message, inner)
{ }
}
}
Hook into the global unhandled event in AppDelegate.cs by doing the following in the 'FinishedLaunching' Method:
AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
{
try
{
//Record the error in our application logs
ApplicationLog.AppendFile(
DateTime.Now.ToString() + " : " + "[CRITICAL GLOBALLY HANDLED EXCEPTION] - Critical exception has been hit! - Message: " + e.ExceptionObject +
Environment.NewLine + Environment.NewLine +
"========= Critcal Error has been hit, application closed =========" +
Environment.NewLine + Environment.NewLine
);
}
catch (Exception genEx)
{
var Error = genEx.Message;
}
};
Use whatever wording best suits you obviously. Feel free to use a string builder instead of the way we do it, but the general concept is the same. Your user can then download something like 'macgo iphone explorer' (it's free) and access the applications documents folder, the log file will be in there, so then they just email it to you. Hope this helps a little.
I keep getting EPIPE error, on stdin stream and I can't find a reason:
This is my code:
var checkFile = function(data, callback){
var child_process = spawn('ffprobe', ['-print_format', 'json', '-show_format', 'pipe:0']);
var stdInError = function(e) {
console.log(e);
}
child_process.stdin.on('error', stdInError);
var generalError = function() {
console.log("general Error" + "\n");
}
child_process.on('error', generalError);
child_process.stdout.on('data', function(data){
console.log("data" + "\n");
console.log(data);
console.log("\n");
});
child_process.on('close', function(){
console.log("close" + "\n");
}
var exit = function(){
console.log("exit");
}
child_process.on('exit', exit);
console.log("write" + "\n");
child_process.stdin.write(data);
child_process.stdin.end();
};
And this is my output:
write
data
<Buffer 7b 0a 20 20 20 20 22 66 6f 72 6d 61 74 22 3a 20 7b 0a 20 20 20 20 20 20 20 20 22 66 69 6c 65 6e 61 6d 65 22 3a 20 22 70 69 70 65 3a 30 22 2c 0a 20 20 20 ...>
data
<Buffer 0a 7d 0a>
{ [Error: write EPIPE] code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }
exit
close
I cannot find a reason for this error, i have also tried to implement
child_process.stderr.on('data', function (data) {
//throw errors
console.log('stderr: ' + data);
});
And every line printed from ffprobe (which is a software to check audio/video files specs) is marked as stderr. For example:
stderr: ffprobe version 2.2.4 Copyright (c) 2007-2014 the FFmpeg developers
built on Jul 2 2014 15:07:45 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
libavutil 52. 66.100 / 52. 66.100
stderr: libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
After few tests I found a bug and the error is caused by a too big file.
Hi I m trying to setup limesurvey on xampp on linux . I want the setup to use msssql server on a windows box. I have successfully setup xampp and modified the config.php in application/config folder of lime survey to point to sql server. when i try to launch http://host.name.com:8080/limesurvey/admin it shrows error as below
CDbConnection failed to open the DB connection: could not find driver
/opt/lampp/htdocs/limesurvey/framework/db/CDbConnection.php(382)
370 throw new CDbException('CDbConnection.connectionString cannot be empty.');
371 try
372 {
373 Yii::trace('Opening DB connection','system.db.CDbConnection');
374 $this->_pdo=$this->createPdoInstance();
375 $this->initConnection($this->_pdo);
376 $this->_active=true;
377 }
378 catch(PDOException $e)
379 {
380 if(YII_DEBUG)
381 {
382 throw new CDbException('CDbConnection failed to open the DB connection: '.
383 $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
384 }
385 else
386 {
387 Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
388 throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
389 }
390 }
391 }
392 }