Skip to content
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

include/limits.h: wrong size for LONG_MAX causes crash on AArch64 apps #19

Closed
mariasfiraiala opened this issue Aug 3, 2022 · 1 comment

Comments

@mariasfiraiala
Copy link
Contributor

mariasfiraiala commented Aug 3, 2022

Describe the bug

Default size of the data model for AArch64 is 8 (64 bits) for long types, however newlibc ends up defining LONG_MAX as 32 bits.

This issue causes extremely optimized functions, such as memchr (which parses DTB for apps like SQLite or redis), to crash when compiled for AArch64.

Steps to reproduce

Build and run SQLite on AArch64 using newlib support.

Expected behavior

Run the SQLite app without any errors.

Which architectures were you using or does this bug affect?

AArch64

Which platforms were you using or does this bug affect?

KVM

Relevant log output

When I run the SQLite app this is the error I get:

[    0.000000] ERR:  [libkvmpl031] <pl031.c @  187> Failed to find RTC IRQ from DTB

Most likely it is caused by the behaviour of memchr when parsing DTB.

@razvand
Copy link
Contributor

razvand commented Aug 3, 2022

Hi, @mariasfiraiala . Thanks for this. It's indeed an issue with any aarch64 app. Attached (arm-helloworld.zip) is an archive to quickly build and run a helloworld app on aarch64, both with and without newlib, highlighting the issue

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

Successfully merging a pull request may close this issue.

2 participants