Skip to contentSkip to conversation

About Segmentation fault of mkfs.erofs in AOSP

DISCUSSION Yue Hu 2 participants 6 messages Dec 1, 2020 – Dec 2, 2020

lore
Share & tools
lore

Yue Hu

author
#0 lore raw

hi guys,

I'm trying using erofs for super.img(dynamic partition) under Android 10. But i have met an issue below when building images:

```log
EROFS: write_uncompressed_block() Line[140] Writing 3517 uncompressed data to block 63950
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc/xtwifi.conf (nid 8185600, type 1)
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc (nid 1790208, type 2)
out/host/linux-x86/bin/mkerofsimage.sh: line 79: 188014 Segmentation fault      (core dumped) $MAKE_EROFS_CMD
```

Have you met this kind of issue? I'm trying to debug the problem, looks like memory related.

BTW: i'm using latest erofs-utils in AOSP master branch (https://android.googlesource.com/platform/external/erofs-utils/).

Thx.

#1 lore raw

Hi Yue,

Quoted 11 lines · Yue Hu

hi guys,

I'm trying using erofs for super.img(dynamic partition) under Android 10. But i have met an issue below when building images:

```log
EROFS: write_uncompressed_block() Line[140] Writing 3517 uncompressed data to block 63950
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc/xtwifi.conf (nid 8185600, type 1)
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc (nid 1790208, type 2)
out/host/linux-x86/bin/mkerofsimage.sh: line 79: 188014 Segmentation fault      (core dumped) $MAKE_EROFS_CMD
```
Quoted 3 lines

Have you met this kind of issue? I'm trying to debug the problem, looks like memory related.

BTW: i'm using latest erofs-utils in AOSP master branch (https://android.googlesource.com/platform/external/erofs-utils/).

Which lz4 version is used? it would be better to use lz4 1.9.3 (or 1.9.2 with some unexpected CR issues.)
For more details, please see README.

If the expected lz4 version is used, could you kindly leave gdb backtrace message here as well?

Thanks,
Gao Xiang

Quoted 3 lines

Thx.

author
#2 lore raw
Quoted 14 lines · On Tue, 1 Dec 2020 19:42:53 +0800 Gao Xiang <[email protected]> wrote:

Hi Yue,

Quoted 11 lines · Yue Hu

hi guys,

I'm trying using erofs for super.img(dynamic partition) under Android 10. But i have met an issue below when building images:

```log
EROFS: write_uncompressed_block() Line[140] Writing 3517 uncompressed data to block 63950
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc/xtwifi.conf (nid 8185600, type 1)
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc (nid 1790208, type 2)
out/host/linux-x86/bin/mkerofsimage.sh: line 79: 188014 Segmentation fault      (core dumped) $MAKE_EROFS_CMD
```
Quoted 6 lines
Quoted 3 lines

Have you met this kind of issue? I'm trying to debug the problem, looks like memory related.

BTW: i'm using latest erofs-utils in AOSP master branch (https://android.googlesource.com/platform/external/erofs-utils/).

Which lz4 version is used? it would be better to use lz4 1.9.3 (or 1.9.2 with some unexpected CR issues.)

Hi Xiang,

ok, let me check.

Quoted 4 lines

For more details, please see README.

If the expected lz4 version is used, could you kindly leave gdb backtrace message here as well?

Trying to get the bt for the case.

Thx.

Quoted 8 lines

Thanks,
Gao Xiang

Quoted 3 lines

Thx.

#3 lore raw
Quoted 19 lines · Yue Hu
Quoted 16 lines · On Tue, 1 Dec 2020 19:42:53 +0800 Gao Xiang <[email protected]> wrote:

Hi Yue,

Quoted 13 lines · Yue Hu

hi guys,

I'm trying using erofs for super.img(dynamic partition) under Android 10. But i have met an issue below when building images:

```log
EROFS: write_uncompressed_block() Line[140] Writing 3517 uncompressed data to block 63950
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc/xtwifi.conf (nid 8185600, type 1)
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc (nid 1790208, type 2)
out/host/linux-x86/bin/mkerofsimage.sh: line 79: 188014 Segmentation fault      (core dumped) $MAKE_EROFS_CMD
```

Have you met this kind of issue? I'm trying to debug the problem, looks like memory related.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

