code icon indicating copy to clipboard operation
code copied to clipboard

Vala scanner goes into loop and may crash with certain code

Open jeremypw opened this issue 2 years ago • 2 comments

What Happened?

Inserted some code in the form:

try {
---
---
} catch () {
---
---
}

into a Vala file. On opening the symbol outline it remained blank and inspecting the terminal output indicated it had gone into a loop. Repeated Terminal warning: vala_scanner_read_token: assertion 'self != NULL' failed

Editing the file with "autosave" on resulted in random crashes which back traced to the outline plugin.

Steps to Reproduce

  1. Edit some code containing lines in the form mentioned above with the outline plugin on

Expected Behavior

The outline plugin should handle invalid Vala code without crashing or going into a loop.

OS Version

7.x (Horus)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

jeremypw avatar Jul 20 '23 18:07 jeremypw

I can no longer reproduce this so the cause must have been fixed upstream.

jeremypw avatar Oct 30 '24 11:10 jeremypw

Re-opening as I recently experienced this with another file (but different code). The culprit code seemed to be

if (<condition>) {
    <return value1>;
} else if (<condition2>) {
   <return value2>;
} else if () {
     <return value2>;
}
```

i.e. an empty conditional in an elseif clause.

However, it does not always happen.

jeremypw avatar Nov 05 '25 10:11 jeremypw