Re: [android-developers] Re: NullPointerException in java.io.File.fixSlashes?
saw this error in my log java.lang.NullPointerException 09-21 21:17:12.847 31558-31558/com.s.sdk W/System.err: at java.io.File.fixSlashes(File.java:185) 09-21 21:17:12.848 31558-31558/com.s.sdk W/System.err: at java.io.File.(File.java:134) trying to read an lmk file, what am i doing wrong please On Thursday, February 19, 2015 at 12:55:59 PM UTC+1, Sérgio Faria wrote: > > , visit https://groups.google.com/d/optout. >>> >> -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/05b4295a-ada2-4c54-9a13-36247be21666%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: NullPointerException in java.io.File.fixSlashes?
Good analysis and reasoning. It leads to identifying a specific version of the OS. Let me add to the reasoning: If this was a bug in android-2.3.4_r1, wouldn't many other apps that call the same function also trigger this bug? Then the history would show a 2.3.4_r2 release with this bug fixed. I am guessing that since that may not be the history, then other app developers have found a way to avoid this bug. You need to find that method and add it to your code. The problem may be that the specific stack trace you're looking at is showing where the problem is triggered, but it is not showing where the problem gets set up. Maybe android-2.3.4_r1 is the only OS version which allows a null string to be returned from a certain function call that you're making. Your code might rely on that string always being non-null, and passes it into this call stack. The other OS versions don't have the problem because they don't have the conditions that produce a null string. Your code could test that string for null, and avoid making the call if it is. If you must make the function call, you could replace the null string with something else that won't cause the error. Emit a message, so you can track the problem. Enhance the later code to continue gracefully if the string was found to be null. This is defensive programming. You're right in thinking it should not be necessary, but you must also consider the reality that it is. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: NullPointerException in java.io.File.fixSlashes?
Except I am not doing it... On Wed, Feb 18, 2015, 15:26 Sérgio Faria sergio9...@gmail.com wrote: Given the stack above, it seems you're doing new File(null) https://android.googlesource.com/platform/libcore/+/ android-2.3.4_r1/luni/src/main/java/java/io/File.java 2015-02-18 11:45 GMT+00:00 Fran fmmar...@gmail.com: It seems this problem persists more than three years after. I am experiencing the same problem right now, all of them with Android 2.3.4 On Sunday, June 5, 2011 at 4:21:31 PM UTC+2, Derek wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Android Developers group. To unsubscribe from this topic, visit https://groups.google.com/d/ topic/android-developers/b3XY_KvU7g4/unsubscribe. To unsubscribe from this group and all its topics, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: NullPointerException in java.io.File.fixSlashes?
Well, either the stack trace is wrong or the source is not the one I linked to (android-2.3.4_r1) or you're doing new File((String) null) Let's see: 3 at java.io.File.init(File.java:139) 138. public File(String path) { 139. init(path); 2 at java.io.File.init(File.java:189) 186. private void init(String dirtyPath) { 187. // Cache the path and the absolute path. 188. // We can't call isAbsolute() here (http://b/2486943). 189. String cleanPath = fixSlashes(dirtyPath); 1 at java.io.File.fixSlashes(File.java:205) 202. private String fixSlashes(String origPath) { 203. // Remove duplicate adjacent slashes. 204. boolean lastWasSlash = false; 205. char[] newPath = origPath.toCharArray(); On Thursday, February 19, 2015 at 9:59:30 AM UTC, Fran wrote: Except I am not doing it... On Wed, Feb 18, 2015, 15:26 Sérgio Faria sergi...@gmail.com javascript: wrote: Given the stack above, it seems you're doing new File(null) https://android.googlesource.com/platform/libcore/+/ android-2.3.4_r1/luni/src/main/java/java/io/File.java 2015-02-18 11:45 GMT+00:00 Fran fmma...@gmail.com javascript:: It seems this problem persists more than three years after. I am experiencing the same problem right now, all of them with Android 2.3.4 On Sunday, June 5, 2011 at 4:21:31 PM UTC+2, Derek wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com javascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com javascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Android Developers group. To unsubscribe from this topic, visit https://groups.google.com/d/ topic/android-developers/b3XY_KvU7g4/unsubscribe. To unsubscribe from this group and all its topics, send an email to android-developers+unsubscr...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: NullPointerException in java.io.File.fixSlashes?
My app has about 20,000 boots a day, and every single crash like this one is reported to be occurring exclusively with such 2.3.4 Android version. Every single one, in spite such version represent less than 5% of the devices were my app is installed. No other Android version is affected at all. Thus the causal variable is clearly isolated and identified and it is not within my code. I am not sure if those users are using specifically that 2.3.4_r1 code neither, but it doesn't matter anyway and investigating it further is pointless since I cannot change the user's underlying OS version. I will have to live with it, I guess. I googled such problem, find this thread, and just wanted to point out that this bug is still around. Bests, On Thu, Feb 19, 2015, 13:00 Sérgio Faria sergio9...@gmail.com wrote: Well, either the stack trace is wrong or the source is not the one I linked to (android-2.3.4_r1) or you're doing new File((String) null) Let's see: 3 at java.io.File.init(File.java:139) 138. public File(String path) { 139. init(path); 2 at java.io.File.init(File.java:189) 186. private void init(String dirtyPath) { 187. // Cache the path and the absolute path. 188. // We can't call isAbsolute() here (http://b/2486943). 189. String cleanPath = fixSlashes(dirtyPath); 1 at java.io.File.fixSlashes(File.java:205) 202. private String fixSlashes(String origPath) { 203. // Remove duplicate adjacent slashes. 204. boolean lastWasSlash = false; 205. char[] newPath = origPath.toCharArray(); On Thursday, February 19, 2015 at 9:59:30 AM UTC, Fran wrote: Except I am not doing it... On Wed, Feb 18, 2015, 15:26 Sérgio Faria sergi...@gmail.com wrote: Given the stack above, it seems you're doing new File(null) https://android.googlesource.com/platform/libcore/+/android- 2.3.4_r1/luni/src/main/java/java/io/File.java 2015-02-18 11:45 GMT+00:00 Fran fmma...@gmail.com: It seems this problem persists more than three years after. I am experiencing the same problem right now, all of them with Android 2.3.4 On Sunday, June 5, 2011 at 4:21:31 PM UTC+2, Derek wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Android Developers group. To unsubscribe from this topic, visit https://groups.google.com/d/to pic/android-developers/b3XY_KvU7g4/unsubscribe. To unsubscribe from this group and all its topics, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to a topic in the Google Groups Android Developers group. To unsubscribe from this topic, visit https://groups.google.com/d/ topic/android-developers/b3XY_KvU7g4/unsubscribe. To unsubscribe from this group and all its topics, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more
[android-developers] Re: NullPointerException in java.io.File.fixSlashes?
My stack dump, BTW: 0java.lang.NullPointerException1 at java.io.File.fixSlashes(File.java:205)2 at java.io.File.init(File.java:189)3 at java.io.File.init(File.java:139)4 at com.splunk.mint.DataFlusher$1.void run()(Unknown Source)5 at java.lang.Thread.run(Thread.java:1019)6 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) 7 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) 8 at java.lang.Thread.run(Thread.java:1019) On Sunday, June 5, 2011 at 4:21:31 PM UTC+2, Derek wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: NullPointerException in java.io.File.fixSlashes?
It seems this problem persists more than three years after. I am experiencing the same problem right now, all of them with Android 2.3.4 On Sunday, June 5, 2011 at 4:21:31 PM UTC+2, Derek wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: NullPointerException in java.io.File.fixSlashes?
Given the stack above, it seems you're doing new File(null) https://android.googlesource.com/platform/libcore/+/android-2.3.4_r1/luni/src/main/java/java/io/File.java 2015-02-18 11:45 GMT+00:00 Fran fmmar...@gmail.com: It seems this problem persists more than three years after. I am experiencing the same problem right now, all of them with Android 2.3.4 On Sunday, June 5, 2011 at 4:21:31 PM UTC+2, Derek wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: NullPointerException in java.io.File.fixSlashes?
There are hundreds reports in Crash section of Android Market. Line is not the same. Here they are: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) at java.io.File.init(File.java:201) at java.io.File.init(File.java:152) java.lang.NullPointerException at java.io.File.fixSlashes(File.java:205) at java.io.File.init(File.java:189) at java.io.File.init(File.java:139) java.lang.NullPointerException: at java.io.File.fixSlashes(File.java:267) at java.io.File.init(File.java:131) We're going to try to pass new File(null) to see if it can be the problem. On Jun 5, 4:49 pm, Mark Murphy mmur...@commonsware.com wrote: Well, line 234 of File.java is not in thefixSlashes() method in the latest stuff in the repo, based on what Google Code Search is telling me. What are the models of devices that are giving you this problem? On Sun, Jun 5, 2011 at 10:21 AM, Derek cram.de...@gmail.com wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android 3.0 Programming Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: NullPointerException in java.io.File.fixSlashes?
Derek, The seconds of your three stack traces (lines 205 - 189 - 139) lines up with this version of File.java: http://www.google.com/codesearch/p?hl=ru#cZwlSNS7aEw/libcore/luni/src/main/java/java/io/File.javaq=File%20lang:java%20package:androidsa=Ncd=1ct=rc Line 205 is the fist time fixSlahes accesses the argument passed into the constructor. The 234 - 201 - 152 is the Froyo version, here it is in the repository: http://android.git.kernel.org/?p=platform/dalvik.git;a=blob;f=libcore/luni/src/main/java/java/io/File.java;hb=refs/heads/froyo The 267 - 131 version is from Eclair: http://android.git.kernel.org/?p=platform/dalvik.git;a=blob;f=libcore/luni/src/main/java/java/io/File.java;hb=refs/heads/eclair#l267 Looks to me like a pretty strong case for your code doing new File(null) somewhere... -- Kostya 2011/6/6 Derek cram.de...@gmail.com There are hundreds reports in Crash section of Android Market. Line is not the same. Here they are: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) at java.io.File.init(File.java:201) at java.io.File.init(File.java:152) java.lang.NullPointerException at java.io.File.fixSlashes(File.java:205) at java.io.File.init(File.java:189) at java.io.File.init(File.java:139) java.lang.NullPointerException: at java.io.File.fixSlashes(File.java:267) at java.io.File.init(File.java:131) We're going to try to pass new File(null) to see if it can be the problem. On Jun 5, 4:49 pm, Mark Murphy mmur...@commonsware.com wrote: Well, line 234 of File.java is not in thefixSlashes() method in the latest stuff in the repo, based on what Google Code Search is telling me. What are the models of devices that are giving you this problem? On Sun, Jun 5, 2011 at 10:21 AM, Derek cram.de...@gmail.com wrote: Hi all, We get crash reports with the following error: java.lang.NullPointerException at java.io.File.fixSlashes(File.java:234) It appears on File file = new File(path/subfolder); on some devices only. We cannot reproduce it. Where could this problem from from? Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com| http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android 3.0 Programming Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en