rmkit-dev / rmkit

| remarkable app framework | https://rmkit.dev
https://build.rmkit.dev
365 stars 32 forks source link

harmony: segmentation fault in the “Load” dialog #136

Closed matteodelabre closed 2 years ago

matteodelabre commented 3 years ago

When opening the “Load” dialog in harmony, the app segfaults (if there is at least one image in the saved folder) in what seems to be the thumbnail-creating thread. Here’s the output from strace leading up to the crash.

22:08:52 openat(AT_FDCWD, "/home/root/harmony/saved_images", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC|O_DIRECTORY) = 10
22:08:52 fstat64(10, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
22:08:52 getdents64(10, /* 4 entries */, 32768) = 128
22:08:52 getdents64(10, /* 0 entries */, 32768) = 0
22:08:52 close(10)                      = 0
22:08:52 write(8, "WAKEUP\0", 7)        = 7
22:08:52 mmap2(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x751cb000
22:08:52 mprotect(0x751cc000, 8388608, PROT_READ|PROT_WRITE) = 0
22:08:52 clone(child_stack=0x759caf48, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[3048
], tls=0x759cb8d0, child_tidptr=0x759cb478) = 3048
strace: Process 3048 attached
[pid  3048] 22:08:52 set_robust_list(0x759cb480, 12) = 0
[pid  3048] 22:08:52 mmap2(NULL, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x74fcb000
[pid  3048] 22:08:52 munmap(0x74fcb000, 217088) = 0
[pid  3048] 22:08:52 munmap(0x75100000, 831488) = 0
[pid  3048] 22:08:52 mprotect(0x75000000, 135168, PROT_READ|PROT_WRITE) = 0
[pid  3048] 22:08:52 openat(AT_FDCWD, "/home/root/harmony/saved_images/2021-07-25-22:08:04.png", O_RDONLY) = 10
[pid  3048] 22:08:52 fstat64(10, {st_mode=S_IFREG|0644, st_size=86221, ...}) = 0
[pid  3048] 22:08:52 read(10,  <unfinished ...>
[pid  3045] 22:08:52 brk(0x35bc000)     = 0x35bc000
[pid  3048] 22:08:52 <... read resumed>"\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\5|"..., 4096) = 4096
[pid  3045] 22:08:52 brk(0x35af000 <unfinished ...>
[pid  3048] 22:08:52 read(10,  <unfinished ...>
[pid  3045] 22:08:52 <... brk resumed>) = 0x35af000
[pid  3045] 22:08:52 brk(0x3599000)     = 0x3599000
[pid  3048] 22:08:52 <... read resumed>"F\23\326h\10\214\206\300h\10\214\206\300h\10\214\206\300h\10"..., 81920) = 81920
[pid  3048] 22:08:52 read(10, "C`4\4FC\200&!0:\3500\232\260FC`4\4"..., 4096) = 205
[pid  3048] 22:08:52 read(10, "", 4096) = 0
[pid  3048] 22:08:52 mmap2(NULL, 7888896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7487a000
[pid  3045] 22:08:52 brk(0x35bc000)     = 0x35bc000
[pid  3045] 22:08:52 brk(0x35af000)     = 0x35af000
[pid  3045] 22:08:52 brk(0x3599000)     = 0x3599000
[pid  3045] 22:08:52 brk(0x35bf000)     = 0x35bf000
[pid  3045] 22:08:52 brk(0x35b2000)     = 0x35b2000
[pid  3045] 22:08:52 brk(0x3599000)     = 0x3599000
[pid  3045] 22:08:52 mmap2(NULL, 294912, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x75183000
[pid  3045] 22:08:52 munmap(0x75183000, 294912) = 0
[pid  3045] 22:08:52 msgsnd(0, {2, "\0\0\0\0\0\0\0\0{\5\0\0O\7\0\0\1\0\0\0"...}, 516, 0) = 0
[pid  3045] 22:08:52 _newselect(8, [3 5 6 7], NULL, NULL, NULL) = 1 (in [7])
[pid  3045] 22:08:52 read(7, "WAKEUP\0", 1024) = 7
[pid  3045] 22:08:52 _newselect(8, [3 5 6 7], NULL, NULL, NULL <unfinished ...>
[pid  3048] 22:08:52 mmap2(NULL, 7888896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x740f4000
[pid  3048] 22:08:52 munmap(0x7487a000, 7888896) = 0
[pid  3048] 22:08:52 mmap2(NULL, 2629632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x74d7e000
[pid  3048] 22:08:52 munmap(0x740f4000, 7888896) = 0
[pid  3048] 22:08:52 _llseek(10, 0, [86221], SEEK_CUR) = 0
[pid  3048] 22:08:52 close(10)          = 0
[pid  3048] 22:08:52 mprotect(0x75021000, 118784, PROT_READ|PROT_WRITE) = 0
[pid  3048] 22:08:52 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7503e000} ---
[pid  3048] 22:08:52 write(2, "CLEANING UP FB", 14CLEANING UP FB) = 14
[pid  3048] 22:08:52 write(2, "\n", 1
)  = 1
[pid  3048] 22:08:52 ioctl(6, EVIOCGRAB, 0) = -1 EINVAL (Invalid argument)
[pid  3048] 22:08:52 ioctl(5, EVIOCGRAB, 0) = -1 EINVAL (Invalid argument)
[pid  3048] 22:08:52 ioctl(3, EVIOCGRAB, 0) = -1 EINVAL (Invalid argument)
[pid  3048] 22:08:52 write(2, "received SIGABRT, ex"..., 25received SIGABRT, exiting) = 25
[pid  3048] 22:08:52 write(2, "\n", 1
)  = 1
[pid  3048] 22:08:52 close(6)           = 0
[pid  3048] 22:08:52 close(5)           = 0
[pid  3048] 22:08:52 close(3)           = 0
[pid  3048] 22:08:52 futex(0x4b8e1fc4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
[pid  3048] 22:08:52 exit_group(11)     = ?
[pid  3048] 22:08:52 +++ exited with 11 +++
22:08:52 <... _newselect resumed> <unfinished ...>) = ?
22:08:52 +++ exited with 11 +++
raisjn commented 2 years ago

this is fixed in 6c7e80ab7f4503dbe9b917e63fbf707eed948cc4. it was introduced by saving pngs in 3 channels at the beginning of the year. you have to removed the saved_images that were created incorrectly in order for this to work agian

matteodelabre commented 2 years ago

Can confirm this fixed it! Thanks!