Subject: RE: DynaLoader in Perl 5.005_01 on cygwin32
From: [email-masked] (Peter Mularski)

5 Aug 1998 17:23:18 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: "GNU-Win32 (E-mail)" <[email-masked]>

> >After a bit of tweaking, I successfully built Perl 5.005_01
> in the cygwin
> >environment. However, I have a problem that the DynaLoader
> doesn't seem to
>
> Could you document the changes, and make them available, and also
> send them back to the perl folks, for inclusion?
>
> thanks
> D

Actually, I was going to wait until I figured out this DynaLoader problem
first, before letting everyone know. Since the DynaLoader is statically
linked into the perl executable (which takes an extremely long time to
build), I figured I'd like to wait and solve that problem first. If people
still want to know how to make a partially disabled version without the
DynaLoader, I can post instructions...

I also have some more information on the DynaLoader error. The error that
perl is returning is error 998 from the dl_load_file sub. Error 998,
according to the Microsoft SDK, is ERROR_NOACCESS, or "Invalid access to
memory location". Now, my question is, what is wrong with the dl_load_file
sub that comes with the distribution? Here is the code for it (from the
distribution file ext/DynaLoader/dl_cygwin32.xs):

---- START CODE ---

void *
dl_load_file(filename,flags=0)
    char *		filename
    int			flags
    PREINIT:
    CODE:
    DLDEBUG(1,fprintf(stderr,"dl_load_file(%s):\n", filename));

    RETVAL = (void*) LoadLibraryExA(filename, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH ) ;

    DLDEBUG(2,fprintf(stderr," libref=%x\n", RETVAL));
    ST(0) = sv_newmortal() ;
    if (RETVAL == NULL){
	SaveError("%d",GetLastError()) ;
    }
    else{
	// setup the dll's impure_ptr:
	impure_setupptr = GetProcAddress(RETVAL, "impure_setup");
	if( impure_setupptr == NULL){
		printf(
    "Cygwin32 dynaloader error: could not load impure_setup symbol\n");
		RETVAL = NULL;
	}
	else{
		// setup the DLLs impure_ptr:
		(*impure_setupptr)(_impure_ptr);
		sv_setiv( ST(0), (IV)RETVAL);
	}
   }

--- END CODE ---

This file (dl_cygwin32.xs) is dated 3/26/97, presumably before the B19 stuff
happened. My question is, did something change within the cygwin code that
would invalidate this procedure? If anyone needs any other code, let me
know. As I said, I would rather wait until the whole issue is resolved
before posting a patch or something, but if people really want it, I can
post instructions now. I think to solve this problem with the DynaLoader
requires someone with more knowledge of the cygwin internals than I have...
Thanks in advance...

Peter Mularski
CLARiiON

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".