🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sgi.bugs
Article #61

Re: libimage iopen() bug

#61
From: Dave Olson
Date: Wed, 06 Jan 1993 21:46
41 lines
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
Technical Details
Message-ID: <ui373rk@zuni.esd.sgi.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!olivea!sgigate!odin!twilight!zuni!anchor!olson
References: <1993Jan6.200247.24300@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!olivea!sgigate!odin!twilight!zuni!anchor!olson
From: olson@anchor.esd.sgi.com (Dave Olson)
Newsgroups: comp.sys.sgi.bugs
Subject: Re: libimage iopen() bug
Message-ID: <ui373rk@zuni.esd.sgi.com>
Date: 6 Jan 93 21:46:46 GMT
References: <1993Jan6.200247.24300@netcom.com>
Sender: news@zuni.esd.sgi.com (Net News)
Organization: Silicon Graphics, Inc.  Mountain View, CA
Lines: 41