Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Jun 2015 17:57:23 +0200
From: Sebastian Gottschall <>
Subject: stable 1.1.9 & current GIT broken on mips


i tested today the current 1.1.9 (and later also current git so see if 
its the same behaviour)
build on a mipsr2 big endian target (atheros ar7xxx) based on my dd-wrt 
i found out that mips seems to be broken on musl right now. the 
behaviour is
that a call using execvp will not result in calling the desired 
on a second call and a following return call, the userspace will lock up 
with no way todo anything anymore.

for testing i used the same compiler, just recompiled musl with version 
1.1.8 and overwrote the libc library and crt stuff. the result was, that 
it worked
again without any issue

it needs to be considered that parts of the code is compiled using 
-mips16 and -minterlink-mips16 if that matters

bellow you will find a copy of the c function which caused that problem. 
this function is placed in a library which is linked to the main init 
process. the function is called from this init process
its called in the following pseudo way

_evalpid(commandlinearray,">/dev/console", 0 , NULL);


int _evalpid(char *const argv[], char *path, int timeout, int *ppid)
     pid_t pid;
     int status;
     int fd;
     int flags;
     int sig;

     switch (pid = fork()) {
     case -1:        /* error */
         return errno;
     case 0:        /* child */
          * Reset signal handlers set for parent process
         for (sig = 0; sig < (_NSIG - 1); sig++)
             signal(sig, SIG_DFL);

          * Clean up
         ioctl(0, TIOCNOTTY, 0);

          * We want to check the board if exist UART? , add by honor
          * 2003-12-04
         if ((fd = open("/dev/console", O_RDWR)) < 0) {
             (void)open("/dev/null", O_RDONLY);
             (void)open("/dev/null", O_WRONLY);
             (void)open("/dev/null", O_WRONLY);
         } else {
             (void)open("/dev/console", O_RDONLY);
             (void)open("/dev/console", O_WRONLY);
             (void)open("/dev/console", O_WRONLY);

          * Redirect stdout to <path>
         if (path) {
             flags = O_WRONLY | O_CREAT;
             if (!strncmp(path, ">>", 2)) {
                  * append to <path>
                 flags |= O_APPEND;
                 path += 2;
             } else if (!strncmp(path, ">", 1)) {
                  * overwrite <path>
                 flags |= O_TRUNC;
                 path += 1;
             if ((fd = open(path, flags, 0644)) < 0)
             else {
                 dup2(fd, STDOUT_FILENO);

          * execute command

         setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin", 1);
         execvp(argv[0], argv);
     default:        /* parent */
         if (ppid) {
             *ppid = pid;
             return 0;
         } else {
             waitpid(pid, &status, 0);
             if (WIFEXITED(status))
                 return WEXITSTATUS(status);
                 return status;

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.