Skip to content

CUSTOM(727) (0x02D7) x3 on sample_AC1032.dwg: type code above max_class_number (549) with no class entry #44

Closed

Description

@DrunkOnJava

After #41 three records report object type 0x02D7 = 727, above the file's max_class_number 549, so no class entry exists. Either the object-type read is wrong for those records (e.g. a different type-code encoding for R2018 objects past a threshold) or the code is genuinely out-of-table. Dump the three records' first 64 bits with examples/probe_object_layout.rs and decide; if the type read is wrong, the fix likely recovers more than three records.

Activity

  1. DrunkOnJava commented on Aug 30, 2026

    @DrunkOnJava
    OwnerAuthor

    Investigated in #46. The object-type read is not wrong — leave read_object_type alone.

    The three records decode tag = 01, RC = 0xE7, + 0x1F0 = 727, which is exactly what the bytes say and the documented R2010+ dispatch. They are not objects at all. First 64 bits of each, walked by hand:

    handle-map handle offset bytes (first 24) MS size MC type handle field
    0x15E6 1063953 e7 74 8c 6f 79 e4 0a 7a ec 0f c1 6c 03 52 20 1a 73 78 45 ae a2 75 39 0f 29927 14220 tag 1 → 727 code 9, counter 0, value 0
    0x1607 433069 2f 5a af 05 79 ca d0 7b 95 2b 4b 40 ea f9 73 06 93 8c 01 28 80 ff 10 62 23087 687 tag 1 → 727 code 2, counter 11, value 0xAD2D03ABE5CC1A4E
    0x160F 432785 57 c8 6c 23 84 c1 04 6e cb 89 74 7f b7 53 c4 04 e0 4c 43 80 08 0f 90 3a 18519 (cont) 108 tag 0 → 142 code 1, counter 3, value 0x411BB

    A counter of 11 is an 11-byte handle value, which cannot exist; counter 0, value 0 is not a valid object handle either; and the MS sizes are inconsistent with the MC handle-stream sizes on the same records. Compare a real MESH record, 0x343 at offset 19676: 17 45 40 80 d0 ea 28 25 … — MC 23, tag 1 → 517, and it decodes cleanly.

    Two more handle-map entries carry the same signature and produce the other garbage records on this file: 0x13E2 @ 212392 → CUSTOM(517) (this is the third MESH "error", the one failing inside the preamble) and 0x13E7 @ 229599 → CUSTOM(564), claiming MC = 280,720 bits.

    Root cause is the address space, not the type field. The handle map addresses offsets up to 1,289,590, while AcDb:AcDbObjects assembles to 1,192,851 bytes — which is also the section descriptor's own declared decompressed size. Six handle-map offsets already fall past the end of the assembled buffer and are skipped; the five records above are offsets that land inside the buffer but on the wrong bytes.

    So this issue belongs with #43 (handle-map walker vs. what the class table declares). Suggested re-titling to something like "five handle-map entries resolve to non-records; the map addresses 96,739 bytes past the assembled AcDbObjects section". A cheap integrity gate for the walker while that is open: reject a record whose handle field has counter > 8, since a handle value cannot exceed a u64 — read_handle currently shifts the excess out silently.

  2. added
    type:bug
    and removed on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions