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

Stuck at "Processing PLT/GOT" when importing a MIPS ELF executable on Ghidra for Windows #1086

Open
masterofthepuppets opened this issue Sep 27, 2019 · 4 comments
Assignees

Comments

@masterofthepuppets
Copy link

Hello,

Ghidra gets stuck at "Processing PLT/GOT" and does not move to the next step. It happens when I try to import a MIPS executable. I use the Windows version.

@ghidra1
Copy link
Collaborator

ghidra1 commented Sep 27, 2019

The are many variations of MIPS ELF binaries for us to guess at the cause. You have not provided sufficient information to identify the problem. Are you able to identify where in the Ghidra source it is hung up?

While Ghidra is hung, you can try running the Java jstack command, from a command shell, giving the numeric PID of the Ghidra process which can be identified using the Java jps command. Copy the full stack trace to this issue.

@masterofthepuppets
Copy link
Author

masterofthepuppets commented Sep 30, 2019

2019-09-30 16:56:40
Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0.4+10-LTS mixed mode):

Threads class SMR info:
_java_thread_list=0x0000000065571950, length=21, elements={
0x0000000022c00800, 0x0000000022c02000, 0x0000000022c4b000, 0x0000000022c4f000,
0x00000000636ad800, 0x00000000636b3800, 0x00000000636c4800, 0x000000006387e000,
0x00000000638ab800, 0x0000000002421000, 0x0000000065d1d000, 0x00000000654f8000,
0x00000000661ad800, 0x0000000065e21000, 0x0000000066197000, 0x000000006614c800,
0x0000000065e7b000, 0x00000000668a5800, 0x00000000668a7800, 0x00000000668ab000,
0x00000000668a6000
}

"Reference Handler" #2 daemon prio=10 os_prio=2 cpu=15.60ms elapsed=56.63s tid=0x0000000022c00800 nid=0xe44 waiting on condition  [0x0000000063e3f000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.ref.Reference.waitForReferencePendingList(java.base@11.0.4/Native Method)
	at java.lang.ref.Reference.processPendingReferences(java.base@11.0.4/Reference.java:241)
	at java.lang.ref.Reference$ReferenceHandler.run(java.base@11.0.4/Reference.java:213)

"Finalizer" #3 daemon prio=8 os_prio=1 cpu=31.20ms elapsed=56.63s tid=0x0000000022c02000 nid=0x13f8 in Object.wait()  [0x0000000063fef000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.4/Native Method)
	- waiting on <no object reference available>
	at java.lang.ref.ReferenceQueue.remove(java.base@11.0.4/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x00000000806529e8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(java.base@11.0.4/ReferenceQueue.java:176)
	at java.lang.ref.Finalizer$FinalizerThread.run(java.base@11.0.4/Finalizer.java:170)

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 cpu=0.00ms elapsed=56.61s tid=0x0000000022c4b000 nid=0x13e8 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" #5 daemon prio=5 os_prio=2 cpu=0.00ms elapsed=56.61s tid=0x0000000022c4f000 nid=0xe38 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #6 daemon prio=9 os_prio=2 cpu=7238.45ms elapsed=56.61s tid=0x00000000636ad800 nid=0x13e4 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"C1 CompilerThread0" #14 daemon prio=9 os_prio=2 cpu=1138.81ms elapsed=56.61s tid=0x00000000636b3800 nid=0x1024 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"Sweeper thread" #18 daemon prio=9 os_prio=2 cpu=46.80ms elapsed=56.61s tid=0x00000000636c4800 nid=0xdb0 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Common-Cleaner" #19 daemon prio=8 os_prio=1 cpu=0.00ms elapsed=56.57s tid=0x000000006387e000 nid=0x13f0 in Object.wait()  [0x0000000064b7f000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.4/Native Method)
	- waiting on <no object reference available>
	at java.lang.ref.ReferenceQueue.remove(java.base@11.0.4/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x000000008064f360> (a java.lang.ref.ReferenceQueue$Lock)
	at jdk.internal.ref.CleanerImpl.run(java.base@11.0.4/CleanerImpl.java:148)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)
	at jdk.internal.misc.InnocuousThread.run(java.base@11.0.4/InnocuousThread.java:134)

"Service Thread" #20 daemon prio=9 os_prio=0 cpu=0.00ms elapsed=56.54s tid=0x00000000638ab800 nid=0x13ec runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"DestroyJavaVM" #22 prio=5 os_prio=0 cpu=312.00ms elapsed=56.34s tid=0x0000000002421000 nid=0x13d4 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Log4j2-TF-3-Scheduled-1" #25 daemon prio=5 os_prio=0 cpu=0.00ms elapsed=55.55s tid=0x0000000065d1d000 nid=0x1360 waiting on condition  [0x0000000067efe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@11.0.4/Native Method)
	- parking to wait for  <0x0000000080c22208> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.parkNanos(java.base@11.0.4/LockSupport.java:234)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(java.base@11.0.4/AbstractQueuedSynchronizer.java:2123)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(java.base@11.0.4/ScheduledThreadPoolExecutor.java:1182)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(java.base@11.0.4/ScheduledThreadPoolExecutor.java:899)
	at java.util.concurrent.ThreadPoolExecutor.getTask(java.base@11.0.4/ThreadPoolExecutor.java:1054)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.4/ThreadPoolExecutor.java:1114)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.4/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

"Java2D Disposer" #26 daemon prio=10 os_prio=2 cpu=0.00ms elapsed=55.48s tid=0x00000000654f8000 nid=0x11c8 in Object.wait()  [0x000000006801e000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.4/Native Method)
	- waiting on <no object reference available>
	at java.lang.ref.ReferenceQueue.remove(java.base@11.0.4/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x0000000080c18978> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(java.base@11.0.4/ReferenceQueue.java:176)
	at sun.java2d.Disposer.run(java.desktop@11.0.4/Disposer.java:144)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

"AWT-Shutdown" #27 prio=5 os_prio=0 cpu=0.00ms elapsed=55.48s tid=0x00000000661ad800 nid=0x12c4 in Object.wait()  [0x00000000681fe000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.4/Native Method)
	- waiting on <no object reference available>
	at java.lang.Object.wait(java.base@11.0.4/Object.java:328)
	at sun.awt.AWTAutoShutdown.run(java.desktop@11.0.4/AWTAutoShutdown.java:291)
	- waiting to re-lock in wait() <0x0000000080c1d5c0> (a java.lang.Object)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

"AWT-Windows" #28 daemon prio=6 os_prio=0 cpu=171.60ms elapsed=55.48s tid=0x0000000065e21000 nid=0x10b0 runnable  [0x000000006787f000]
   java.lang.Thread.State: RUNNABLE
	at sun.awt.windows.WToolkit.eventLoop(java.desktop@11.0.4/Native Method)
	at sun.awt.windows.WToolkit.run(java.desktop@11.0.4/WToolkit.java:305)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

"AWT-EventQueue-0" #30 prio=6 os_prio=0 cpu=1934.41ms elapsed=55.47s tid=0x0000000066197000 nid=0x960 waiting on condition  [0x00000000684be000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@11.0.4/Native Method)
	- parking to wait for  <0x0000000080c26e60> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(java.base@11.0.4/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base@11.0.4/AbstractQueuedSynchronizer.java:2081)
	at java.awt.EventQueue.getNextEvent(java.desktop@11.0.4/EventQueue.java:566)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(java.desktop@11.0.4/EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEventsForFilter(java.desktop@11.0.4/EventDispatchThread.java:124)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(java.desktop@11.0.4/EventDispatchThread.java:113)
	at java.awt.EventDispatchThread.pumpEvents(java.desktop@11.0.4/EventDispatchThread.java:109)
	at java.awt.EventDispatchThread.pumpEvents(java.desktop@11.0.4/EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.run(java.desktop@11.0.4/EventDispatchThread.java:90)

"Swing-Shell" #32 daemon prio=10 os_prio=2 cpu=109.20ms elapsed=55.36s tid=0x000000006614c800 nid=0x9ec waiting on condition  [0x000000006959e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@11.0.4/Native Method)
	- parking to wait for  <0x0000000080fcb378> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(java.base@11.0.4/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base@11.0.4/AbstractQueuedSynchronizer.java:2081)
	at java.util.concurrent.LinkedBlockingQueue.take(java.base@11.0.4/LinkedBlockingQueue.java:433)
	at java.util.concurrent.ThreadPoolExecutor.getTask(java.base@11.0.4/ThreadPoolExecutor.java:1054)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.4/ThreadPoolExecutor.java:1114)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.4/ThreadPoolExecutor.java:628)
	at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$1.run(java.desktop@11.0.4/Win32ShellFolderManager2.java:557)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

"TimerQueue" #35 daemon prio=5 os_prio=0 cpu=0.00ms elapsed=55.10s tid=0x0000000065e7b000 nid=0x10d4 waiting on condition  [0x000000006a13e000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@11.0.4/Native Method)
	- parking to wait for  <0x0000000080fd27a8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.parkNanos(java.base@11.0.4/LockSupport.java:234)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(java.base@11.0.4/AbstractQueuedSynchronizer.java:2123)
	at java.util.concurrent.DelayQueue.take(java.base@11.0.4/DelayQueue.java:229)
	at javax.swing.TimerQueue.run(java.desktop@11.0.4/TimerQueue.java:171)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

"Task - Import File" #37 daemon prio=5 os_prio=0 cpu=34257.82ms elapsed=52.32s tid=0x00000000668a5800 nid=0x120 runnable  [0x000000006efad000]
   java.lang.Thread.State: RUNNABLE
	at ghidra.program.database.mem.MemoryBlockDB.putBytes(MemoryBlockDB.java:483)
	at ghidra.program.database.mem.MemoryBlockDB.putBytes(MemoryBlockDB.java:347)
	at ghidra.program.database.mem.MemoryMapDB.setBytes(MemoryMapDB.java:1535)
	at ghidra.program.database.mem.MemoryMapDB.setInt(MemoryMapDB.java:1581)
	at ghidra.app.util.bin.format.elf.extend.MIPS_ElfExtension.adjustTableEntryIfNonZero(MIPS_ElfExtension.java:850)
	at ghidra.app.util.bin.format.elf.extend.MIPS_ElfExtension.fixupGot(MIPS_ElfExtension.java:751)
	at ghidra.app.util.bin.format.elf.extend.MIPS_ElfExtension.processGotPlt(MIPS_ElfExtension.java:682)
	at ghidra.app.util.opinion.ElfProgramBuilder.load(ElfProgramBuilder.java:166)
	at ghidra.app.util.opinion.ElfProgramBuilder.loadElf(ElfProgramBuilder.java:100)
	at ghidra.app.util.opinion.ElfLoader.load(ElfLoader.java:151)
	at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:346)
	at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:83)
	at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:112)
	at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:401)
	at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:351)
	at ghidra.plugin.importer.ImporterDialog$$Lambda$402/0x0000000023707c40.monitoredRun(Unknown Source)
	at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:90)
	at ghidra.util.task.Task.monitoredRun(Task.java:126)
	at ghidra.util.task.TaskRunner.lambda$startTaskThread$1(TaskRunner.java:94)
	at ghidra.util.task.TaskRunner$$Lambda$332/0x00000000235f9c40.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.4/ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.4/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run(java.base@11.0.4/Thread.java:834)

