Fix bug bin/47065: /bin/sh returns success for Bad file descriptor
The NetBSD Project
Status: Closed
Time to complete: 240 hrs
Mentors: Julian Coleman, Julian Fagir
The shell returns a wrong error code when it should return an error (on a bad file descriptor).
In this task, you will go through the whole work of fixing a bug: You have to analyze the situation, find the source of that bug in the code, and finally fix it.
In this task, you will also learn much about how a shell internally works. This will help you definetely if you want to do shell programming some day, or just want to dig more into the internals of file descriptors.
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=47065
Uploaded Work
| File name/URL | File size | Date submitted | |
|---|---|---|---|
| fixdiff.txt | 118 bytes | December 08 2012 10:31 UTC | |
| diff.diff | 21 bytes | December 08 2012 10:32 UTC |
As soon as my other task gets reviewed, I'm going to claim this one.
I would like to work on this task.
This task has been assigned to Puck Meerburg. You have 240 hours to complete this task, good luck!
Hey,
I've got some problems compiling the /bin/sh sources. I got them, but got gcc: printf.o: No such file or directory when compiling. Do you know what the problem is?
What exactly are you doing to build it? If sh depends on other files, you have to build these first. I think building a whole release would solve the issue. Maybe you need less, but this would be the safe way.
Anyway, you can come to #netbsd-code on freenode to ask us questions. This is more direct than Google Melange (but be careful - at some times there won't be anybody awake on this channel).
I fixed it by cvsing some other dependencies, but now *.netbsd.org is offline :(
Yep, there was a downtime yesterday. Anyway, things should be up and running now. You can always use one of the anoncvs servers, but probably didn't see them.
Hey,
I have some problems, mostly because the problem seems to ly in _exit, not sh:
I can't seem to find the logic in this, even turning on DEBUG=2 makes it work...
The work on this task is ready to be reviewed.
To make it work:
cvs checkout, then patch error.c with the included .diff!
I just checked the patch, and it works, though I don't know what exactly you did. Apparently, you set the return code when an exception occurs, but I didn't dig deep enough into the code to evaluate how this affects other code.
Could you please elaborate what did not work and what you did now (also to have a commit message)? Anyway, the task is done, so I will mark it as closed now.
Congratulations, this task has been completed successfully.
Ok, thank you, that is sufficient! Good luck with the next task (which is already assigned)!