0

The problem is parent process in xv6 system doesn't enter the exit() function after waiting child to execute. I also made a change to exec() where I mapped the shared structures so that parent and child process points to same page directory (share memory). After that change I cannot close parent process properly.

I don't really know what to do, should I make changes inside wait or exit function ? I just want the program to finish normally. Console output enters the trap like when exit() doesn't exists.

if (argc == 1 && (strcmp(argv[0], "dalle") == 0)){
          
     int pid2 = fork();
     if (pid2 < 0) {
         printf("dalle: neuspesno kreiranje drugog child procesa\n");
         exit();
     }else if (pid2 == 0) {
         // pokrećemo liSa proces
         char *argv2[] = {"liSa", 0};
         exec("/bin/liSa", argv2);
         printf("dalle: neuspesno pokretanje liSa procesa\n");
         exit();
     }
     
     wait();
     
     printf("dalle: ovde sam\n"); // never prints
     exit(); // never enters
}
M. Yousfi
  • 578
  • 5
  • 24
xyz
  • 1
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 22 '23 at 23:33
  • Is your `liSa` program behave normally? – Mathieu May 23 '23 at 07:07

0 Answers0