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

Bug 397 - Engine crashes when control reaches end of non-void function
Summary: Engine crashes when control reaches end of non-void function
Status: ASSIGNED
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: Engine (show other bugs)
Version: 4.0.5
Hardware: All All
: P2 major
Assignee: Gerd Behrmann
URL:
Depends on:
Blocks:
 
Reported: 2007-02-27 11:54 CET by Lars T. Mikkelsen
Modified: 2007-05-13 18:09 CEST (History)
0 users

See Also:
Architecture:


Attachments
return.xml (768 bytes, application/xml)
2007-02-27 11:54 CET, Lars T. Mikkelsen
Details

Note You need to log in before you can comment on or make changes to this bug.
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.