Thread (110 messages) 110 messages, 12 authors, 2021-08-27

Re: [PATCH 10/19] LoongArch: Add signal handling support

From: Xi Ruoyao <hidden>
Date: 2021-08-26 16:49:29

On Tue, 2021-07-06 at 12:18 +0800, Huacai Chen wrote:
+/**
+ * struct ucontext - user context structure
+ * @uc_flags:
+ * @uc_link:
+ * @uc_stack:
+ * @uc_mcontext:       holds basic processor state
+ * @uc_sigmask:
+ * @uc_extcontext:     holds extended processor state
+ */
+struct ucontext {
+       /* Historic fields matching asm-generic */
+       unsigned long           uc_flags;
+       struct ucontext         *uc_link;
+       stack_t                 uc_stack;
+       struct sigcontext       uc_mcontext;
+       sigset_t                uc_sigmask;
+
+       /* Extended context structures may follow ucontext */
+       unsigned long long      uc_extcontext[0];
+};
+
+#endif /* __LOONGARCH_UAPI_ASM_UCONTEXT_H */
Hi Huacai,

Maybe this is off topic, but I just seen something damn particular in
your workmates' glibc repo:

https://github.com/loongson/glibc/commit/86d7512949640642cdf767fb6beb077d446b2857
"Modify struct mcontext_t and ucontext_t layout":
quoted hunk ↗ jump to hunk
@@ -75,8 +73,8 @@ typedef struct ucontext_t
   unsigned long int __uc_flags;
   struct ucontext_t *uc_link;
   stack_t uc_stack;
-  mcontext_t uc_mcontext;
   sigset_t uc_sigmask;
+  mcontext_t uc_mcontext;
 } ucontext_t;
AFAIK if this doesn't match the struct ucontext definition above, the
system will just blow up?  Have you coordinated with the change?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help