{"record":{"id":"2a37a40a9df7683f","repo":"ethereum/go-ethereum","slug":"bench-unrecognized-argument-n-n","errorCode":null,"errorMessage":"./bench: unrecognized argument.\\n\\n","messagePattern":"\\./bench: unrecognized argument\\.\\\\n\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crypto/secp256k1/libsecp256k1/src/bench.c","lineNumber":194,"sourceCode":"    int default_iters = 20000;\n    int iters = get_iters(default_iters);\n\n    /* Check for invalid user arguments */\n    char* valid_args[] = {\"ecdsa\", \"verify\", \"ecdsa_verify\", \"sign\", \"ecdsa_sign\", \"ecdh\", \"recover\",\n                         \"ecdsa_recover\", \"schnorrsig\", \"schnorrsig_verify\", \"schnorrsig_sign\", \"ec\",\n                         \"keygen\", \"ec_keygen\", \"ellswift\", \"encode\", \"ellswift_encode\", \"decode\",\n                         \"ellswift_decode\", \"ellswift_keygen\", \"ellswift_ecdh\"};\n    size_t valid_args_size = sizeof(valid_args)/sizeof(valid_args[0]);\n    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\");","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/crypto/secp256k1/libsecp256k1/src/bench.c#L176-L212","documentation":"This is the argument-validation failure of libsecp256k1's standalone bench tool: any command-line token that does not match the tool's allow-list (specific benchmark names plus flags like -h/--help) prints 'unrecognized argument' plus the help text and exits with EXIT_FAILURE. It is a usage error in the CLI wrapper, not a library failure.","triggerScenarios":"Running ./bench with a typo'd or unsupported argument, e.g. './bench schnorr' on a build without that module, './bench --iters 100' if that flag is not in the valid list, or passing geth-style flags to the vendored binary.","commonSituations":"Developers building crypto/secp256k1's vendored bench from source and passing flags from a different libsecp256k1 version; CI scripts reusing old bench invocations after an upstream vendoring update removed a benchmark name.","solutions":["Run './bench --help' to list the valid benchmark names for your exact vendored version","Fix or remove the offending token in your script/Makefile","Recheck after vendoring upgrades: benchmark sets change between libsecp256k1 releases"],"exampleFix":"# before\n./bench ecdsa-sign   # hyphen not a valid name -> unrecognized argument\n\n# after\n./bench sign         # use the exact names from ./bench --help","handlingStrategy":"validation","validationCode":"#!/bin/sh\n# fail fast on bad args before running\nfor a in \"$@\"; do\n  case \"$a\" in sign|verify|ecdh|recover|schnorrsig|ellswift) ;;\n    *) echo \"unknown bench arg: $a\"; ./bench --help; exit 2 ;;\n  esac\ndone\n./bench \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin bench invocations in scripts and re-validate them after vendoring updates","Run ./bench --help first when picking up a new libsecp256k1 version","Check the exit code (EXIT_FAILURE) in CI instead of ignoring bench failures"],"tags":["secp256k1","benchmark","cli","usage-error"],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}