AL icon indicating copy to clipboard operation
AL copied to clipboard

The AL Server crashed 5 times in the last 3 minutes

Open Hilbekale opened this issue 1 year ago • 3 comments

Please include the following with each issue:

1. Describe the bug

I have the same issue as describer in Ticket https://github.com/microsoft/AL/issues/540.

After modifying AL Code this error:

image

Reloading VS Code did not help and i start investigating. I noticed that this issue occurs for me, because i created a function with variables but i did not defined the var line in front of the variables.

    procedure DeleteTourPlanLineManually(var BITBETourPlanLine: Record "BITBE Tour Plan Line")
        ManualDeletionLbl: Label 'Tour Plan Line: Line manually deleted.', Comment = 'DES="Tourplanzeile: Zeile manuell gelöscht."';
    begin
        DeleteTourPlanLine(BITBETourPlanLine, ManualDeletionLbl);
    end;

The function should look like this:

    procedure DeleteTourPlanLineManually(var BITBETourPlanLine: Record "BITBE Tour Plan Line")
    var
        ManualDeletionLbl: Label 'Tour Plan Line: Line manually deleted.', Comment = 'DES="Tourplanzeile: Zeile manuell gelöscht."';
    begin
        DeleteTourPlanLine(BITBETourPlanLine, ManualDeletionLbl);
    end;

2. To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  • Create a new AL Project
  • Create a new function in a custom codeunit and define a label as a variable.
  • Delete the var line.

3. Expected behavior

I would expect that the AL Server is not crashing and pointing to the issue instead.

4. Actual behavior

The AL Server is crashing and therefore further development is limited.

5. Versions:

  • AL Language: v13.0.1027618
  • Visual Studio Code:

Version: 1.90.0 (system setup) Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573 Date: 2024-06-04T19:33:54.889Z Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.17763

  • Business Central: 24
  • List of Visual Studio Code extensions that you have installed: AL Extension Pack (https://marketplace.visualstudio.com/items?itemName=waldo.al-extension-pack)

Final Checklist

Please remember to do the following:

  • [x] Search the issue repository to ensure you are reporting a new issue

  • [x] Reproduce the issue after disabling all extensions except the AL Language extension

  • [x] Simplify your code around the issue to better isolate the problem

Hilbekale avatar Jun 12 '24 06:06 Hilbekale

I tried reproducing this but couldn't, but it could be that I'm also missing some context. Can you try using the pre-release version to check if it reproduces on that build as well? It should be AL extension version 14 and above.

If you can share the verbose logs, that will also help since it will give us the stacktraces. Can you do the following?

  1. In your VSCode settings.json, set "al.editorServicesLogLevel": "Verbose"
  2. Reproduce the scenario
  3. Under the path C:\Users\<username>\.vscode\extensions\ms-dynamics-smb.al-<version>\bin\win32, collect the editorservice.log and debuggerservices.log files.

Thanks!

thloke avatar Jun 17 '24 03:06 thloke

EditorServices.log EditorServices_Error.log

There was not any debuggerservices.log created. I uploaded both clean files. One with the error and one without the error.

This is the affected object:

TourMgt.Codeunit.al.txt

Crash also happens in prelease version: Tested with v14.0.1044805 (pre-release)

It is not a big deal for me. Just wanted to share that there is a potential problem.

Hilbekale avatar Jun 19 '24 13:06 Hilbekale

Sorry for the slow reply on this. The full .al file has the culprit. For the crash to occur, you need to have the documentation comment on the method. The following minimal repro will always trigger the crash:

codeunit 50100 MyCod
{
    /// Comment
    /// </summary>
    /// <param name="Param"></param>

    procedure Proc(var Param: Integer)
        Lbl: Label 'Lbl', Comment = 'DES="DES Lbl"';
    begin
    end;
}

thloke avatar Sep 10 '24 03:09 thloke

Root case was identified elsewhere as the invalid return type - labels cannot be return types and in combination with code comments that caused an issue.

SBalslev avatar Feb 11 '25 08:02 SBalslev