-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Environment
- OS and Version: macOS Sequoia 15.0.1
- IDE Version: 1.94.2
- Ada & SPARK Extension Version: ? latest, I think I got it to update
Bug Summary and Reproducer
Bug Summary:
Error - 21:13:44] Request textDocument/formatting failed.
Message: GNATformat failed to format source
Code: -32603 ```
Steps to reproduce:
1. Make a project using the source in [formatting_control.zip](https://github.com/user-attachments/files/17497887/formatting_control.zip), cf #1217
1. Select _Format Document_ from the right button menu.
Expected behavior:
Code formatted (I was hoping to compare the result with #1217).
### Configuration and Logs
[ALS.MAIN] ALS version: 25.0.20241014 ()
[ALS.MAIN] Initializing server ...
[ALS.MAIN] GPR PATH:
[ALS.MAIN] PATH: /Library/Frameworks/Python.framework/Versions/3.10/bin:/Users/simon/Library/Python/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/opt/gcc-14.2.0-1-aarch64/bin:/Users/simon/.alire/bin:/Users/simon/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/Users/simon/bin
[ALS.MAIN] Ada version used for predefined completion: ADA_2020
[ALS.MAIN] In Message_Handler Text_Document_Did_Open URI:
[ALS.MAIN] file:///Users/simon/Developer/bugs/gnat/demo.adb
[ALS.MAIN] Looking for a project... Root:
[ALS.MAIN] file:///Users/simon/Developer/bugs/gnat
[ALS.MAIN] Loading:
[ALS.MAIN] /Users/simon/Developer/bugs/gnat/demo.gpr
[ALS.MAIN] GPR2 Log Messages:
[ALS.MAIN] Prepend Context Id: file:///Users/simon/Developer/bugs/gnat/demo.gpr
[ALS.MAIN] Diag:
_ALS.MAIN_ (PROJECT_TYPE => SINGLE_PROJECT_FOUND,
_ALS.MAIN_ STATUS => VALID_PROJECT,
_ALS.MAIN_ PROJECT_FILE => {GNATCOLL.VFS.VIRTUAL_FILE object},
_ALS.MAIN_ MISSING_ADA_RUNTIME => FALSE,
_ALS.MAIN_ GPR2_MESSAGES => {GPR2.LOG.OBJECT object})
[ALS.MAIN] Out Message_Handler Text_Document_Did_Open
[ALS.MAIN] GPR2 Log Messages:
[ALS.MAIN] Prepend Context Id: file:///Users/simon/Developer/bugs/gnat/demo.gpr
[ALS.MAIN] Diag:
_ALS.MAIN_ (PROJECT_TYPE => CONFIGURED_PROJECT,
_ALS.MAIN_ STATUS => VALID_PROJECT,
_ALS.MAIN_ PROJECT_FILE => {GNATCOLL.VFS.VIRTUAL_FILE object},
_ALS.MAIN_ MISSING_ADA_RUNTIME => FALSE,
_ALS.MAIN_ GPR2_MESSAGES => {GPR2.LOG.OBJECT object})
[ALS.MAIN] in GNATformat Format
[ALS.MAIN] raised CONSTRAINT_ERROR : erroneous memory access
_ALS.MAIN_ 0x0000000105847D68 0x0000000105847DA0 0x00000001058EA6AC 0x00000001058EB5F4 0x0000000104B292C5 0x0000000104B36C5C 0x0000000104A8C0A0 0x0000000104A3C29C 0x00000001049DB52C 0x0000000104A03844 0x0000000104A02DE8 0x0000000104A03058 0x0000000104A03C0C 0x0000000104A03240 0x0000000104A03854 0x0000000104A03884 0x0000000104A02DE8 0x0000000104A04F8C 0x00000001049996E8 0x00000001035BD344 0x00000001035BD620 0x00000001034AFBC8 0x00000001034962DC 0x000000010354930C 0x000000010353D33C 0x000000010252074C 0x000000010252D25C 0x000000010350A53C 0x0000000105831980 0x000000019EE8F2E0
[ALS.MAIN] 0x0000000105847D68 0x0000000105847DA0 0x00000001058EA6AC 0x00000001058EB5F4 0x0000000104B292C5 0x0000000104B36C5C 0x0000000104A8C0A0 0x0000000104A3C29C 0x00000001049DB52C 0x0000000104A03844 0x0000000104A02DE8 0x0000000104A03058 0x0000000104A03C0C 0x0000000104A03240 0x0000000104A03854 0x0000000104A03884 0x0000000104A02DE8 0x0000000104A04F8C 0x00000001049996E8 0x00000001035BD344 0x00000001035BD620 0x00000001034AFBC8 0x00000001034962DC 0x000000010354930C 0x000000010353D33C 0x000000010252074C 0x000000010252D25C 0x000000010350A53C 0x0000000105831980 0x000000019EE8F2E0
### Other VS Code Extensions
_No response_
### Additional context
re: exception traces & macOS:
Compiling with `-g` and `-bargs -E`, `Ada.Exceptions.Exception_Information` gives a much more useful trace. The test program does a recursive call, counting down, and raises an exception on reaching a limit:
$ ./raiser
caught raised CONSTRAINT_ERROR : a message
Load address: 0x10261c000
Call stack traceback locations:
0x102620a7c 0x102620adc 0x10261eb54 0x10261eb7c 0x10261eb7c 0x10261eb7c 0x10261eb7c 0x10261eb7c 0x10261ebc0 0x10261eacc
$ atos -o raiser -l 0x10261c000 0x102620a7c 0x102620adc 0x10261eb54 0x10261eb7c 0x10261eb7c 0x10261eb7c 0x10261eb7c 0x10261eb7c 0x10261ebc0 0x10261eacc
ada__exceptions__complete_and_propagate_occurrence (in raiser) (a-except.adb:1128)
__gnat_raise_exception (in raiser) (a-except.adb:1165)
raiser__inner.0 (in raiser) (raiser.adb:7)
raiser__inner.0 (in raiser) (raiser.adb:9)
raiser__inner.0 (in raiser) (raiser.adb:9)
raiser__inner.0 (in raiser) (raiser.adb:9)
raiser__inner.0 (in raiser) (raiser.adb:9)
raiser__inner.0 (in raiser) (raiser.adb:9)
_ada_raiser (in raiser) (raiser.adb:12)
main (in raiser) (b~raiser.adb:227)