"GhidraSwinglessTimer" #41 daemon prio=6 os_prio=0 cpu=0.00ms elapsed=51.87s tid=0x00000000668a7800 nid=0xd70 in Object.wait()  [0x000000006f47e000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.4/Native Method)
	- waiting on <0x00000000817d4060> (a java.util.TaskQueue)
	at java.util.TimerThread.mainLoop(java.base@11.0.4/Timer.java:553)
	- waiting to re-lock in wait() <0x00000000817d4060> (a java.util.TaskQueue)
	at java.util.TimerThread.run(java.base@11.0.4/Timer.java:506)

"File System Listener" #45 daemon prio=6 os_prio=0 cpu=0.00ms elapsed=51.86s tid=0x00000000668ab000 nid=0xfc4 in Object.wait()  [0x0000000070b7e000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.4/Native Method)
	- waiting on <0x00000000817a7418> (a java.lang.Object)
	at java.lang.Object.wait(java.base@11.0.4/Object.java:328)
	at ghidra.framework.store.FileSystemListenerList$FileSystemEventProcessingThread.doWait(FileSystemListenerList.java:301)
	- waiting to re-lock in wait() <0x00000000817a7418> (a java.lang.Object)
	at ghidra.framework.store.FileSystemListenerList$FileSystemEventProcessingThread.run(FileSystemListenerList.java:292)

