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

Failed to run XbSymbolDatabaseTool" error upon analysis. #67

Closed
databoose opened this issue Sep 12, 2024 · 8 comments
Closed

Failed to run XbSymbolDatabaseTool" error upon analysis. #67

databoose opened this issue Sep 12, 2024 · 8 comments

Comments

@databoose
Copy link

This is in reference to the closed issue #27

I am re opening this issue as i believe this is could be a bug.

Here is my include setup for the headers :
image

The documentation says " In the Data Type Manager window, right click on your default.xbe and select Apply Function Datatypes."

Once i do this, this error shows up. The same also happens during analysis.

image

The build process does chmod +x XbSymbolDatabaseTool properly, and when i had checked, the file had already been set to executable.

OP's workaround on the original issue thread did not work for me., so i figured this should be investigated further.

Upon looking through ghidra user debug logs, i could find nothing actually referrencing XBSymbolDatabaseTool to maybe get an idea as to what is going on, so my next step was to download the source of this repo and grep the string.

image

Essentially, to my understanding at least, XbSymbolDatabaseTool is within the following file :

https://github.com/XboxDev/ghidra-xbe/blob/master/src/main/java/XbeLoader/XbeXbSymbolDatabaseAnalyzer.java

In the following code here, starting from line 123 , some type of exception is caught, and thus this exact error message is displayed (i could not find an occurence of this error message anywhere else within the entire repo, so pretty sure we narrowed it down here)

I presume perhaps this is a configuration error or some type of ghidra issue, but i thought this would be important enough to re-open as an issue.

                } catch (InterruptedException e) {
			log.appendMsg("Failed to run " + toolExec);
			return false;
		} catch (IOException e) {
			log.appendMsg("Failed to run " + toolExec);
			return false;
		} catch (InvalidInputException e) {
			log.appendMsg("Failed to run " + toolExec);
			return false;
               }
@RadWolfie
Copy link
Contributor

Hi there, can you check your currently installed Ghidra's "Extensions" folder to verify the XBSymbolDatabaseTool binary do exist? The information to find your installed Extension folder can be found on Ghidra's Installation Guide.

If they do exist with permission applied correctly (for double check purpose). Then you may want to manually run XBSymbolDatabaseTool on your preferred terminal to find out if the cli tool do output error.

@databoose
Copy link
Author

databoose commented Sep 13, 2024

Hi there, can you check your currently installed Ghidra's "Extensions" folder to verify the XBSymbolDatabaseTool binary do exist? The information to find your installed Extension folder can be found on Ghidra's Installation Guide.

If they do exist with permission applied correctly (for double check purpose). Then you may want to manually run XBSymbolDatabaseTool on your preferred terminal to find out if the cli tool do output error.

Yes, the XbSymbolDatabaseTool does exist, under /ghidra_11.1.2_PUBLIC/Extensions/ghidra-xbe/os/linux_x86_64/

The SHA1 hash for the binary is 468de43f56393809bdf076d839e4bd658872717c , which matches as the same hash when i manually build the project from the build.shfile and go to the executable.

Now, i tried importing the project in intellij and building it to perhaps debug in runtime, however i am encountering a build issue.

/home/databoose/Desktop/external-projects/ghidra-xbe/src/main/java/XbeLoader/XbeXtlidAnalyzer.java:60: error: package XbeXtlidDb does not exist String[] name_namespace = XbeXtlidDb.xtlids.get(id);

Apologies if this is a simple thing that i'm misunderstanding, for context i hadn't touched java in years, but i'm not sure how to resolve this issue, i atttempted a gradle sync, to no avail of solving the problem to getting it to build and run.

Also; another thing.

Do you guys have a public communications channel by chance? Like a discord or matrix perhaps? I am banned from the XEMU discord from a while back, and i do not remember why or by who, but for whatever it may be i am completely and fully willing to apologize for any past behavior that may have led to the ban. I understand the importance of the server rules and would like to make amends if possible, i want to contribute to the overall OG xbox emulation space, If there's another platform or channel where I can reach out and discuss this further, I'd be grateful for the information.

Thanks and have a good one.

@RadWolfie
Copy link
Contributor

Yes, the XbSymbolDatabaseTool does exist, under /ghidra_11.1.2_PUBLIC/Extensions/ghidra-xbe/os/linux_x86_64/

Okay, the next thing I can think of is xbe you had imported xbe's original file either got moved or no longer exist. If this is not the issue, then I have no idea what may be the cause at this time.

Now, i tried importing the project in intellij and building it to perhaps debug in runtime, however i am encountering a build issue.

