{"record":{"id":"e0ee9ebab744f450","repo":"ethereum/go-ethereum","slug":"bench-ecdh-module-not-enabled-n","errorCode":null,"errorMessage":"./bench: ECDH module not enabled.\\n","messagePattern":"\\./bench: ECDH module not enabled\\.\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crypto/secp256k1/libsecp256k1/src/bench.c","lineNumber":203,"sourceCode":"    int invalid_args = have_invalid_args(argc, argv, valid_args, valid_args_size);\n\n    if (argc > 1) {\n        if (have_flag(argc, argv, \"-h\")\n           || have_flag(argc, argv, \"--help\")\n           || have_flag(argc, argv, \"help\")) {\n            help(default_iters);\n            return EXIT_SUCCESS;\n        } else if (invalid_args) {\n            fprintf(stderr, \"./bench: unrecognized argument.\\n\\n\");\n            help(default_iters);\n            return EXIT_FAILURE;\n        }\n    }\n\n/* Check if the user tries to benchmark optional module without building it */\n#ifndef ENABLE_MODULE_ECDH\n    if (have_flag(argc, argv, \"ecdh\")) {\n        fprintf(stderr, \"./bench: ECDH module not enabled.\\n\");\n        fprintf(stderr, \"Use ./configure --enable-module-ecdh.\\n\\n\");\n        return EXIT_FAILURE;\n    }\n#endif\n\n#ifndef ENABLE_MODULE_RECOVERY\n    if (have_flag(argc, argv, \"recover\") || have_flag(argc, argv, \"ecdsa_recover\")) {\n        fprintf(stderr, \"./bench: Public key recovery module not enabled.\\n\");\n        fprintf(stderr, \"Use ./configure --enable-module-recovery.\\n\\n\");\n        return EXIT_FAILURE;\n    }\n#endif\n\n#ifndef ENABLE_MODULE_SCHNORRSIG\n    if (have_flag(argc, argv, \"schnorrsig\") || have_flag(argc, argv, \"schnorrsig_sign\") || have_flag(argc, argv, \"schnorrsig_verify\")) {\n        fprintf(stderr, \"./bench: Schnorr signatures module not enabled.\\n\");\n        fprintf(stderr, \"Use ./configure --enable-module-schnorrsig.\\n\\n\");\n        return EXIT_FAILURE;","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/crypto/secp256k1/libsecp256k1/src/bench.c#L185-L221","documentation":"The bench tool checks, at startup, each optional module's compile-time flag (here ENABLE_MODULE_ECDH). If you ask to benchmark 'ecdh' but the library was configured without --enable-module-ecdh, the macro is undefined and the tool prints this message and exits with EXIT_FAILURE before running anything. It exists to give a clear reason instead of a link error or silent skip.","triggerScenarios":"Invoking ./bench (or ./bench ecdh) on a libsecp256k1 build produced without ./configure --enable-module-ecdh. In geth's repo the vendored copy is built by cgo with a fixed configuration that does not enable ECDH, so any manual bench run asking for 'ecdh' hits this.","commonSituations":"Manually building the vendored crypto/secp256k1/libsecp256k1 bench after geth switched to the cgo build (which omits optional modules); porting bench commands from a distro libsecp256k1 that enabled all modules.","solutions":["Reconfigure and rebuild with the module: ./configure --enable-module-ecdh && make -C src bench (in a standalone checkout of the same version)","Or drop 'ecdh' from the bench invocation and benchmark only the enabled modules","Confirm what is enabled in your build by checking config.h / the configure flags used by the build system"],"exampleFix":"# before\n./configure && make     # ECDH not enabled\n./bench ecdh            # -> ECDH module not enabled\n\n# after\n./configure --enable-module-ecdh && make\n./bench ecdh","handlingStrategy":"validation","validationCode":"#!/bin/sh\n# probe build config before selecting benchmarks\nif grep -q '^#define ENABLE_MODULE_ECDH 1' libsecp256k1/src/../config.h 2>/dev/null; then\n  MODS=\"ecdh\"\nelse\n  MODS=\"\"   # skip ecdh on builds without the module\nfi\n./src/bench $MODS","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure with the full module set you intend to benchmark up front: ./configure --enable-module-ecdh ...","Keep a single configure line in your build script so bench and library builds match","Remember geth's cgo build flags for the vendored copy differ from a manual ./configure"],"tags":["secp256k1","benchmark","build-config","ecdh"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}