develooper Front page | perl.perl5.porters | Postings from October 2001

DynaLoader crashes in MacMaintPerl

Thread Next
From:
Chris Nandor
Date:
October 29, 2001 07:44
Subject:
DynaLoader crashes in MacMaintPerl
Message ID:
p05100300b8032623194e@[10.0.1.177]
After Sarathy's recent changes to DynaLoader, I started having an entirely reproducible crash.  After loading something dynamically in the MacPerl app, MacPerl drops me into Macsbug when I try to Quit the app.

The reported error is:

    PowerPC unmapped memory exception at 0C562A58 Perl_sv_2uv+001BC

Any thoughts offhand?  If anyone needs more information, please just ask.  I unfortunately don't know the DynaLoader code well ...

Here's the diff of dl_mac.xs.  It's mostly just changing variable names.  It could be elsewhere, too ... dlutils.c?  *shrug*

Index: dl_mac.xs
===================================================================
RCS file: /cvsroot/macperl/perl/ext/DynaLoader/dl_mac.xs,v
retrieving revision 1.3
retrieving revision 1.4
diff -r1.3 -r1.4
25a26
> typedef CFragConnectionID ConnectionID;
27c28,30
< #include "dlutils.c"	/* SaveError() etc	*/
---
> typedef struct {
>     ConnectionID **	x_connections;
> } my_cxtx_t;		/* this *must* be named my_cxtx_t */
29c32,33
< typedef CFragConnectionID ConnectionID;
---
> #define DL_CXT_EXTRA	/* ask for dl_cxtx to be defined in dlutils.c */
> #include "dlutils.c"	/* SaveError() etc	*/
31c35
< static ConnectionID **	connections;
---
> #define dl_connections	(dl_cxtx.x_connections)
35,36c39,42
<     int size = GetHandleSize((Handle) connections) / sizeof(ConnectionID);
<     HLock((Handle) connections);
---
>     dTHX;
>     dMY_CXT;
>     int size = GetHandleSize((Handle) dl_connections) / sizeof(ConnectionID);
>     HLock((Handle) dl_connections);
38,40c44,46
<     	CloseConnection(*connections + --size);
<     DisposeHandle((Handle) connections);
<     connections = nil;
---
>     	CloseConnection(*dl_connections + --size);
>     DisposeHandle((Handle) dl_connections);
>     dl_connections = nil;
73,74c79,81
<     	if (!connections) {
< 	    connections = (ConnectionID **)NewHandle(0);
---
> 	dMY_CXT;
>     	if (!dl_connections) {
> 	    dl_connections = (ConnectionID **)NewHandle(0);
77c84
<         PtrAndHand((Ptr) &connID, (Handle) connections, sizeof(ConnectionID));
---
>         PtrAndHand((Ptr) &connID, (Handle) dl_connections, sizeof(ConnectionID));
133c140,141
<     RETVAL = LastError ;
---
>     dMY_CXT;
>     RETVAL = dl_last_error ;

-- 
Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About