BTW: i'm using latest erofs-utils in AOSP master branch (https://android.googlesource.com/platform/external/erofs-utils/).

Which lz4 version is used? it would be better to use lz4 1.9.3 (or 1.9.2 with some unexpected CR issues.)

Hi Xiang,

ok, let me check.

At least, lz4 1.8.3 ~ 1.9.1 are buggy, for more details, see:
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/tree/README?h=dev#n107

Quoted 7 lines
Quoted 5 lines

For more details, please see README.

If the expected lz4 version is used, could you kindly leave gdb backtrace message here as well?

Trying to get the bt for the case.

Yeah, bt will fall into lz4 internal functions if the lz4 version is too low.

Thanks,
Gao Xiang

Quoted 12 lines

Thx.

Quoted 8 lines

Thanks,
Gao Xiang

Quoted 3 lines

Thx.

author
#4 lore raw
Quoted 25 lines · On Tue, 1 Dec 2020 19:51:58 +0800 Gao Xiang <[email protected]> wrote:
Quoted 24 lines · Yue Hu
Quoted 20 lines · On Tue, 1 Dec 2020 19:42:53 +0800 Gao Xiang <[email protected]> wrote:

Hi Yue,

Quoted 11 lines · Yue Hu

hi guys,

I'm trying using erofs for super.img(dynamic partition) under Android 10. But i have met an issue below when building images:

```log
EROFS: write_uncompressed_block() Line[140] Writing 3517 uncompressed data to block 63950
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc/xtwifi.conf (nid 8185600, type 1)
EROFS: erofs_mkfs_build_tree() Line[1011] add file /tmp/merge_target_files_jnIVhM/output/VENDOR/etc (nid 1790208, type 2)
out/host/linux-x86/bin/mkerofsimage.sh: line 79: 188014 Segmentation fault      (core dumped) $MAKE_EROFS_CMD
```
Quoted 3 lines

Have you met this kind of issue? I'm trying to debug the problem, looks like memory related.

BTW: i'm using latest erofs-utils in AOSP master branch (https://android.googlesource.com/platform/external/erofs-utils/).

Which lz4 version is used? it would be better to use lz4 1.9.3 (or 1.9.2 with some unexpected CR issues.)

Quoted 7 lines
Quoted 3 lines

Hi Xiang,

ok, let me check.

At least, lz4 1.8.3 ~ 1.9.1 are buggy, for more details, see:
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/tree/README?h=dev#n107

wow, working fine when i upgrade lz4 version from 1.8.3 to 1.9.3 bypass vndk error.

And seems canned fs config processing has minor issue. I will double check and submit patch if possible.

Thank you!

Quoted 27 lines
Quoted 7 lines
Quoted 5 lines

For more details, please see README.

If the expected lz4 version is used, could you kindly leave gdb backtrace message here as well?

Trying to get the bt for the case.

Yeah, bt will fall into lz4 internal functions if the lz4 version is too low.

Thanks,
Gao Xiang

Quoted 12 lines

Thx.

Quoted 8 lines

Thanks,
Gao Xiang

Quoted 3 lines

Thx.

#5 lore raw
Quoted 5 lines · Yue Hu
Quoted 2 lines · On Tue, 1 Dec 2020 19:51:58 +0800 Gao Xiang <[email protected]> wrote:
Quoted 2 lines

Gao Xiang <[email protected]> wrote:

...

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

Which lz4 version is used? it would be better to use lz4 1.9.3 (or 1.9.2 with some unexpected CR issues.)

Hi Xiang,

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

ok, let me check.

At least, lz4 1.8.3 ~ 1.9.1 are buggy, for more details, see:
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/tree/README?h=dev#n107

wow, working fine when i upgrade lz4 version from 1.8.3 to 1.9.3 bypass vndk error.

Thanks for the feedback, I'm now working on add unique testcases to intercept such broken lz4 versions as well, the WIP branch is
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/log/?h=experimental-test

Quoted 1 line

And seems canned fs config processing has minor issue. I will double check and submit patch if possible.

Comments, patches, evaluation are always welcome :) (btw, I'm about to release erofs-utils v1.2 this month...)

Thanks,
Gao Xiang

Quoted 4 lines

Thank you!

Quoted 1 line
Quoted 1 line