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

IllegalStateException: Invalid BundleContext #6384

Closed
astrelsky opened this issue Apr 5, 2024 · 2 comments
Closed

IllegalStateException: Invalid BundleContext #6384

astrelsky opened this issue Apr 5, 2024 · 2 comments
Assignees
Labels
Feature: Scripting Status: Internal This is being tracked internally by the Ghidra team
Milestone

Comments

@astrelsky
Copy link
Contributor

Describe the bug
Opening and closing the CodeBrowser results in the above error.

To Reproduce
Steps to reproduce the behavior:

  1. Open the CodeBrowser.
  2. Close the CodeBrowser while it is taking a million years to initialize the osgi bundle stuff.

Expected behavior
No exception.

Attachments

trace
2024-04-05 17:07:48 ERROR (TaskLauncher$1) Task Error: Restoring bundle state - Uncaught Exception: java.lang.IllegalStateException: Invalid BundleContext. java.lang.IllegalStateException: Invalid BundleContext.
	at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:491)
	at org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:167)
	at ghidra.app.plugin.core.osgi.BundleHost.getOSGiBundle(BundleHost.java:540)
	at ghidra.app.plugin.core.osgi.GhidraBundle.getOSGiBundle(GhidraBundle.java:199)
	at ghidra.app.plugin.core.osgi.GhidraBundle.toString(GhidraBundle.java:214)
	at java.base/java.lang.StringConcatHelper.stringOf(StringConcatHelper.java:453)
	at java.base/java.lang.StringConcatHelper.simpleConcat(StringConcatHelper.java:408)
	at ghidra.app.plugin.core.osgi.BundleHost.activateInStages(BundleHost.java:764)
	at ghidra.app.plugin.core.osgi.BundleHost.lambda$restoreManagedBundleState$6(BundleHost.java:895)
	at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:88)
	at ghidra.util.task.Task.monitoredRun(Task.java:134)
	at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)

Environment (please complete the following information):

  • Ghidra Version: 11.1_DEV but this has bug has been around probably since the change to osgi.
@dev747368
Copy link
Collaborator

Humorously, this appears to be an exception caused by a logging statement in a catch block for another exception. The base exception:


java.lang.NullPointerException: Cannot invoke "org.osgi.framework.Bundle.getSymbolicName()" because "this._bundle" is null
	at org.phidias.compile.BundleJavaManager.<init>(BundleJavaManager.java:80)
	at org.phidias.compile.BundleJavaManager.<init>(BundleJavaManager.java:62)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle$MyBundleJavaManager.<init>(GhidraSourceBundle.java:1088)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.buildDefaultActivator(GhidraSourceBundle.java:990)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.addActivatorClass(GhidraSourceBundle.java:929)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.generateManifest(GhidraSourceBundle.java:888)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.compileToExplodedBundle(GhidraSourceBundle.java:1075)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.build(GhidraSourceBundle.java:608)
	at ghidra.app.plugin.core.osgi.BundleHost.activateInStages(BundleHost.java:754)
	at ghidra.app.plugin.core.osgi.BundleHost.lambda$6(BundleHost.java:895)
	at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:88)
	at ghidra.util.task.Task.monitoredRun(Task.java:134)
	at ghidra.util.task.TaskRunner.lambda$0(TaskRunner.java:106)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

@astrelsky
Copy link
Contributor Author

Humorously, this appears to be an exception caused by a logging statement in a catch block for another exception. The base exception:


java.lang.NullPointerException: Cannot invoke "org.osgi.framework.Bundle.getSymbolicName()" because "this._bundle" is null
	at org.phidias.compile.BundleJavaManager.<init>(BundleJavaManager.java:80)
	at org.phidias.compile.BundleJavaManager.<init>(BundleJavaManager.java:62)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle$MyBundleJavaManager.<init>(GhidraSourceBundle.java:1088)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.buildDefaultActivator(GhidraSourceBundle.java:990)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.addActivatorClass(GhidraSourceBundle.java:929)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.generateManifest(GhidraSourceBundle.java:888)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.compileToExplodedBundle(GhidraSourceBundle.java:1075)
	at ghidra.app.plugin.core.osgi.GhidraSourceBundle.build(GhidraSourceBundle.java:608)
	at ghidra.app.plugin.core.osgi.BundleHost.activateInStages(BundleHost.java:754)
	at ghidra.app.plugin.core.osgi.BundleHost.lambda$6(BundleHost.java:895)
	at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:88)
	at ghidra.util.task.Task.monitoredRun(Task.java:134)
	at ghidra.util.task.TaskRunner.lambda$0(TaskRunner.java:106)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

download

@ryanmkurtz ryanmkurtz self-assigned this Apr 10, 2024
@ryanmkurtz ryanmkurtz added Feature: Scripting Status: Triage Information is being gathered labels Apr 10, 2024
@ryanmkurtz ryanmkurtz added Status: Internal This is being tracked internally by the Ghidra team and removed Status: Triage Information is being gathered labels May 7, 2024
@ryanmkurtz ryanmkurtz added this to the 11.2 milestone May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Scripting Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

No branches or pull requests

3 participants