This issue tracker is closed. Please visit UPPAAL issue tracker at Github instead.

Bug 397

Summary: Engine crashes when control reaches end of non-void function
Product: UPPAAL Reporter: Lars T. Mikkelsen <ltm>
Component: EngineAssignee: Gerd Behrmann <behrmann>
Status: ASSIGNED ---    
Severity: major    
Priority: P2    
Version: 4.0.5   
Hardware: All   
OS: All   
Architecture:
Attachments: return.xml

Description Lars T. Mikkelsen 2007-02-27 11:54:03 CET
It's possible to create a non-void function that won't return a value. When such a function is called the engine crashes.

Reproducible: Always

Steps to Reproduce:
1. Open the attached system in UPPAAL
2. Switch to the Simulator view

Actual Results:
The engine crashes and the GUI receives a "java.io.IOException: Server connection lost" exception.

Expected Results:
The engine shouldn't crash. In best case the syntax checker should warn that control may reach end of the non-void function.
Comment 1 Lars T. Mikkelsen 2007-02-27 11:54:37 CET
Created attachment 146 [details]
return.xml
Comment 2 Gerd Behrmann 2007-02-27 14:24:29 CET
Confirmed. To be fair, UPPAAL does check for the presence of a return statement, but apparently there is a bug that makes it possible to fool it (as demonstrated by your model).
Comment 3 Gerd Behrmann 2007-02-28 22:04:04 CET
The problem is triggered by the if-statement not having an else case. 
Comment 4 Gerd Behrmann 2007-02-28 22:05:05 CET
Resolved on the 4.0 branch from rev. 2982.
Comment 5 Lars T. Mikkelsen 2007-03-15 10:00:52 CET
Fix confirmed in 4.0.6.
Comment 6 Gerd Behrmann 2007-03-15 10:31:29 CET
The bug is not yet fixed in other branches than 4.0.