{"record":{"id":"d808d2a2a2fe7a49","repo":"NationalSecurityAgency/ghidra","slug":"query-signature-data-has-no-setting-information","errorCode":null,"errorMessage":"Query signature data has no setting information","messagePattern":"Query signature data has no setting information","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/FunctionDatabase.java","lineNumber":222,"sourceCode":"\t * Send a query to the database.  The response is returned as a QueryResponseRecord.\n\t * If this is null, an error has occurred and an error message can be obtained from getLastError\n\t * @param query an object describing the query\n\t * @return the response object or null if there is an error\n\t */\n\tpublic QueryResponseRecord query(BSimQuery<?> query);\n\n\tpublic static void checkSettingsForQuery(DescriptionManager manage, DatabaseInformation info)\n\t\t\tthrows LSHException {\n\t\tfinal int res = info.checkSignatureSettings(manage.getMajorVersion(),\n\t\t\tmanage.getMinorVersion(), manage.getSettings());\n\t\tif (res <= 1) {\n\t\t\treturn;\n\t\t}\n\t\tif (res == 4) {\n\t\t\treturn;\n\t\t}\n\t\tif (res == 3) {\n\t\t\tthrow new LSHException(\"Query signature data has no setting information\");\n\t\t}\n\t\tthrow new LSHException(\"Query signature data \" +\n\t\t\tgetFormattedVersion(manage.getMajorVersion(), manage.getMinorVersion(),\n\t\t\t\tmanage.getSettings()) +\n\t\t\t\" does not match database \" +\n\t\t\tgetFormattedVersion(info.major, info.minor, info.settings));\n\t}\n\n\tprivate static String getFormattedVersion(int maj, int min, int settings) {\n\t\treturn String.format(\"%d.%d:0x%02x\", maj, min, settings);\n\t}\n\n\tpublic static boolean checkSettingsForInsert(DescriptionManager manage,\n\t\t\tDatabaseInformation info) throws LSHException, DatabaseNonFatalException {\n\t\tif (manage.numFunctions() == 0) {\n\t\t\tthrow new DatabaseNonFatalException(\"Empty signature file\");\n\t\t}\n\t\tint res = info.checkSignatureSettings(manage.getMajorVersion(), manage.getMinorVersion(),","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/FunctionDatabase.java#L204-L240","documentation":"Thrown by FunctionDatabase.checkSettingsForQuery when the incoming query signature data has no setting information (checkSignatureSettings returns 3, meaning the query's major version is 0 or its settings value is 0). BSim refuses to run a query against a database when the query payload itself carries no signature-settings metadata, because the results could not be meaningfully compared.","triggerScenarios":"Calling checkSettingsForQuery with a DescriptionManager whose loaded signature file has major version 0 or settings 0. This happens when a .gsig/.bsim signature file was generated without embedding version/settings metadata, or was produced by a tool/older version that left those fields unset.","commonSituations":"Querying a BSim database with a signature file exported from a mismatched or older Ghidra version. Loading a corrupted or truncated signature file where the header metadata was lost. Manually constructing a DescriptionManager and forgetting to call setVersion/setSettings.","solutions":["Regenerate the query signature file with the current Ghidra/BSim tooling so it embeds a non-zero major version and non-zero signature settings.","Open the signature file in a hex editor or BSim tool and confirm the version/settings header fields are populated rather than zero.","Ensure the GenSignatures vector factory has a non-zero settings value (see error 730) before generating query signatures."],"exampleFix":"// before: querying with a settings-less signature payload\nFunctionDatabase.checkSettingsForQuery(manage, info);\n// after: regenerate the signature file with a properly configured vector factory first\ngenSignatures.setVectorFactory(vectorFactory); // factory.getSettings() != 0\nFunctionDatabase.checkSettingsForQuery(manage, info);","handlingStrategy":"validation","validationCode":"// Validate signature payload has settings before querying\nDescriptionManager manage = /* loaded */;\nif (manage.getMajorVersion() == 0 || manage.getSettings() == 0) {\n    throw new IllegalStateException(\n        \"Query signature file has no settings info (major=\" + manage.getMajorVersion()\n        + \", settings=\" + manage.getSettings() + \"); regenerate it with current BSim tooling\");\n}\nFunctionDatabase.checkSettingsForQuery(manage, info);","typeGuard":null,"tryCatchPattern":"try {\n    FunctionDatabase.checkSettingsForQuery(manage, info);\n} catch (LSHException e) {\n    if (e.getMessage().contains(\"no setting information\")) {\n        log.error(\"Query signatures lack settings metadata; regenerate the file\", e);\n    }\n    throw e;\n}","preventionTips":["Always generate query signatures with a fully initialized vector factory (settings != 0).","Validate the signature file header (major version, settings) right after loading, before any query.","Keep the signature-generation and database-creation pipeline on the same Ghidra version."],"tags":["bsim","signature-settings","version-mismatch","validation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}