{"record":{"id":"cc127aaebfa6ec2c","repo":"DrKLO/Telegram","slug":"s-failed-checksum-is-s","errorCode":null,"errorMessage":"%s: FAILED.  Checksum is %s\n","messagePattern":"(.+?): FAILED\\.  Checksum is (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"TMessagesProj/jni/mozjpeg/md5/md5cmp.c","lineNumber":56,"sourceCode":"  if (argc < 3) {\n    fprintf(stderr, \"USAGE: %s <correct MD5 sum> <file>\\n\", argv[0]);\n    return -1;\n  }\n\n  if (strlen(argv[1]) != 32)\n    fprintf(stderr, \"WARNING: MD5 hash size is wrong.\\n\");\n\n  md5sum = MD5File(argv[2], buf);\n  if (!md5sum) {\n    perror(\"Could not obtain MD5 sum\");\n    return -1;\n  }\n\n  if (!strcasecmp(md5sum, argv[1])) {\n    fprintf(stderr, \"%s: OK\\n\", argv[2]);\n    return 0;\n  } else {\n    fprintf(stderr, \"%s: FAILED.  Checksum is %s\\n\", argv[2], md5sum);\n    return -1;\n  }\n}\n","sourceCodeStart":38,"sourceCodeEnd":60,"githubUrl":"https://github.com/DrKLO/Telegram/blob/45ab8f4308496e1f01026a97fcdb0d58a5274474/TMessagesProj/jni/mozjpeg/md5/md5cmp.c#L38-L60","documentation":"The computed MD5 hash of the file does not match the reference hash provided as an argument. After computing the MD5 via MD5File and comparing it case-insensitively with strcasecmp, if the two strings differ the program reports failure and prints the actual computed checksum so the user can inspect the discrepancy. The program exits with return code -1.","triggerScenarios":"File contents changed since the reference hash was generated; truncated or partially downloaded file; wrong file path pointing to a different file; reference hash from a different version of the file; binary corruption during transfer.","commonSituations":"CI/CD pipelines verifying build artifact integrity where the artifact was rebuilt or updated without updating the stored hash; network transfers that truncate or alter bytes; decompression tools that produce slightly different output; stale cached hash values in version control.","solutions":["Compare the printed actual checksum to the expected one to determine if the file or the hash is wrong.","Recompute and update the reference hash if the file is known to be correct and current: md5sum <file>.","Redownload or rebuild the file if the actual checksum is unexpected (file corruption).","Verify file integrity at the transfer/download layer if the hash mismatch is intermittent."],"exampleFix":"# Recompute the correct hash and update the reference\nmd5sum input.jpg > expected.md5\nmd5cmp \"$(cut -d' ' -f1 expected.md5)\" input.jpg","handlingStrategy":"validation","validationCode":"# Pre-verify checksum before relying on md5cmp\nexpected=\"d41d8cd98f00b204e9800998ecf8427e\"\nactual=$(md5sum \"$file\" | cut -d' ' -f1)\nif [ \"$expected\" != \"$actual\" ]; then\n  echo \"Integrity check failed: expected $expected, got $actual\" >&2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Store checksums in version control alongside artifacts for reproducible verification.","Use sha256sum for stronger integrity verification if MD5 collision resistance matters.","Rebuild and update stored hashes whenever the source file legitimately changes."],"tags":["cli","integrity","md5","checksum-mismatch","mozjpeg"],"backgroundTag":null,"analyzedSha":"45ab8f4308496e1f01026a97fcdb0d58a5274474","analyzedAt":"2026-08-14T05:19:30.815Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}