Hello, Le vendredi 06 d�cembre 2002 � 11:09:14, Michael Nidd a �crit: > The problem traces to winscard_clnt.c (SCardEstablishContextTH) > the section protected by "isExecuted" is getting executed every time. For > some reason, isExecuted (and mapAddr too) have zero values again the second > time it is called from the same invocation of xscreensaver. Because of this, > SYS_OpenFile is called again, but mapAddr is never closed.
winscard_clnt.c contains code called by the application using pcsc-lite. So the bug may not be in MusclePAM but in pcsc-lite. > My primary question is "Why is isExecuted getting zeroed?" Is it a shared > object "thing?" I also wondered if maybe it is being zeroed as part of some > security memory-blanking sweep, but can't find anywhere that might be doing > that. Since xscreensaver will call the PAM for each authentication the module will be restarted and the pcsc-lite library relinked with newly instantiated values (so isExecuted is set to 0 each time). > Secondarily, is there a reason mapAddr isn't being closed in > SCardReleaseContext? This might solve the whole problem. I think it is the correct thing to do. I will wait David's comment before patching. > (Actually, it doesn't. I've tried closing it and zeroing isExecuted > here. It didn't hurt anything, but didn't help the memory leak > either.) I don't see where the � memory leak � is. The SYS_OpenFile(PCSCLITE_PUBSHM_FILE, O_RDONLY, 0) in src/winscard_clnt.c does not _allocate_ memory. The memory allocation is done by src/eventhandler.c on the daemon side. Why do you call it a memory leak? I think it is more a file id leak. > One very last thing. In looking for this problem, I came accross one bounds > problem in winscard_clnt.c:SCardGetStatusChange. I don't have a diff right > now, but it's just changing this: > } else if (cReaders > PCSCLITE_MAX_CONTEXTS) > to this: > } else if (cReaders >= PCSCLITE_MAX_CONTEXTS) Corrected. Thanks! > I am probably working from an outdated source distribution. Is there a CVS > tree I should be syncing with? No CVS version but you can use my beta versions from [1]. The latest is pcsc-lite-1.1.2beta2. Regards, [1] http://ludovic.rousseau.free.fr/softwares/muscle/ -- Dr. Ludovic Rousseau [EMAIL PROTECTED] -- Normaliser Unix c'est comme pasteuriser le Camembert, L.R. -- _______________________________________________ Muscle mailing list [EMAIL PROTECTED] http://lists.musclecard.com/mailman/listinfo/muscle
