-#9 0xf7abf899 in __asan::__asan_report_load2 (addr=4072681776) at ../../../../../src/libsanitizer/asan/asan_rtl.cc:117
-#10 0x5693f718 in inode_release (node=0xf2c03124) at inode/fs_inoderelease.c:69
-#11 0x568ea61b in file_close (filep=0xf55fedd0) at vfs/fs_close.c:79
-#12 0x568e7e56 in nx_close (fd=3) at inode/fs_files.c:528
-#13 0x568e7f0e in close (fd=3) at inode/fs_files.c:562
-#14 0x56e76c39 in epoll_close (epfd=3) at vfs/fs_epoll.c:252
-#15 0x56c33829 in sensor_service_delete (ctrl=0x578b8540 <control>) at src/common.c:439
-#16 0x56a0561e in sensor_middle_service_main (argc=1, argv=0xf55de820) at sensor_main.c:118
-#17 0x56878675 in nxtask_startup (entrypt=0x56a054cc <sensor_middle_service_main>, argc=1, argv=0xf55de820) at sched/task_startup.c:70
-#18 0x5684427a in nxtask_start () at task/task_start.c:133
-#19 0xdeadbeef in ?? ()
reason:
epoll_close -> close -> epoll_do_close (free inode)
-> inode_release (reuse inode, crash)
fix:
use the global inode to match the fd which will return to user.
like the g_sock_inode in fs/socket/socket.c
Signed-off-by: ligd <liguiding1@xiaomi.com>
Fix this compile-time warning:
rpmsg/rpmsg_sockif.c:381:24: warning: format '%d' expects argument of type 'int', but argument 3 has type 'ssize_t' {aka 'long int'} [-Wformat=]
381 | nerr("circbuf_write overflow, %d, %d\n", written, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
| |
| ssize_t {aka long int}
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
Fix this compile-time warning:
rptun/rptun.c:956:22: warning: '%lx' directive output may be truncated writing between 1 and 16 bytes into a region of size 14 [-Wformat-truncation=]
956 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv);
| ^~~~~
rptun/rptun.c:956:25: note: format string is defined here
956 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv);
rptun/rptun.c:956:22: note: directive argument in the range [1, 18446744073709551615]
956 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv);
| ^~~~~
rptun/rptun.c:956:3: note: 'snprintf' output between 4 and 19 bytes into a destination of size 16
956 | snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
since xcpt always point to the stack after the below change:
commit 7b9978883c
Author: chao.an <anchao@xiaomi.com>
Date: Tue Mar 1 01:06:24 2022 +0800
arch/arm: optimize context switch speed
The current context save implementation saves registers of each task
to xcp context, which is unnecessary because most of the arm registers are
already saved in the task stack, this commit replace the xcp context with
stack context to improve context switching performance and reduce the tcb
space occupation of tcb instance.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
The jump instruction relocation had an assert that tests for jumps with
an offset of 0. This makes it so that a while(1); statement causes an
assert because the jump instruction points to the same address, which
is perfectly legal.
Addend was not handled correctly in several reloc types.
Add ADD32/64 + SUB32/64 relocations, for some reason the compiler
I use likes to add them.
follow up the bellow chnage:
commit 0f2f48f8ba
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Sun Mar 20 18:12:26 2022 +0800
sys/type.h: Change pid_t from int16_t to int
to fix the following warning:
include/unistd.h:302:9: error: incompatible redeclaration of library function 'vfork' [-Werror,-Wincompatible-library-redeclaration]
pid_t vfork(void);
^
include/unistd.h:302:9: note: 'vfork' is a builtin with type 'int (void)'
and change 32768 to INT_MAX to match the type change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>