question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnsupportedOperationException with --search in OCaml backend

See original GitHub issue
  1. Get Nightly build of K framework at commit 3af731f Prebuilt K binary
  2. Open terminal and change into tutorial/1_k/1_lambda/lesson_1
  3. Run kompile --backend ocaml lambda.k
  4. Run krun --search --debug tests/identity.lambda

This occurs with Kool untyped as well. Running without --search is fine, though. I’m running OCaml 4.03.1+dev0-2016-04-25 on Linux Mint 18.3.

java.lang.UnsupportedOperationException
	at org.kframework.backend.ocaml.OcamlRewriter$1.search(OcamlRewriter.java:116)
	at org.kframework.krun.modes.KRunExecutionMode.execute(KRunExecutionMode.java:55)
	at org.kframework.krun.KRun.run(KRun.java:99)
	at org.kframework.krun.KRunFrontEnd.run(KRunFrontEnd.java:90)
	at org.kframework.main.FrontEnd.main(FrontEnd.java:52)
	at org.kframework.main.Main.runApplication(Main.java:114)
	at org.kframework.main.Main.runApplication(Main.java:104)
	at org.kframework.main.Main.main(Main.java:53)
java.lang.UnsupportedOperationException
	at org.kframework.backend.ocaml.OcamlRewriter$1.search(OcamlRewriter.java:116)
	at org.kframework.krun.modes.KRunExecutionMode.execute(KRunExecutionMode.java:55)
	at org.kframework.krun.KRun.run(KRun.java:99)
	at org.kframework.krun.KRunFrontEnd.run(KRunFrontEnd.java:90)
	at org.kframework.main.FrontEnd.main(FrontEnd.java:52)
	at org.kframework.main.Main.runApplication(Main.java:114)
	at org.kframework.main.Main.runApplication(Main.java:104)
	at org.kframework.main.Main.main(Main.java:53)
[Error] Internal: Uncaught exception thrown of type
UnsupportedOperationException.
Please rerun your program with the --debug flag to generate a stack trace, and
file a bug report at https://github.com/kframework/k/issues (null)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dwightguthcommented, Jan 3, 2019

Judging from your stack trace, it looks like a kserver is active, which probably means that you previously compiled this definition with the ocaml backend and the kserver cached the definition when you tried to run it. Then you switched to the java backend, but the kserver was never written to robustly invalidate caches when you recompile a definition, so it still thinks the definition has been built with the ocaml backend. If you run stop-kserver and then run these commands again, it should work. It might be slower though. Generally you should always stop and restart any kserver you started whenever you run kompile more than once on the same definition.

0reactions
ehildenbcommented, Jul 1, 2019

Seems resolved. For the record, as @dwightguth says, krun --search is not supported by the ocaml backend (only by Java and Haskell backends), and the KServer causes issues with cacheing between kompile calls. This led to weird behavior when first running with ocaml backend then trying to switch to java backend for search.

Read more comments on GitHub >

github_iconTop Results From Across the Web

binary-search in OCaml? - Stack Overflow
Your problem is that you are using an exception before it has been defined in the first place. Move the exception Found_It ......
Read more >
CHANGES - third_party/swig - Git at Google
SWIG (Simplified Wrapper and Interface Generator). See the CHANGES.current file for changes in the current version. See the RELEASENOTES file for a summary ......
Read more >
changes - SWIG.org
Without it, Python will do its own slower sequence search. ... Deprecate the equivalent -suffix option provided by the Ocaml backend, but continue...
Read more >
Can I get some reasons to use Java instead of Kotlin? - Reddit
But perhaps you find this lack of openness more important than 'minor niggle'. ... some examples: Haskell, OCaml, Elm, Rust, Standard ML.
Read more >
Programming in Scala - People
Scala compiler will find no such member of class String, but it will find an ... lar in spirit to the ML family...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found