Skip to content
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

Stack overflow #17

Open
hmedina opened this issue May 16, 2023 · 3 comments
Open

Stack overflow #17

hmedina opened this issue May 16, 2023 · 3 comments

Comments

@hmedina
Copy link
Collaborator

hmedina commented May 16, 2023

Given the various branches and fixes in KaTools, I tried checking if the current state of KaTools/master (v4.1-97-gb9248b7) and KaTIE/master ("V0.3", pinned & fetched an hour ago) can read the traces I already have. Unfortunately, I get:

$ KaTie -t trace.json -q testing_query.katie --output-dir testing_query
Evaluating queries: 1 simple and 0 complex
Fatal error: exception Stack overflowssed)
Raised by primitive operation at Stdlib__Hashtbl.find in file "hashtbl.ml", line 541, characters 9-23
Called from Kappa_terms__Instantiation.subst_map_concrete_agent in file "core/term/instantiation.ml", line 256, characters 9-13
Called from Kappa_terms__Instantiation.subst_map_site in file "core/term/instantiation.ml", line 260, characters 12-16
Called from Kappa_terms__Instantiation.subst_map2_agent_in_action in file "core/term/instantiation.ml", line 308, characters 16-38
Called from Stdlib__List.map in file "list.ml", line 92, characters 20-23
Called from Stdlib__List.map in file "list.ml", line 92, characters 32-39
[last line repeats 1018 times]

I believe the line about the overflow, got printed over the "nM events processed", hence the "overflowssed". Probably.

The testing simple query:

query 'test.csv'
match c:{ +b: bCat() }
return {
        'c': time[c],
        'i': agent_id{b}
}

Is this an issue with KaTIE, or KaTools? I.e. should I iterate over KaTools commits until I find one that doesn't error..?

@jonathan-laurent
Copy link
Owner

This looks like a KaTools problem indeed. Can you isolate the faulty commit on KaTools?
Also, is this the full stack trace? Is there nothing below [last line repeats 1018 times]?

@hmedina
Copy link
Collaborator Author

hmedina commented May 16, 2023

Ok, so I've tested KaTools commit all the way to the is_agent_id fix, and I'm seeing the same error (just changing the line numbers).

For prior KaTools commits, KaTie won't compile because the edges.is_agent_id call becomes unbound.

I then try to compile KaTie versions that predate this API change, but now the Dune / Opam configuration file is not finalized (e.g. missing a name, not making an building an executable, etc.), so now I'm skeptical that keeping rewinding KaTie's fixes to rewind KaTools' is the right way...

From the error message, this stack overflow is coming from instantiation.ml, line 308, which from the GitBlame view, is not code that has been changed in 7 years. Upstream on the stack is line 260; again not changed in years. Upstream is 256; also not changed in years. And finally the stdlib's hashtb.find, which ... I doubt this is a bug in OCaml's stdlib.

Rather, this looks like a problem resolving a concrete agent following a free operation, which sounds a lot like the side-effect & agent-id issues we've discovered this past month. Does sound like a good lead to you, or am I chasing the wrong goat here?

@jonathan-laurent
Copy link
Owner

Ok, I can have a look. Can you push a new test replicating the issue? Is there any issue with the other tests?

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

No branches or pull requests

2 participants