{"record":{"id":"98607c620bf441fb","repo":"apache/hadoop","slug":"failed-to-calloc-options","errorCode":null,"errorMessage":"failed to calloc options\n","messagePattern":"failed to calloc options\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/vecsum.c","lineNumber":171,"sourceCode":"\n    // Type of vecsum to do\n    enum vecsum_type ty;\n\n    // RPC address to use for HDFS\n    const char *rpc_address;\n};\n\nstatic struct options *options_create(void)\n{\n    struct options *opts = NULL;\n    const char *pass_str;\n    const char *ty_str;\n    const char *length_str;\n    int ty;\n\n    opts = calloc(1, sizeof(struct options));\n    if (!opts) {\n        fprintf(stderr, \"failed to calloc options\\n\");\n        goto error;\n    }\n    opts->path = getenv(\"VECSUM_PATH\");\n    if (!opts->path) {\n        fprintf(stderr, \"You must set the VECSUM_PATH environment \"\n            \"variable to the path of the file to read.\\n\");\n        goto error;\n    }\n    length_str = getenv(\"VECSUM_LENGTH\");\n    if (!length_str) {\n        length_str = \"2147483648\";\n    }\n    opts->length = atoll(length_str);\n    if (!opts->length) {\n        fprintf(stderr, \"Can't parse VECSUM_LENGTH of '%s'.\\n\",\n                length_str);\n        goto error;\n    }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/vecsum.c#L153-L189","documentation":"Error \"failed to calloc options\n\" thrown in apache/hadoop.","triggerScenarios":"calloc for the hadoopRzOptions structure returned NULL in vecsum.","commonSituations":"Memory exhaustion before the zerocopy options could be allocated.","solutions":["Ensure adequate free memory; the options struct is small, so this signals severe memory pressure.","Investigate earlier allocations in the process for leaks."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}