Re: [AD] lsystem.c and the iopl call

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tue, Jun 13, 2000 at 05:10:42PM -0600, Craig Matsuura wrote:
> I have been using the real G2 SDK with allegro and linux.  I have found
> that on some RealAudio links (live links) it cause my applications to
> crash, with a SIGPIPE.

That sounds like the player is connecting, but the other side of
the connection gets dropped, causing you to receive a SIGPIPE
next time you write to your end of the connection.  I'm not sure
how Allegro could be influencing that though, or how your X
server could be dropping its connection in any way dependent
upon whether you're playing live data or not.

> So I decide to comment the line out with the iopl() call.  My
> application no longer crashes.  Is there a reason for setting the iopl
> to level 3?  Is it because of the 8514 X Server?

No, but we need the privileges for the same reasons -- we need
access to the IO ports.  We can ask for specific ranges, using
`ioperm', but that only works for fairly low port numbers (I
don't remember exactly how low).  Using `iopl', we get access to
all ports, even ones we don't actually need.  This could be what
is causing your problem -- maybe some of the other code you're
using is writing to ports it shouldn't be touching.  That seems
unlikely though, because it would generally cause much more
severe problems than a simple SIGPIPE.

Note that `iopl' only works at all if you have root privileges
at the time -- if your program wasn't run either by root or suid
root, then this call should just fail.  If you comment out the
line, it will cause various Linux console drivers to stop
working; the VGA driver needs these privileges, for instance.
It's possible that commenting out this line turned off some
Allegro drivers which would otherwise have interfered with the
other code in your program.

It might help if you try running your program, including the
`iopl' call, without root privileges -- does it crash in this
case?

I'm slightly confused by your references to the X server -- if
the code in `lsystem.c' is at all relevant to your program,
you're not using the X version of Allegro.  Perhaps you could
clarify exactly which version of Allegro is being used, and
whether the effects depend upon being run by root.

George

-- 
Random project update:
27/04/2000: AllegroGL alpha 7 released, fixing silly omission in alpha 6
        http://AllegroGL.sourceforge.net/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/