Export to GitHub

ksoap2-android - issue #133

Resource Leaking when using kSoap in Android Strict Mode


Posted on Sep 12, 2012 by Massive Kangaroo

What steps will reproduce the problem? 1.Run android application using kSOAP with strict mode activated. 2. Strict mode error will occur each time org.ksoap2.transport.HttpTransportSE.call is called.

What is the expected output? What do you see instead? No warning or error should be present. Instead it display StrictMode error indicating resource leakage.

What version of the product are you using? On what operating system? kSOAP2-android-assembly-2.6.5-jar-with-dependencies.jar

Please provide any additional information below. The following is the stack trace displayed when the error occurred. 09-12 22:00:52.120: E/StrictMode(1504): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. 09-12 22:00:52.120: E/StrictMode(1504): java.lang.Throwable: Explicit termination method 'end' not called 09-12 22:00:52.120: E/StrictMode(1504): at dalvik.system.CloseGuard.open(CloseGuard.java:184) 09-12 22:00:52.120: E/StrictMode(1504): at java.util.zip.Inflater.<init>(Inflater.java:82) 09-12 22:00:52.120: E/StrictMode(1504): at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:96) 09-12 22:00:52.120: E/StrictMode(1504): at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81) 09-12 22:00:52.120: E/StrictMode(1504): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:182) 09-12 22:00:52.120: E/StrictMode(1504): at com.aa.bb.generalLibraries.XXXX.getSoapData(XXX.java:191) 09-12 22:00:52.120: E/StrictMode(1504): at com.aa.bb.ksoap.SOAPServices.aaa_bbb(SOAPServices.java:290) 09-12 22:00:52.120: E/StrictMode(1504): at com.aa.bb.testStubs.sample.testSoap(ComponentTestStubs.java:223) 09-12 22:00:52.120: E/StrictMode(1504): at com.aa.bb.cc.SoapTestStub.onHandleIntent(SoapTestStub.java:25) 09-12 22:00:52.120: E/StrictMode(1504): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 09-12 22:00:52.120: E/StrictMode(1504): at android.os.Handler.dispatchMessage(Handler.java:99) 09-12 22:00:52.120: E/StrictMode(1504): at android.os.Looper.loop(Looper.java:137) 09-12 22:00:52.120: E/StrictMode(1504): at android.os.HandlerThread.run(HandlerThread.java:60)

Comment #1

Posted on Sep 12, 2012 by Swift Hippo

Please try with the latest release.. I believe we had that fixed recently

Comment #2

Posted on Sep 13, 2012 by Massive Kangaroo

Hi Mosabua, Thanks for your response. By latest version do you mean 3.0.0 RC1?

Comment #3

Posted on Sep 13, 2012 by Massive Kangaroo

Dear Mosabu, I've just tested with 3.0.0 RC1, the leakage still present. The steps to reproduce it is the same as before.

Comment #4

Posted on Sep 13, 2012 by Swift Hippo

Can you see if you can come up with a fix and send a pull request or patch?

Comment #5

Posted on Sep 13, 2012 by Massive Kangaroo

Let me see what I can do.

Comment #6

Posted on Oct 1, 2012 by Massive Kangaroo

Hi Mosabua, Could you have a look at my pull request containing the fix for this issue? Regards.

Comment #7

Posted on Oct 2, 2012 by Swift Hippo

I am at JavaOne and will have a look when I am back.. I need to do some testing with it that I can not do while I am here.. but if you want I can cut another RC release after I pulled it in.

Comment #8

Posted on Oct 3, 2012 by Massive Kangaroo

Whichever it's convenient for you. Minor fix. Take your time.

Comment #9

Posted on Oct 23, 2012 by Swift Hippo

Fixed in 3.0.0-RC.2 release

Status: Fixed

Labels:
Type-Defect Priority-Medium