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

native_posix_64/tests/subsys/fs/fat_fs_api/filesystem.fat fails #19231

Closed
pabigot opened this issue Sep 17, 2019 · 1 comment · Fixed by #21668
Closed

native_posix_64/tests/subsys/fs/fat_fs_api/filesystem.fat fails #19231

pabigot opened this issue Sep 17, 2019 · 1 comment · Fixed by #21668
Assignees
Labels
area: File System area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@pabigot
Copy link
Collaborator

pabigot commented Sep 17, 2019

sanitycheck on a 64-bit Linux host always fails with this error:

tirzah[47]$ sanitycheck -f
JOBS: 32
Cleaning output directory /scratch/zephyr/zp1/zephyr/sanity-out
1 tests selected, 0 tests discarded due to filters
total complete:    0/   1   0%  failed:    0

native_posix_64           tests/subsys/fs/fat_fs_api/filesystem.fat          FAILED: error
	see: sanity-out/native_posix_64/tests/subsys/fs/fat_fs_api/filesystem.fat/handler.log

total complete:    1/   1  100%  failed:    1
0 of 1 tests passed with 0 warnings in 3 seconds

===================================================================
starting test - test_fat_mount
ASSERTION FAIL [(res == FR_OK)] @ ZEPHYR_BASE/subsys/fs/fat_fs.c:351
        FS init failed (-5)
@ ZEPHYR_BASE/lib/os/assert.c:39:

The cause is that on this platform the DWORD typedef in fatfs is a 64-bit integer, but the implementation of disk_flash_access_ioctl assumes the output value is always a pointer to a 32-bit integer. As such the sector count and size parameters are half garbage, and a check in f_mkfs fails returning an error code.

@pabigot pabigot added bug The issue is a bug, or the PR is fixing a bug area: File System area: Tests Issues related to a particular existing or missing test labels Sep 17, 2019
@ioannisg ioannisg added the priority: medium Medium impact/importance bug label Sep 23, 2019
@nashif
Copy link
Member

nashif commented Nov 12, 2019

cant reproduce:

i9:zephyr(master): sanitycheck -p native_posix_64 -T tests/subsys/fs/fat_fs_api -v
Renaming output directory to /home/nashif/Work/zephyrproject/zephyr/sanity-out.3
JOBS: 20
Reading test case configuration files under /home/nashif/Work/zephyrproject/zephyr/tests/subsys/fs/fat_fs_api...
Reading platform configuration files under /home/nashif/Work/zephyrproject/zephyr/boards...
Reading platform configuration files under /home/nashif/Work/zephyrproject/zephyr/scripts/sanity_chk/boards...
Building initial testcase list...
1 test configurations selected, 0 configurations discarded due to filters.
Adding tasks to the queue...
1/1 native_posix_64           tests/subsys/fs/fat_fs_api/filesystem.fat.api      PASSED (native 0.007s)

1 of 1 tests passed (100.00%), 0 failed, 0 skipped with 0 warnings in 6.16 seconds
In total 1 test cases were executed on 1 out of total 212 platforms (0.47%)
i9:zephyr(master):

@nashif nashif closed this as completed Nov 12, 2019
aescolar added a commit to aescolar/zephyr that referenced this issue Jan 3, 2020
The FAT FS code clearly does not support platforms where
long is 64bits. See
https://github.com/zephyrproject-rtos/fatfs/blob/master/include/integer.h#L30

So, do not try to run it in native_posix_64
Fixes zephyrproject-rtos#21536
Fixes zephyrproject-rtos#19231

Signed-off-by: Alberto Escolar Piedras <[email protected]>
nashif pushed a commit that referenced this issue Jan 3, 2020
The FAT FS code clearly does not support platforms where
long is 64bits. See
https://github.com/zephyrproject-rtos/fatfs/blob/master/include/integer.h#L30

So, do not try to run it in native_posix_64
Fixes #21536
Fixes #19231

Signed-off-by: Alberto Escolar Piedras <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: File System area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants