Re: [AD] [PATCH] Solaris Fixes and dev notes

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


On 6/5/05, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> 1) The System V procfs calls method that Allegro was using to get the
> executable name was segfaulting in the method _unix_get_executable_name.
> Specifically, for whatever reason psinfo.pr_argv is undefined on Solaris
10.
> The code assumes that is not and as a result segfaults. I have instead
> placed a properly #ifdef'd solution at the beginning of this routine that
is
> significantly less code, faster, and more reliable. I leave it as an
> exercise to someone more involved in this project to properly check
psinfo
> before trying to access data members as an array, etc.

The configure script should check the psinfo struct for compatibility and
not set ALLEGRO_HAVE_SV_PROCFS if it doesn't work. This is obviously
broken somehow.
Anyway,

A further note I forgot: the data member allegro was trying to access is definitely a valid part of the struct, it was just NULL in this particular case. Why, I can't say. Maybe under another set of circumstances the struct works just fine. However, I'm going to bet that getexecname() will be far more reliable and appears to have been in Solaris for a long time now (since 1997).

Additionally, there were a few data members accessed later that didn't exist for me, so your comment about making sure that the struct is identical to what you're expecting is definitely a valid concern, but again beyond my knowledge of how to do so. If you'd like I can post here what the struct looks like or is defined as on the list.

--
Shawn Walker, Software and Systems Analyst
binarycrusader@xxxxxxxxxx - http://binarycrusader.blogspot.com/

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