-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command lookup fails on Aarch64 #260
Comments
I cannot reproduce this behavior, neither on Ubuntu nor within an Alpine Docker container (with GnuCOBOL 3.2 compiled from source). The fact that the command is echoed back seemingly correctly leads me to believe there may be some invisible character(s) in the string. Would you be able to add the following 2 lines to CALL "EncodeHexString" USING LK-INPUT LK-INPUT-LENGTH BUFFER
DISPLAY BUFFER(1:LK-INPUT-LENGTH * 2) Recompile & run, enter |
Hi, thanks for your reply. When I enter |
Thanks for checking. |
Hm, attaching to the server using |
That's something @Gelbpunkt would need to do, as I cannot reproduce this bug report. |
I've just tried the latest commit again, problem still persists. Maybe this is an aarch64 issue? I haven't tried x86_64 yet |
I can reproduce this by passing |
The patch in #270 fixes it for me. Without it, @GitMensch Looks like a GnuCOBOL 3.2 bug to me. I'll check 3.3-dev as well in a moment, and if you'd like I can attempt a minimal repro. |
If this occurs with 3.3-dev - yes, please wrap up a reproducer. Until then I'd guess it may be a bug in the COBOL part (we can easily check where it happens with setting a watchpoint to Maybe you can give that a try to get an idea why the error / where exactly it occurs? If you want and are a bit stuck we could have a 20-30 minute debug / fix session on that today. |
I can confirm the patch in #270 works for me as well. |
The following is a minimal reproductive case for the GnuCOBOL issue, visible in GC 3.2 and also 3.3-dev: IDENTIFICATION DIVISION.
PROGRAM-ID. Main.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 COMMANDS.
02 COMMAND OCCURS 10 TIMES.
03 COMMAND-NAME PIC X(10).
01 PARTS.
02 PART OCCURS 10 TIMES.
03 PART-VALUE PIC X(10).
03 PART-LENGTH BINARY-LONG UNSIGNED.
PROCEDURE DIVISION.
MOVE "help" TO COMMAND-NAME(1)
MOVE "help" to PART-VALUE(1)
MOVE 4 TO PART-LENGTH(1)
DISPLAY "'" COMMAND-NAME(1) "', '" PART-VALUE(1)(1:PART-LENGTH(1)) "'"
GOBACK.
END PROGRAM Main. Note that
|
I'm going to merge #270 as a workaround. Thanks @Gelbpunkt and especially @GitMensch for the debugging help! @GitMensch tracked it down to different code generation between x86_64/Aarch64 due to differences in support for aligned/unaligned memory access between the platforms. However, assuming this will be fixed in GnuCOBOL 3.3, we are bound to come across this bug again at some point as long as we keep support for 3.1 and 3.2. The better workaround would be removal of the Once GitHub Actions adds free Aarch64 runners, I will add them to the test matrix so we at least have some coverage. |
This is a workaround for issue #260. GnuCOBOL with -debug generates different C code on x86_64 and aarch64, with the latter leading to broken variable access when multiple tables are involved in the same statement. This is due to differences in support for unaligned memory accesses between the two architectures.
This is a workaround for issue #260. GnuCOBOL with -debug generates different C code on x86_64 and aarch64, with the latter leading to broken variable access when multiple tables are involved in the same statement. This is due to differences in support for unaligned memory accesses between the two architectures.
Hi, for me entering any command results in "Unknown command", for example:
Everything otherwise works fine, it's just commands that aren't working. I'm on Alpine Linux Edge with gnucobol from this MR. I've tried commits 75d8220 and e99a62b, both have broken commands for me. Otherwise everything works as expected.
The APKBUILD used for building CobolCraft is as follows (the minecraft data is bundled separately):
The text was updated successfully, but these errors were encountered: