Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.InternalError: Thread starting during runtime shutdown #136

Closed
riclage opened this issue Jan 20, 2014 · 10 comments
Closed

java.lang.InternalError: Thread starting during runtime shutdown #136

riclage opened this issue Jan 20, 2014 · 10 comments

Comments

@riclage
Copy link

riclage commented Jan 20, 2014

I'm getting users reporting the following error via the Play Store reporting:

at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:1042)
at org.apache.http.impl.conn.tsccm.AbstractConnPool.enableConnectionGC(AbstractConnPool.java:140)
at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.createConnectionPool(ThreadSafeClientConnManager.java:120)
at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.(ThreadSafeClientConnManager.java:98)
at org.acra.e.c.a(HttpRequest.java:214)
at org.acra.e.c.a(HttpRequest.java:141)
at org.acra.sender.HttpSender.a(HttpSender.java:225)
at org.acra.g.a(SendWorker.java:179)
at org.acra.g.a(SendWorker.java:141)
at org.acra.g.run(SendWorker.java:77)

Since it's from users, I can't really know at what point this is occurring. Any ideas? I'm using Acra version 4.5.0.

@koral--
Copy link
Contributor

koral-- commented Jan 27, 2014

I'm experiencing the same issue only on ART runtime (not Dalvik) with ACRA 4.50. Here is a full, not obfuscated stack trace:
java.lang.InternalError: Thread starting during runtime shutdown at java.lang.Thread.nativeCreate(Native Method) at java.lang.Thread.start(Thread.java:1042) at org.apache.http.impl.conn.tsccm.AbstractConnPool.enableConnectionGC(AbstractConnPool.java:140) at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.createConnectionPool(ThreadSafeClientConnManager.java:120) at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.<init>(ThreadSafeClientConnManager.java:98) at org.acra.util.HttpRequest.getHttpClient(HttpRequest.java:214) at org.acra.util.HttpRequest.send(HttpRequest.java:141) at org.acra.sender.GoogleFormSender.send(GoogleFormSender.java:88) at org.acra.SendWorker.sendCrashReport(SendWorker.java:179) at org.acra.SendWorker.checkAndSendReports(SendWorker.java:141) at org.acra.SendWorker.run(SendWorker.java:77)

koral-- pushed a commit to koral--/acra that referenced this issue Jan 28, 2014
@koral--
Copy link
Contributor

koral-- commented Jan 28, 2014

I see that source of the problem is that starting some new thread (invoked indirectly by obtaining an instance of HttpClient from background thread of SendWorker) occurs too late. So one of the solutions is to create HttpClient instance earlier.
I've made a quick fix in my forked repo. But is not a complete solution because setters of timeouts and number of retries were lost.

@abdulmoeedammar
Copy link

I am facing the same problem with ART runtime. @koral-- thanks for the quick fix, but is there a proper fix in the works. Also when it is expected to be fixed and part of built jar.

To me support of ART seems important as Google wants to replace Dalvik with it in the future.

realdadfish pushed a commit to realdadfish/acra that referenced this issue Jul 16, 2014
realdadfish added a commit to realdadfish/mvn that referenced this issue Jul 16, 2014
jaysoffian added a commit to jaysoffian/acra that referenced this issue Dec 4, 2014
The new Android Runtime, default as of Android 5.0, does not allow
spawning of threads during shutdown, and doing so raises
an exception:

  java.lang.InternalError: Thread starting during runtime shutdown

For reasons I don't fully understand, it appears the the shutdown
begins before ACRA even re-raises the exception. So the fact that
ACRA waits on the SendWorker is insufficient to prevent this issue
from occurring. For example, see issue ACRA#136, which in theory should
not occur.

This option allows ACRA to be configured to terminate immediately
after persisting the report to disk. The report is then sent
(per usual) when the application is restarted.
littleguy77 added a commit to littleguy77/mupen64plus-ae that referenced this issue Dec 9, 2014
ACRA/acra@4d15be3

This fixes an issue that became apparent after adding our extra crash
handler.  Two crash logs were being created, where the second was caused
by a bug in ACRA.

The bug is described here:
ACRA/acra#136

and resolved here:
ACRA/acra#165
@eco65192 eco65192 mentioned this issue Apr 27, 2015
Closed
@xing634325131
Copy link

it occur again.
1.

java.lang.InternalError: Thread starting during runtime shutdown
    at java.lang.Thread.nativeCreate(Native Method)
    at java.lang.Thread.start(Thread.java:1063)
    at java.lang.ProcessManager.<init>(ProcessManager.java:62)
    at java.lang.ProcessManager.<clinit>(ProcessManager.java:335)
    at java.lang.Runtime.exec(Runtime.java:173)
    at java.lang.Runtime.exec(Runtime.java:128)
java.lang.InternalError: Thread starting during runtime shutdown
    at java.lang.Thread.nativeCreate(Native Method)
    at java.lang.Thread.start(Thread.java:1063)
    at org.apache.http.impl.conn.tsccm.AbstractConnPool.enableConnectionGC(AbstractConnPool.java:140)
    at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.createConnectionPool(ThreadSafeClientConnManager.java:120)
    at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.<init>(ThreadSafeClientConnManager.java:98)
    at rq.a(Unknown Source)

@william-ferguson-au
Copy link
Member

Not from ACRA-4.6.0+ it didn't because ACRA no longer uses ThreadSafeClientConnManager.

@xing634325131
Copy link

Can you tell me what the problem led to this? it's very important to me.

@william-ferguson-au
Copy link
Member

Your problem is coming from at rq.a(Unknown Source).
Find out what that is (it appears to be Proguarded).

@xmenxwk
Copy link

xmenxwk commented Dec 2, 2015

The problem exists in acra4.7, Android 5.1.1. Device D5803.

java.lang.InternalError: Thread starting during runtime shutdown
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:1063)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:920)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1336)
at com.android.okhttp.ConnectionPool.scheduleCleanupAsRequired(ConnectionPool.java:367)
at com.android.okhttp.ConnectionPool.get(ConnectionPool.java:265)
at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:109)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:272)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
at org.acra.util.HttpRequest.send(SourceFile:123)
at org.acra.sender.HttpSender.send(SourceFile:245)
at org.acra.SendWorker.sendCrashReport(SourceFile:181)
at org.acra.SendWorker.checkAndSendReports(SourceFile:140)
at org.acra.SendWorker.run(SourceFile:76)

@PaulWoitaschek
Copy link

Please re-open this, same crash: Acra 4.7

Mutliple times seen on Android 5.0:

  • Moto G (titan_umtsds)
  • HTC ONE M8s (htc_m8qlul)
  • MOTO G (titan_umts)

java.lang.InternalError: Thread starting during runtime shutdown
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(Thread.java:1063)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:920)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1336)
at com.android.okhttp.ConnectionPool.get(ConnectionPool.java:206)
at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:109)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:272)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:373)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
at org.acra.util.HttpRequest.send(HttpRequest.java:122)
at org.acra.sender.HttpSender.send(HttpSender.java:245)
at org.acra.SendWorker.sendCrashReport(SendWorker.java:181)
at org.acra.SendWorker.checkAndSendReports(SendWorker.java:140)
at org.acra.SendWorker.run(SendWorker.java:76)

@william-ferguson-au
Copy link
Member

It is not the same crash as the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants