MuntashirAkon/AppManager · error · IllegalArgumentException
Minor device number is out of range: + devNo
Error message
Minor device number is out of range: + devNo
What it means
Thrown by TarArchiveEntry.setDevMinor when the minor device number passed in is negative. Device numbers in tar entries are unsigned per the format, so a negative value cannot be represented and the method rejects it eagerly rather than writing a corrupt entry.
Solutions
- Fix the caller so it never passes a negative device number (clamp or validate before calling setDevMinor)
- Check the archive integrity: regenerate the tar with a standards-compliant tool (GNU tar, bsdtar)
- If you do not care about device metadata, skip calling setDevMinor for device-type entries you don't reproduce
- Catch IllegalArgumentException around archive parsing and treat it as a corrupt-archive case
Example fix
// before
entry.setDevMinor(readDevMinorFromHeader()); // may be -1 on malformed data
// after
int devMinor = readDevMinorFromHeader();
if (devMinor >= 0) {
entry.setDevMinor(devMinor);
} Defensive patterns
Strategy: validation
Validate before calling
if (devNo < 0) { throw new IllegalArgumentException("devNo must be >= 0, got " + devNo); }
entry.setDevMinor(devNo); Type guard
boolean isValidDevNo(int devNo) { return devNo >= 0; } Try / catch
try {
entry.setDevMinor(devNo);
} catch (IllegalArgumentException e) {
// treat as corrupt/malicious archive metadata
throw new IOException("Invalid device number in archive", e);
} Prevention
- Validate all header-derived numbers before applying them to entries
- Only apply device metadata for entries you actually reconstruct
- Sanitize untrusted archives with a parser before processing
When it happens
Trigger: Calling setDevMinor(-1) (or any negative int) directly, or indirectly when processPaxHeader parses a PAX header whose 'devminor' value parses to a negative number (e.g. malformed or malicious header data).
Common situations: Parsing hand-crafted, truncated, or maliciously crafted tar archives where PAX extended headers contain invalid devminor values; tools that copy file metadata from stat structures on unusual filesystems.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- The offset can not be smaller than 0
- Android System (android) cannot be backed up.
- Android System (android) cannot be restored.
- APK files backup is requested but no APK files have been…
- APK files backup is requested but no APK files have been…
AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12).
Data as JSON: /api/errors/c29219966892cb9c.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java:958
* Get this entry's minor device number.
*
* @return This entry's minor device number.
* @since 1.4
*/
public int getDevMinor() {
return devMinor;
}
/**
* Set this entry's minor device number.
*
* @param devNo This entry's minor device number.
* @throws IllegalArgumentException if the devNo is < 0.
* @since 1.4
*/
public void setDevMinor(final int devNo) {
if (devNo < 0) {
throw new IllegalArgumentException("Minor device number is out of " + "range: " + devNo);
}
this.devMinor = devNo;
}
/**
* Indicates in case of an oldgnu sparse file if an extension
* sparse header follows.
*
* @return true if an extension oldgnu sparse header follows.
*/
public boolean isExtended() {
return isExtended;
}
/**
* Get this entry's real file size in case of a sparse file.
* <p>If the file is not a sparse file, return size instead of realSize.</p>
*View on GitHub (pinned to 0152f468fc)