"GTimer" #50 daemon prio=6 os_prio=0 cpu=0.00ms elapsed=38.33s tid=0x00000000668a6000 nid=0xcec in Object.wait()  [0x00000000649bf000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.4/Native Method)
	- waiting on <no object reference available>
	at java.util.TimerThread.mainLoop(java.base@11.0.4/Timer.java:553)
	- waiting to re-lock in wait() <0x00000000817e3000> (a java.util.TaskQueue)
	at java.util.TimerThread.run(java.base@11.0.4/Timer.java:506)

"VM Thread" os_prio=2 cpu=62.40ms elapsed=56.64s tid=0x0000000022bfc800 nid=0x13f4 runnable  

"GC Thread#0" os_prio=2 cpu=62.40ms elapsed=56.66s tid=0x0000000002433800 nid=0x13b8 runnable  

"GC Thread#1" os_prio=2 cpu=93.60ms elapsed=55.99s tid=0x0000000065694000 nid=0x1384 runnable  

"GC Thread#2" os_prio=2 cpu=78.00ms elapsed=55.99s tid=0x0000000065694800 nid=0x135c runnable  

"GC Thread#3" os_prio=2 cpu=78.00ms elapsed=55.99s tid=0x0000000065695800 nid=0x85c runnable  

"GC Thread#4" os_prio=2 cpu=78.00ms elapsed=55.43s tid=0x000000006617b800 nid=0x1038 runnable  

"GC Thread#5" os_prio=2 cpu=46.80ms elapsed=55.43s tid=0x0000000066250000 nid=0x10c8 runnable  

"GC Thread#6" os_prio=2 cpu=62.40ms elapsed=55.43s tid=0x000000006617c000 nid=0xcf8 runnable  

"GC Thread#7" os_prio=2 cpu=62.40ms elapsed=55.43s tid=0x0000000065f94800 nid=0x113c runnable  

"G1 Main Marker" os_prio=2 cpu=0.00ms elapsed=56.66s tid=0x0000000002465800 nid=0x13a8 runnable  

"G1 Conc#0" os_prio=2 cpu=15.60ms elapsed=56.66s tid=0x0000000002467000 nid=0x13bc runnable  

"G1 Conc#1" os_prio=2 cpu=31.20ms elapsed=55.42s tid=0x00000000656a0000 nid=0xb10 runnable  

"G1 Conc#2" os_prio=2 cpu=31.20ms elapsed=55.42s tid=0x00000000655ac000 nid=0x1274 runnable  

"G1 Refine#0" os_prio=2 cpu=0.00ms elapsed=56.66s tid=0x000000000250f800 nid=0x13c4 runnable  

"G1 Young RemSet Sampling" os_prio=2 cpu=0.00ms elapsed=56.66s tid=0x0000000022a6f800 nid=0x13e0 runnable  
"VM Periodic Task Thread" os_prio=2 cpu=78.00ms elapsed=56.54s tid=0x00000000638ae800 nid=0x13fc waiting on condition  

JNI global refs: 129, weak refs: 320

@ghidra1
Copy link
Collaborator

ghidra1 commented Sep 30, 2019

Could you try a binary import and run only the ELF Analyzer. Although this too could get hung up if it is miscalculating the symbol count. This should markup the ELF headers including the dynamic table section. Once imported goto the _DYNAMIC symbol and locate the entries which correspond to DT_MIPS_GOTSYM and DT_MIPS_LOCAL_GOTNO . Does it have dynamic entries for either DT_GNU_HASH or DT_HASH? Which? It is possible the hash table processing messed up and produced a very large symbol count. Also locate the entry DT_SYMTAB and navigate to its referenced location where you should see an array of symbol entries. How many entries in the array. It is likely that debug of the ELF import of your binary will be necessary to identify and resolve the issue you are experiencing.

@ghidra1
Copy link
Collaborator

ghidra1 commented Nov 17, 2020

Could you please try the latest release 9.2. Some changes were made in this area which may have resolved this issue.

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

No branches or pull requests

2 participants