/home/databoose/Desktop/external-projects/ghidra-xbe/src/main/java/XbeLoader/XbeXtlidAnalyzer.java:60: error: package XbeXtlidDb does not exist String[] name_namespace = XbeXtlidDb.xtlids.get(id);

Please verify if you have installed xsltproc on your operating system. It is part of the requirement for generate XbeXtlidDb.java file. Then run build.sh script again, hopefully this will resolve your issue. Apologizes if it's still not working, I'm not native to Linux operating systems. Except I do use GitHub's workspace to build ghidra-xbe which require xsltproc to be installed before able to successfully generate XbeXtlidDb.java file.

In the following code here, starting from line 123 , some type of exception is caught, and thus this exact error message is displayed (i could not find an occurence of this error message anywhere else within the entire repo, so pretty sure we narrowed it down here)

Yes, that is where the fault occurred. Except it doesn't include depth information about the cause of crash. Hopefully someday, we will have more details about the cause of crash.

@databoose
Copy link
Author

databoose commented Sep 14, 2024

Please verify if you have installed xsltproc on your operating system. It is part of the requirement for generate XbeXtlidDb.java file. Then run build.sh script again, hopefully this will resolve your issue.

Installing this package on my system, then rebuilding with the build.sh file resolves the issue fully for me, no error when applying function types, or (just to make sure), no error during the entirety of ghidra's analysis.

I had made a pull request regarding this issue to fix it for further users who may have the same issues with the package missing. #68

Thank you for the help, much appreciated.

@RadWolfie
Copy link
Contributor

Hi @databoose, can you test pull request #73 to verify if the details of the issue are explained enough to figure out the cause of the problem?

@databoose
Copy link
Author

databoose commented Sep 21, 2024

Hi @databoose, can you test pull request #73 to verify if the details of the issue are explained enough to figure out the cause of the problem?

@RadWolfie (Apologies for tagging, i'm not sure if replies notify you or if quoting is enough)

So you had made me discover some very strange things today.

I was going to build your PR, however before doing so, i wanted to ensure to remove the xsltproc package, so that the error would actually happen obviously, however, 2 things i discovered :

  1. The build script had actually failed this time, telling me that xsltproc was not found (line 64 on build.sh), the thing is, when having this issue originally, i did not have this package installed, so i am very confused why it tells me this is missing now, but didn't at the time of my first post of this issue thread, as i did not have the package installed.

  2. However, to workaround this, i installed xsltproc, ran build.sh, built just fine, and then i uninstalled xsltproc after building, to ensure the error would happen.

... Now here's thing, the error didn't happen, neither when applying data types, or neither when analysing, which is what would cause it to error orginally, i do not have the package installed at all, and somehow it (at least seems to) run fine.

To be clear, i checked bash history and infact i did immediately remove the xsltproc package right after building your PR of ghidra-xbe.

So, i am thinking possibly this is something on my end, but this is very bewildering and honestly i have no clue how this works, it shouldn't be working at all in theory but it does. This could perhaps be something happening on my end, i'm not sure.

@RadWolfie
Copy link
Contributor

RadWolfie commented Sep 21, 2024

Off topic, the xsltproc package is only needed to build ghidra-xbe plugin. End-users do not need to install the package just to install the ghidra-xbe plugin from this repository's release page. Since it is not relative to XbSymbolDatabaseTool which contains pre-compiled binaries downloaded from Cxbx-Reloaded/XbSymbolDatabase's release page. (Which also doesn't have any dependency to use xsltproc package.)

My current focus is the confusion of why has XbSymbolDatabaseTool failed to run for you. Hence the pull request was created to extend the details of the cause of failure.

@databoose
Copy link
Author

databoose commented Sep 22, 2024

Off topic, the xsltproc package is only needed to build ghidra-xbe plugin. End-users do not need to install the package just to install the ghidra-xbe plugin from this repository's release page. Since it is not relative to XbSymbolDatabaseTool which contains pre-compiled binaries downloaded from Cxbx-Reloaded/XbSymbolDatabase's release page. (Which also doesn't have any dependency to use xsltproc package.)

My current focus is the confusion of why has XbSymbolDatabaseTool failed to run for you. Hence the pull request was created to extend the details of the cause of failure.

Ah that makes sense, thanks for the clarification.

As for the actual XbSymbolDatabaseTool error, yeah, i built yours and it didn't show up any issues for me, which is strange, considering your PR only adds additional details to when the exception is caught.

Like i said this could perhaps be something on my end? Not sure but your build works great for me, i am just unable to trigger the error to be able to help you out here, apologies.

Also, just wanted to say i very much appreciate the amount of help you've given me here in troubleshooting this problem, means a lot, thank you for that.

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

2 participants