Skip to content

Cannot read property 'id' of undefined #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Kobzol opened this issue Mar 26, 2018 · 2 comments
Open

Cannot read property 'id' of undefined #93

Kobzol opened this issue Mar 26, 2018 · 2 comments

Comments

@Kobzol
Copy link

Kobzol commented Mar 26, 2018

Hi, I'm trying to load a fairly large (20 MiB+) Cap file in the browser and it fails on this error:

TypeError: Cannot read property 'id' of undefined
    at Pointer../node_modules/capnp-ts/lib/serialization/pointers/pointer.js.Pointer.toString (pointer.js:44)
    at Object.format (util.js:263)
    at trackPointerAllocation (pointer.js:786)
    at new Pointer (pointer.js:30)
    at followFar (pointer.js:287)
    at followFars (pointer.js:299)
    at getTargetListElementSize (pointer.js:462)
    at isCompositeList (pointer.js:312)
    at Object.getContent (pointer.js:333)
    at getSize (struct.js:412)

Schema:

struct Dim3 {
    x @0 :Int32;
    y @1 :Int32;
    z @2 :Int32;
}

struct MemoryAccess {
    threadIdx @0 :Dim3;
    address @1 :Text;
    value @2 :Text;
}

struct Warp {
    accesses @0 :List(MemoryAccess);
    blockIdx @1 :Dim3;
    warpId @2 :Int32;
    debugId @3 :Int32;
    size @4 :UInt8;
    kind @5 :UInt8;
    space @6 :UInt8;
    typeIndex @7 :Int32;
    timestamp @8 :Text;
}

struct AllocRecord {
    address @0: Text;
    size @1: UInt64;
    elementSize @2: UInt32;
    space @3: UInt8;
    typeIndex @4: Int32;
    typeString @5: Text;
    nameIndex @6: Int32;
    nameString @7: Text;
    location @8: Text;
    active @9: Bool;
}

struct Trace {
    warps @0 :List(Warp);
    allocations @1: List(AllocRecord);
    kernel @2: Text;
    start @3: Float64;
    end @4: Float64;
    type @5: Text;
    gridDim @6: Dim3;
    blockDim @7: Dim3;
    warpSize @8: UInt32;
    bankSize @9: UInt32;
}

It happens both with unpacked and packed files, but only with some files (when I try a smaller file, it parses fine).

I'm using capnp-ts version 0.2.4 and the file was generated with Cap'n Proto v0.6.1 (in C++).
Do you have any idea what might be causing this?
Thanks.

@jdiaz5513
Copy link
Owner

jdiaz5513 commented Aug 29, 2018

The stacktrace is misleading; it's failing because of the traversal limit being exceeded (and then proceeding to fail to fail because the segment is not yet defined... that needs a patch!).

There is potentially a bug in how this is being accounted for since the docs on it were slim; do these same files load fine in another implementation?

@Kobzol
Copy link
Author

Kobzol commented Sep 5, 2018

I tried to load the file with the C++ implementation that generated it and that was successful. I'll try to reproduce the file and attach it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants