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

Self-referencing/recursive function type fields cause a StackOverflowError when being exported. #6491

Open
Varriount opened this issue May 8, 2024 · 1 comment
Assignees
Labels
Status: Internal This is being tracked internally by the Ghidra team

Comments

@Varriount
Copy link

Varriount commented May 8, 2024

Describe the bug
Exporting a structure type containing a "self-referencing" function type field (e.g., void TaskCallback(TaskCallback *callback)) causes a StackOverflowError.

To Reproduce
Steps to reproduce the behavior:

  1. Create a function type with no parameters (void TaskCallback()).
  2. Modify the function type to accept itself as a parameter (void TaskCallback(TaskCallback *callback)).
  3. Create a structure type with the function type pointer as a field.
  4. Export the structure and function type to a header.

Expected behavior
The structure and function type should both export successfully to a file.

Environment:

  • OS: Windows 11
  • Java Version: OpenJDK 17.0.2
  • Ghidra Version: 11.0.4
  • Ghidra Origin: Official GitHub Distribution
@ryanmkurtz ryanmkurtz self-assigned this May 15, 2024
@ryanmkurtz ryanmkurtz added the Status: Prioritize This is currently being prioritized label May 15, 2024
@ryanmkurtz
Copy link
Collaborator

	at ghidra.program.model.data.DataTypeWriter.getTypeDeclaration(DataTypeWriter.java:552)
	at ghidra.program.model.data.DataTypeWriter.getParameterListString(DataTypeWriter.java:877)
	at ghidra.program.model.data.DataTypeWriter.getFunctionPointerString(DataTypeWriter.java:850)
	at ghidra.program.model.data.DataTypeWriter.getTypeDeclaration(DataTypeWriter.java:552)
	at ghidra.program.model.data.DataTypeWriter.getParameterListString(DataTypeWriter.java:877)
	at ghidra.program.model.data.DataTypeWriter.getFunctionPointerString(DataTypeWriter.java:850)
	at ghidra.program.model.data.DataTypeWriter.getTypeDeclaration(DataTypeWriter.java:552)
	at ghidra.program.model.data.DataTypeWriter.getParameterListString(DataTypeWriter.java:877)
	at ghidra.program.model.data.DataTypeWriter.getFunctionPointerString(DataTypeWriter.java:850)

@ryanmkurtz ryanmkurtz added Status: Triage Information is being gathered Status: Internal This is being tracked internally by the Ghidra team and removed Status: Prioritize This is currently being prioritized Status: Triage Information is being gathered labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

No branches or pull requests

2 participants