Thread View: comp.sys.sgi.bugs
2 messages
2 total messages
Started by Tom Benoist
Wed, 06 Jan 1993 20:02
libimage iopen() bug
Author: Tom Benoist
Date: Wed, 06 Jan 1993 20:02
Date: Wed, 06 Jan 1993 20:02
26 lines
1240 bytes
1240 bytes
Some wont consider this a bug. I also understand that 4Dgifts is officially unsupported demoware. Anyway, the problem: /usr/people/4Dgifts/iristools/libimage/open.c If iopen() fails because its not sent a readable file in the proper format, it returns without: 1. Freeing up Memory it allocates using calloc 2. closing the file descriptor The result is that using this code in an app that queries the user for filenames, you run the good chance of eventually running over the Max Limit of 100 for open files. As we all know, after that point File IO basically stops working and your app becomes "quite impotent" Considering the assumed usage of the library for command line image apps and of course the other amazing gifts brought to us from Mr Haeberli, all is forgiven. Anyway, this one bit me, so I thought it should be mentioned. -Tom Benoist benoist@netcom.netcom.com
Re: libimage iopen() bug
Author: Dave Olson
Date: Wed, 06 Jan 1993 21:46
Date: Wed, 06 Jan 1993 21:46
41 lines
2057 bytes
2057 bytes
In <1993Jan6.200247.24300@netcom.com> benoist@netcom.com (Tom Benoist) writes:
| Some wont consider this a bug.
| I also understand that 4Dgifts is officially unsupported demoware.
Not really. That is the same source used to build libimage.a
| Anyway, the problem:
|
| /usr/people/4Dgifts/iristools/libimage/open.c
|
| If iopen() fails because its not sent a readable file
| in the proper format, it returns without:
| 1. Freeing up Memory it allocates using calloc
| 2. closing the file descriptor
That's because the original behavior was to exit on that
error. When I added the ability to trap the error and
call a user function and continue, I missed the free
(although I did catch and fix others...)
If the file isn't readable, the open fails, and there
*is* no file descriptor to close!
| The result is that using this code in an app that queries the
| user for filenames, you run the good chance of eventually
| running over the Max Limit of 100 for open files. As we all
| know, after that point File IO basically stops working and
| your app becomes "quite impotent"
Nope, something else is going on here. If you
meant a file that can be opened, but then the read of the
image header fails (or a write fails because the system
runs out of free space), you are right.
I'll file a bug on this, so it will be fixed for a future
release.
--
Let no one tell me that silence gives consent, | Dave Olson
because whoever is silent dissents. | Silicon Graphics, Inc.
Maria Isabel Barreno | olson@sgi.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads