Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Inconsistent storage error during compilation #29

Open
RajaSrinivasan opened this issue Jan 29, 2025 · 9 comments
Open

Inconsistent storage error during compilation #29

RajaSrinivasan opened this issue Jan 29, 2025 · 9 comments

Comments

@RajaSrinivasan
Copy link

One of my projects is not building - randomly.

Error message:

Compile
[Ada] cvars.adb
+===========================GNAT BUG DETECTED==============================+
| 14.2.0 (aarch64-apple-darwin23) Storage_Error stack overflow |
| Error detected at cvars.adb:9:5 |
| Compiling /Users/rajasrinivasan/Prj/GitLab/toolkit/examples/cvar/src/cvars.adb|
| Please submit a bug report; see https://gcc.gnu.org/bugs/ . |
| Use a subject line meaningful to you and us to track the bug. |
| Include the entire contents of this bug box in the report. |
| Include the exact command that you entered. |
| Also include sources listed below. |
+==========================================================================+

Please include these source files with error report

identical files will fail randomly. The file - package and spec look like this:

--codemd: begin segment=Variables caption=declaration
with critical_float ;
package cvars is
tempSetpoint : critical_float.Variable_Type ;
pressureSetpoint : critical_float.Variable_Type ;
function allocator( secondary : boolean ) return access Float ;
end cvars ;
--codemd: end

-- codemd: begin segment=Implement caption=Implementation
package body cvars is
function allocator( secondary : boolean ) return access Float is
begin
return new Float ;
end allocator ;
begin
critical_float.SetAllocators( allocator'access );
end cvars ;
--codemd: end

I can provide the package "Critical_float" WHICH IS in a different project - if it will help.

Project builds on linux VMs and Docker - reliably. Hence this "ISSUE"
any clues?

Srini

@simonjwright
Copy link
Owner

What version of macOS?

Please include these source files with error report

Wasn’t there a list of source files? If so, please provide them (you can paste a zip file into a comment here). If not - that’s another question.

I can provide the package "Critical_float" WHICH IS in a different project - if it will help.

It would be a start. Without it there is nothing that I can do. And a complete set of source files would be better.

@simonjwright simonjwright changed the title inconsistent behavior Inconsistent storage error during compilation Jan 29, 2025
@RajaSrinivasan
Copy link
Author

RajaSrinivasan commented Jan 30, 2025 via email

@RajaSrinivasan
Copy link
Author

cvar2.zip

this project build successfully first. I created the zip file right after a failed build.

Hope you are able to identify what is going on. Regards, Srini

@simonjwright
Copy link
Owner

The first time I built it, it failed; thereafter, no problems. This morning, the first build failed:

alr clean; alr build
Note: Building cvar=0.1.0-dev/cvar.gpr...
Compile
   [Ada]          cvar.adb
cvar.adb:1:16: (style) bad casing of "Text_IO" declared at a-textio.ads:58 [-gnatyr]
cvar.adb:1:33: (style) bad casing of "Text_IO" declared at a-textio.ads:58 [-gnatyr]
cvar.adb:2:03: (style) two spaces required [-gnatyc]
cvar.adb:3:20: (style) space not allowed [-gnatyt]
cvar.adb:4:11: (style) space not allowed [-gnatyt]
cvar.adb:8:22: (style) space required [-gnatyt]
cvar.adb:9:22: (style) space required [-gnatyt]
cvar.adb:10:07: (style) space required [-gnatyt]
cvar.adb:11:07: (style) space required [-gnatyt]
cvar.adb:13:03: (style) two spaces required [-gnatyc]
cvar.adb:14:01: (style) blank line not allowed at end of file [-gnatyu]
   [Ada]          critical_float.ads
   [Ada]          cvars.adb
+===========================GNAT BUG DETECTED==============================+
| 14.2.0 (aarch64-apple-darwin23) Storage_Error stack overflow             |
| Error detected at cvars.adb:9:5                                          |
| Compiling /Users/simon/Developer/gcc/distributing-gcc/29/cvar2/src/cvars.adb|
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

/Users/simon/Developer/gcc/distributing-gcc/29/cvar2/src/cvars.adb

:1:04: (style) space required [-gnatyt]
:3:05: (style) bad indentation [-gnaty0]
:4:05: (style) bad indentation [-gnaty0]
:5:09: (style) bad indentation [-gnaty0]
:6:05: (style) bad indentation [-gnaty0]
:8:05: (style) bad indentation [-gnaty0]
:9:10: (style) space not allowed [-gnatyt]
compilation abandoned
critical_float.ads:1:03: (style) two spaces required [-gnatyc]
critical_float.ads:5:03: (style) two spaces required [-gnatyc]

   compilation of cvars.adb failed

gprbuild: *** compilation phase failed
ERROR: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/Users/simon/Developer/gcc/distributing-gcc/29/cvar2/cvar.gpr"] exited with code 4
ERROR: Compilation failed.

The second and third times, similar (not identical) results. Fourth time, compiled OK. Fifth time, error, this time at cvars.ads:7:5

I ran gnatpp -P cvar.gpr, which got rid of most of those style warnings, and didn’t get further failures (what’s codemd? If you make the comments --#codemd you don’t get the warnings).

I restored the source; occasional failures.

I used alr build --release (mainly so those warnings didn’t get reported): successful builds.

alr build --development: occasional failures.

I’ve never seen the compiler fail like this, but then I have a compulsion to get clean compilations whenever possible, so I don’t get that many style warnings. If you really want to suppress all style warnings, alr build -- -gnatyN.

@simonjwright
Copy link
Owner

Try building with e.g. alr build -- -gnaty-c (suppress the -gnatyc switch (check comment format (two spaces))).

@RajaSrinivasan
Copy link
Author

RajaSrinivasan commented Jan 31, 2025 via email

@simonjwright
Copy link
Owner

simonjwright commented Jan 31, 2025

Appreciate your analysis. I didnt even know where to start!

"Analysis" is a big word for "poking at the problem until something seems to make it better"!

I don’t know whether this is an aarch64 problem or applies to x86_64 as well .. it’s certainly still present in GCC 15.0.1.

I’ll leave this issue open for the moment, in case I find something repeatable enough to raise a GCC bug report.

@simonjwright
Copy link
Owner

See GCC PR 118782.

@RajaSrinivasan
Copy link
Author

RajaSrinivasan commented Feb 7, 2025 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants