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

Accepting or returning a value of type type<...> triggers ColToSilver$NotSupported #1308

Open
wandernauta opened this issue Feb 10, 2025 · 0 comments
Labels
A-Bug F-all Frontend: all Fuzzing Found by fuzzing

Comments

@wandernauta
Copy link
Contributor

wandernauta commented Feb 10, 2025

The type generic type, for instance type<bool>, appears to be accepted as a possible parameter type or return type for functions and predicates, but then triggers a NotSupported exception in the ColToSilver transform. For example, in PVL:

void x(type<void> y) { }

In Java:

/*@ resource x(type<int> y); */

The error message, "This kind of node (TType) is not supported by silver directly", blames the correct node in the program, so it would not be difficult for a user to find the problem, but the crash is probably unexpected.

viper.api.transform.ColToSilver$NotSupported: ======================================
18 }
   19 
                      [----------
   20 void x1(int tid, type y) returns (Void res) {
                       ----------]
   21     ref exc;
   22     Void return1;
--------------------------------------
This kind of node (TType) is not supported by silver directly. Is there a rewrite missing?
======================================
	at viper.api.transform.ColToSilver.$qmark$qmark(ColToSilver.scala:57)
	at viper.api.transform.ColToSilver.typ(ColToSilver.scala:347)
	at viper.api.transform.ColToSilver.variable(ColToSilver.scala:321)
	at viper.api.transform.ColToSilver.$anonfun$collect$8(ColToSilver.scala:248)
	at scala.collection.immutable.List.map(List.scala:250)
	at scala.collection.immutable.List.map(List.scala:79)
	at viper.api.transform.ColToSilver.$anonfun$collect$6(ColToSilver.scala:248)
	at viper.api.transform.ColToSilver.scoped(ColToSilver.scala:120)
	at viper.api.transform.ColToSilver.collect(ColToSilver.scala:238)
	at viper.api.transform.ColToSilver.$anonfun$transform$16(ColToSilver.scala:176)
	at viper.api.transform.ColToSilver.$anonfun$transform$16$adapted(ColToSilver.scala:176)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at viper.api.transform.ColToSilver.transform(ColToSilver.scala:176)
	at viper.api.transform.ColToSilver$.transform(ColToSilver.scala:26)
	at viper.api.backend.SilverBackend.$anonfun$transform$1(SilverBackend.scala:91)
	at hre.progress.task.NameSequenceTask.scope(NameSequenceTask.scala:16)
	at hre.progress.Progress$.stages(Progress.scala:47)
	at viper.api.backend.SilverBackend.transform(SilverBackend.scala:90)
	at viper.api.backend.SilverBackend.transform$(SilverBackend.scala:81)
	at viper.api.backend.silicon.Silicon.transform(Silicon.scala:34)
	at vct.main.stages.SilverBackend.transform(Backend.scala:196)
	at vct.main.stages.Backend.$anonfun$run$3(Backend.scala:152)
	at hre.progress.Progress$.$anonfun$map$2(Progress.scala:35)
	at hre.progress.task.AbstractTask.frame(AbstractTask.scala:166)
	at hre.progress.Progress$.$anonfun$map$1(Progress.scala:35)
	at scala.collection.parallel.IterableSplitter$Mapped.next(RemainsIterator.scala:463)
	at scala.collection.immutable.List.prependedAll(List.scala:153)
	at scala.collection.immutable.List$.from(List.scala:684)
	at scala.collection.immutable.List$.from(List.scala:681)
	at scala.collection.SeqFactory$Delegate.from(Factory.scala:306)
	at scala.collection.immutable.Seq$.from(Seq.scala:42)
	at scala.collection.immutable.Seq$.from(Seq.scala:39)
	at scala.collection.IterableFactory$ToFactory.fromSpecific(Factory.scala:274)
	at scala.collection.IterableOnceOps.to(IterableOnce.scala:1310)
	at scala.collection.IterableOnceOps.to$(IterableOnce.scala:1310)
	at scala.collection.parallel.IterableSplitter$Mapped.to(RemainsIterator.scala:460)
	at vct.main.stages.Backend.$anonfun$run$1(Backend.scala:153)
	at hre.progress.task.NameSequenceTask.scope(NameSequenceTask.scala:16)
	at hre.progress.Progress$.stages(Progress.scala:47)
	at vct.main.stages.Backend.run(Backend.scala:145)
	at vct.main.stages.Backend.run$(Backend.scala:137)
	at vct.main.stages.SilverBackend.run(Backend.scala:184)
	at vct.main.stages.SilverBackend.run(Backend.scala:184)
	at hre.stages.Stages.$anonfun$run$3(Stages.scala:104)
	at hre.stages.Stages.$anonfun$run$3$adapted(Stages.scala:101)
	at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
	at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:933)
	at scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:903)
	at hre.stages.Stages.$anonfun$run$1(Stages.scala:101)
	at hre.progress.task.NameSequenceTask.scope(NameSequenceTask.scala:16)
	at hre.progress.Progress$.stages(Progress.scala:47)
	at hre.stages.Stages.run(Stages.scala:98)
	at hre.stages.Stages.run$(Stages.scala:95)
	at hre.stages.StagesPair.run(Stages.scala:145)
	at vct.main.modes.Verify$.verifyWithOptions(Verify.scala:64)
	at vct.main.modes.Verify$.$anonfun$runOptions$3(Verify.scala:99)
	at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.scala:17)
	at hre.util.Time$.logTime(Time.scala:23)
	at vct.main.modes.Verify$.runOptions(Verify.scala:99)
	at vct.main.Main$.runMode(Main.scala:107)
	at vct.main.Main$.$anonfun$runOptions$3(Main.scala:100)
	at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.scala:17)
	at hre.middleware.Middleware$.using(Middleware.scala:78)
	at vct.main.Main$.$anonfun$runOptions$2(Main.scala:100)
	at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.scala:17)
	at hre.io.Watch$.booleanWithWatch(Watch.scala:58)
	at vct.main.Main$.$anonfun$runOptions$1(Main.scala:100)
	at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.scala:17)
	at hre.middleware.Middleware$.using(Middleware.scala:78)
	at vct.main.Main$.runOptions(Main.scala:95)
	at vct.main.Main$.main(Main.scala:50)
	at vct.main.Main.main(Main.scala)
[ERROR] !*!*!*!*!*!*!*!*!*!*!*!
[ERROR] ! VerCors has crashed !
[ERROR] !*!*!*!*!*!*!*!*!*!*!*!

Version: 2bd3bca (dev branch).

This issue was found by fuzzing.

@superaxander superaxander added A-Bug F-all Frontend: all Fuzzing Found by fuzzing labels Feb 10, 2025
@wandernauta wandernauta changed the title Accepting an argument of type type<...> triggers ColToSilver$NotSupported Accepting or returning a value of type type<...> triggers ColToSilver$NotSupported Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Bug F-all Frontend: all Fuzzing Found by fuzzing
Projects
None yet
Development

No branches or pull requests

2 participants