LemonStand Forum: Issue with Phpr_SecurityFramework and core:onUninitialize - LemonStand Forum

Jump to content

Severity 0 - None Assigned Status Fixed (and published)
Version - Fixed in -

Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

Report ID #176: Issue with Phpr_SecurityFramework and core:onUninitialize

#1 User is offline  
Phil 

  • Lemonholic
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 228
  • Joined: 13-January 10
  • LocationCumberland, BC, Canada

Posted 26 March 2012 - 08:10 PM

If you use core:onUninitialize and try to access some class which utilizes Phpr_SecurityFramework there's the potential for a race condition because destructors aren't called in any specific order. In this case, __destruct of the Phpr_SecurityFramework class is being called before my core:onUnitialize method. When Phpr_SecurityFramework::create() is called, it returns the reference to the instance, but Phpr_SecurityFramework->mode_descriptor no longer points to a valid mcrypt resource, resulting in a bunch of warnings being fired and data not being decrypted properly.

I believe the proper way to solve this would be to set self::$instance = null at the end of the destructor so if the class is needed again it will return a fresh class.


Page 1 of 1  
  • Cannot start a new Issue
  • You cannot reply to this issue

Replies (1 - 2)

#2 User is offline  
Phil 

  • Lemonholic
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 228
  • Joined: 13-January 10
  • LocationCumberland, BC, Canada

Posted 12 August 2012 - 01:19 PM

I'm bumping this because it's becoming an issue with more of my modules. Any thoughts on a fix?

#3 User is offline  
Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 4,066
  • Joined: 31-October 09

Posted 12 August 2012 - 04:46 PM

Updating status to: Fixed (and published)

Phil, we published the fix. The event is now triggered with PHP's register_shutdown_function() function.

Thank you


Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users