This fixes the bootup crash. There were two initialization bugs:
- INIT_SIGNAL needs to set shared_pending.
- exec() needs to set up newsig properly.
the second one caused the crash Anton saw.
static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES;
-static struct signal_struct init_signals = INIT_SIGNALS;
+static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
struct mm_struct init_mm = INIT_MM(init_mm);
/*
spin_lock_init(&newsig->siglock);
atomic_set(&newsig->count, 1);
memcpy(newsig->action, current->sig->action, sizeof(newsig->action));
+ init_sigpending(&newsig->shared_pending);
+
spin_lock_irq(¤t->sigmask_lock);
current->sig = newsig;
spin_unlock_irq(¤t->sigmask_lock);
.mmlist = LIST_HEAD_INIT(name.mmlist), \
}
-#define INIT_SIGNALS { \
+#define INIT_SIGNALS(sig) { \
.count = ATOMIC_INIT(1), \
.action = { {{0,}}, }, \
- .siglock = SPIN_LOCK_UNLOCKED \
+ .siglock = SPIN_LOCK_UNLOCKED, \
+ .shared_pending = { NULL, &sig.shared_pending.head, {{0}}}, \
}
/*