AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

gprbuild V22.0.0 creates backtrace on incorrect input instead of error message #116

Open RREE opened 1 year ago

RREE commented 1 year ago

calling gprbuild on the attached gpr-files creates a backtrace. Expand bug.tar.gz and go into AVRAda_Examples:

 ~/.config/alire/cache/dependencies/gprbuild_22.0.1_24dfc1b5/bin/gprbuild -s -j0 -p -P 7seg/seven_segment_disp.gpr
gprbuild: raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : Invalid Id 0
[/home/re/.config/alire/cache/dependencies/gprbuild_22.0.1_24dfc1b5/bin/gprbuild]
0x8aab60 system__assertions__raise_assert_failure at ???
0x677161 gpr__names__get_name_string__5 at ???
0x5bfc61 gpr__conf__get_element_or_empty at ???
0x5c811f gpr__conf__get_or_create_configuration_file at ???
0x5c9d5b gpr__conf__process_project_and_apply_config at ???
0x5ca5d2 gpr__conf__parse_project_and_apply_config at ???
0x4a0430 _ada_gprbuild__main at ???
0x490bc4 main at ???
[/lib/x86_64-linux-gnu/libc.so.6]
0x7fdf8e6f9d08
[/home/re/.config/alire/cache/dependencies/gprbuild_22.0.1_24dfc1b5/bin/gprbuild]
0x490c18 _start at ???
0xfffffffffffffffe

gprbuild 18.0w (standard Debian version) gives a friendlier message, but still not very helpful:

gprbuild -s -j0 -p -P 7seg/seven_segment_disp.gpr
gprbuild: raised CONSTRAINT_ERROR : gpr-names.adb:231 range check failed
t-14 commented 1 year ago

The crash is of course not expected, but the project is illegal: for Runtime ("Ada") use Avrada_Rts.Runtime; - there is no variable Runtime defined in Avrada_Rts. Probably what was intended is an attribute reference, something like for Runtime use Avrada_Rts'Runtime;

(edit: the crash is due to an import of a missing file "mcu.gpr")

RREE commented 1 year ago

Yes, the intend was to use an attribure reference. But a simple misunderstanding or typing error (. <--> ') or (as you have already found, thanks) a missing with should not cause a crash. That's why the issue title contains "... on incorrect input ...".

BTW, the file mcu.gpr is present in my case. I probably missed to send it in the bug report.

t-14 commented 1 year ago

(edit - never mind, I got my wires crossed)

GuillermoHazebrouck commented 12 months ago

For the records, I get the same error when calling --show-targets:

$ gprconfig --show-targets
raised CONSTRAINT_ERROR : gpr-names.adb:231 range check failed

on this gprbuild version:

$ gprbuild --version
GPRBUILD Pro 18.0w (19940713) (x86_64-linux-gnu)
Copyright (C) 2004-2016, AdaCore
This is free software; see the source for copying conditions.
See your AdaCore support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.