Xcode 7 indicating heap buffer overflow in NSBitmapImageRep - bitmapData - xcode7

Just found an issue running my app through the new Address Sanitizer feature in Xcode 7 that I can't quite make any sense of:
I'm attempting to initialize a medium-sized (588x375) texture from an NSImage like this
NSImage *texture = [[NSBundle bundleForClass:self.class] imageForResource:#"ground_texture"];
NSBitmapImageRep *bitmap = (NSBitmapImageRep *)[texture bestRepresentationForDevice:#{
NSDeviceColorSpaceName: NSCalibratedRGBColorSpace,
NSDeviceBitsPerSample: #8,
NSDeviceIsScreen: #"YES"
}];
unsigned char* imageRepBitmapData = bitmap.bitmapData;
As soon as execution hits the last line of the code sample I'm getting an AsanDie complaining about a heap-buffer-overflow with this stack trace (running 10.11.1 beta):
==5070==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61300061f8f4 at pc 0x0001000d1c34 bp 0x7fff5fbfbcd0 sp 0x7fff5fbfb488
READ of size 384 at 0x61300061f8f4 thread T0
==5070==WARNING: Can't read from symbolizer at fd 14
#0 0x1000d1c33 in wrap_memmove (/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x39c33)
#1 0x7fff92e1c98c in -[_NSInlineData initWithBytes:length:] (/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation+0xc98c)
#2 0x7fff92e1c4f6 in -[_NSPlaceholderData initWithBytes:length:copy:deallocator:] (/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation+0xc4f6)
#3 0x7fff92e1c954 in -[NSData(NSData) initWithBytes:length:] (/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation+0xc954)
#4 0x7fff92e28800 in +[NSData(NSData) dataWithBytes:length:] (/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation+0x18800)
#5 0x7fff923733eb in -[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x2503eb)
#6 0x7fff925d0094 in __79-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke_2 (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x4ad094)
#7 0x7fff922c2093 in __75-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingCGImage:]_block_invoke (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x19f093)
#8 0x7fff922c16f8 in -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingCGImage:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x19e6f8)
#9 0x7fff921a0e96 in __79-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7de96)
#10 0x7fff921a0d9b in -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dd9b)
#11 0x7fff921a0d16 in __57-[NSBitmapImageRep _performBlockUsingBackingMutableData:]_block_invoke (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dd16)
#12 0x7fff921a0c8a in -[NSBitmapImageRep _performBlockUsingBackingMutableData:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dc8a)
#13 0x7fff921a0c17 in -[NSBitmapImageRep getBitmapDataPlanes:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dc17)
#14 0x7fff921a0b9e in -[NSBitmapImageRep bitmapData] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7db9e)
With this allocation strack trace:
0x6130005d59f4 is located 0 bytes to the right of 372-byte region [0x6130005d5880,0x6130005d59f4)
allocated by thread T0 here:
#0 0x1000dabb0 in wrap_malloc (/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib+0x42bb0)
#1 0x7fff92372c42 in -[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x24fc42)
#2 0x7fff925d0094 in __79-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke_2 (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x4ad094)
#3 0x7fff922c2093 in __75-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingCGImage:]_block_invoke (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x19f093)
#4 0x7fff922c16f8 in -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingCGImage:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x19e6f8)
#5 0x7fff921a0e96 in __79-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7de96)
#6 0x7fff921a0d9b in -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dd9b)
#7 0x7fff921a0d16 in __57-[NSBitmapImageRep _performBlockUsingBackingMutableData:]_block_invoke (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dd16)
#8 0x7fff921a0c8a in -[NSBitmapImageRep _performBlockUsingBackingMutableData:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dc8a)
#9 0x7fff921a0c17 in -[NSBitmapImageRep getBitmapDataPlanes:] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7dc17)
#10 0x7fff921a0b9e in -[NSBitmapImageRep bitmapData] (/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x7db9e)
#11 0x1026e788c in -[MyOpenGLRenderingThingie loadTexture:intoTexture:] (/Users/me/Library/Developer/Xcode/DerivedData/...)
So basically deep in the guts of AppKit.
Any ideas what the matter could be..?

Related

MediaWiki TemplateParser.php internal error

I have a local wiki (MediaWiki 1.38.4 ; Apache with xampp) that worked perfectly for a few weeks, but today started giving me errors with the TemplateParser.php and now is completely unnaccesible and shows the following error details:
MediaWiki internal error.
Original exception: [3d60e113338e8a53946d26be] /fangirlbook/index.php/P%C3%A1gina_principal TypeError: Cannot access offset of type string on string
Backtrace:
from C:\xampp\htdocs\fangirlbook\includes\TemplateParser.php(134)
#0 C:\xampp\htdocs\fangirlbook\includes\TemplateParser.php(289): TemplateParser->getTemplate(string)
#1 C:\xampp\htdocs\fangirlbook\includes\skins\SkinMustache.php(65): TemplateParser->processTemplate(string, array)
#2 C:\xampp\htdocs\fangirlbook\skins\Vector\includes\SkinVector.php(455): SkinMustache->generateHTML()
#3 C:\xampp\htdocs\fangirlbook\includes\skins\SkinTemplate.php(150): Vector\SkinVector->generateHTML()
#4 C:\xampp\htdocs\fangirlbook\includes\OutputPage.php(2807): SkinTemplate->outputPage()
#5 C:\xampp\htdocs\fangirlbook\includes\MediaWiki.php(926): OutputPage->output(boolean)
#6 C:\xampp\htdocs\fangirlbook\includes\MediaWiki.php(939): MediaWiki::{closure}()
#7 C:\xampp\htdocs\fangirlbook\includes\MediaWiki.php(563): MediaWiki->main()
#8 C:\xampp\htdocs\fangirlbook\index.php(53): MediaWiki->run()
#9 C:\xampp\htdocs\fangirlbook\index.php(46): wfIndexMain()
#10 {main}
Exception caught inside exception handler: [3d60e113338e8a53946d26be] /fangirlbook/index.php/P%C3%A1gina_principal TypeError: Cannot access offset of type string on string
Backtrace:
from C:\xampp\htdocs\fangirlbook\includes\TemplateParser.php(134)
#0 C:\xampp\htdocs\fangirlbook\includes\TemplateParser.php(289): TemplateParser->getTemplate(string)
#1 C:\xampp\htdocs\fangirlbook\includes\skins\SkinMustache.php(65): TemplateParser->processTemplate(string, array)
#2 C:\xampp\htdocs\fangirlbook\skins\Vector\includes\SkinVector.php(455): SkinMustache->generateHTML()
#3 C:\xampp\htdocs\fangirlbook\includes\skins\SkinTemplate.php(150): Vector\SkinVector->generateHTML()
#4 C:\xampp\htdocs\fangirlbook\includes\OutputPage.php(2807): SkinTemplate->outputPage()
#5 C:\xampp\htdocs\fangirlbook\includes\exception\MWExceptionRenderer.php(157): OutputPage->output()
#6 C:\xampp\htdocs\fangirlbook\includes\exception\MWExceptionRenderer.php(76): MWExceptionRenderer::reportHTML(TypeError)
#7 C:\xampp\htdocs\fangirlbook\includes\exception\MWExceptionHandler.php(107): MWExceptionRenderer::output(TypeError, integer)
#8 C:\xampp\htdocs\fangirlbook\includes\exception\MWExceptionHandler.php(202): MWExceptionHandler::report(TypeError)
#9 C:\xampp\htdocs\fangirlbook\includes\MediaWiki.php(585): MWExceptionHandler::handleException(TypeError, string)
#10 C:\xampp\htdocs\fangirlbook\index.php(53): MediaWiki->run()
#11 C:\xampp\htdocs\fangirlbook\index.php(46): wfIndexMain()
#12 {main}
I have already restarted the system, re-installed the wiki and copying the manual backup I had of the files and the database, and no solution. Any ideas?

C:\xampp\htdocs\blueberry-test\wp-includes\script-loader.php on line 2407

Fatal error: Uncaught Error: Call to undefined function get_current_screen() in C:\xampp\htdocs\blueberry-test\wp-includes\script-loader.php:2407 Stack trace: #0 C:\xampp\htdocs\blueberry-test\wp-includes\class-wp-hook.php(307): wp_global_styles_render_svg_filters('') #1 C:\xampp\htdocs\blueberry-test\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #2 C:\xampp\htdocs\blueberry-test\wp-includes\plugin.php(476): WP_Hook->do_action(Array) #3 C:\xampp\htdocs\blueberry-test\wp-includes\general-template.php(3074): do_action('wp_body_open') #4 C:\xampp\htdocs\blueberry-test\wp-content\themes\blueberrys\header-home.php(35): wp_body_open() #5 C:\xampp\htdocs\blueberry-test\wp-includes\template.php(770): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\blueberry-test\wp-includes\template.php(716): load_template('C:\xampp\htdocs...', true, Array) #7 C:\xampp\htdocs\blueberry-test\wp-includes\general-template.php(48): locate_template(Array, true, true, Array) #8 C:\xampp\htdocs\blueberry-test\wp-content\themes\blueberrys\inc\woocommerce\storefront-woocommerce-template-functions.php(9): get_header('home') #9 C:\xampp\htdocs\blueberry-test\wp-content\themes\blueberrys\functions.php(47): require('C:\xampp\htdocs...') #10 C:\xampp\htdocs\blueberry-test\wp-settings.php(566): include('C:\xampp\htdocs...') #11 C:\xampp\htdocs\blueberry-test\wp-config.php(96): require_once('C:\xampp\htdocs...') #12 C:\xampp\htdocs\blueberry-test\wp-load.php(50): require_once('C:\xampp\htdocs...') #13 C:\xampp\htdocs\blueberry-test\wp-admin\admin.php(34): require_once('C:\xampp\htdocs...') #14 C:\xampp\htdocs\blueberry-test\wp-admin\plugins.php(10): require_once('C:\xampp\htdocs...') #15 {main} thrown in C:\xampp\htdocs\blueberry-test\wp-includes\script-loader.php on line 2407
Please at the description and format your code to code.

Yii2 migration configException error

Suddenly any of the migration command is not working in my project and i don't know why. following is the errors in cmd.
C:\wamp64\www\project>yii migrate
Exception 'yii\base\InvalidConfigException' with message 'Failed to instantiate component or class "user".'
in C:\wamp64\www\project\vendor\yiisoft\yii2\di\Instance.php:139
Stack trace:
#0 C:\wamp64\www\project\vendor\yiisoft\yii2\filters\AccessControl.php(100): yii\di\Instance::ensure(Object(yii\di\Instance), 'yii\\web\\User')
#1 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Object.php(107): yii\filters\AccessControl->init()
#2 [internal function]: yii\base\Object->__construct(Array)
#3 C:\wamp64\www\project\vendor\yiisoft\yii2\di\Container.php(381): ReflectionClass->newInstanceArgs(Array)
#4 C:\wamp64\www\project\vendor\yiisoft\yii2\di\Container.php(156): yii\di\Container->build('yii\\filters\\Acc...', Array, Array)
#5 C:\wamp64\www\project\vendor\yiisoft\yii2\BaseYii.php(348): yii\di\Container->get('yii\\filters\\Acc...', Array, Array)
#6 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Component.php(183): yii\BaseYii::createObject(Array)
#7 C:\wamp64\www\project\vendor\yiisoft\yii2\BaseYii.php(529): yii\base\Component->__set('beforeRequest', Array)
#8 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Object.php(105): yii\BaseYii::configure(Object(yii\console\Application), Array)
#9 C:\wamp64\www\project\vendor\yiisoft\yii2\base\Application.php(205): yii\base\Object->__construct(Array)
#10 C:\wamp64\www\project\vendor\yiisoft\yii2\console\Application.php(89): yii\base\Application->__construct(Array)
#11 C:\wamp64\www\project\yii(26): yii\console\Application->__construct(Array)
#12 {main}
Please help me to solve it.

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away magento

I am using Magento ver. 1.9.1.0
The problem i am facing is whenever i am reindexing the data from magento admin it shows error like
There has been an error processing your request
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, query was: SELECT `core_flag`.* FROM `core_flag` WHERE (`core_flag`.`flag_code`='synchronize')
Trace:
#0 /home/ankitmidha02/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/ankitmidha02/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/ankitmidha02/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/ankitmidha02/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `core_fl...', Array)
#4 /home/ankitmidha02/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `core_fl...', Array)
#5 /home/ankitmidha02/public_html/lib/Zend/Db/Adapter/Abstract.php(756): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(380): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
#7 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Core_Model_Resource_Db_Abstract->load(Object(Mage_Core_Model_File_Storage_Flag), 'synchronize', 'flag_code')
#8 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Flag.php(119): Mage_Core_Model_Abstract->load('synchronize', 'flag_code')
#9 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/File/Storage.php(84): Mage_Core_Model_Flag->loadSelf()
#10 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/Observer.php(61): Mage_Core_Model_File_Storage->getSyncFlag()
#11 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Core_Model_Observer->addSynchronizeNotification(Object(Varien_Event_Observer))
#12 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Core_Model_Observer), 'addSynchronizeN...', Object(Varien_Event_Observer))
#13 /home/ankitmidha02/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#14 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(529): Mage::dispatchEvent('controller_acti...', Array)
#15 /home/ankitmidha02/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#16 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#17 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#18 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/ankitmidha02/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/ankitmidha02/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/ankitmidha02/public_html/index.php(87): Mage::run('', 'store')
#22 {main}
Due to this, site loads so slowly. What is the reason for this and how can I solve this?
I had this same problem, so I change this configuration to up of according to of my server capacity.
innodb_lock_wait_timeout
key_buffer
max_allowed_packet
thread_stack
thread_cache_size
innodb_buffer_pool_size

Error: [MissingConnectionException] Database connection "Mysql" is missing, or could not be created + cakephp 2.x

I got an error during placing order. Order placed half and after that i got error. I checked error.log file i found,
013-11-25 16:35:07 Error: [MissingConnectionException] Database connection "Mysql" is missing, or could not be created.
#0 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Model/Datasource/DboSource.php(261): Mysql->connect()
#1 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Model/ConnectionManager.php(101): DboSource->__construct(Array)
#2 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Model/Model.php(3164): ConnectionManager::getDataSource('default')
#3 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Model/Model.php(1096): Model->setDataSource('default')
#4 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Model/Model.php(3186): Model->setSource('baskets')
#5 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Model/Model.php(2637): Model->getDataSource()
#6 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/app/Model/Basket.php(24): Model->find('first', Array)
#7 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/app/Controller/AppController.php(53): Basket->getSessionDetails('c71b56ada66fd45...')
#8 [internal function]: AppController->beforeFilter(Object(CakeEvent))
#9 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Event/CakeEventManager.php(246): call_user_func(Array, Object(CakeEvent))
#10 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Controller/Controller.php(669): CakeEventManager->dispatch(Object(CakeEvent))
#11 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Routing/Dispatcher.php(183): Controller->startupProcess()
#12 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/lib/Cake/Routing/Dispatcher.php(161): Dispatcher->_invoke(Object(IndexController), Object(CakeRequest), Object(CakeResponse))
#13 /usr/local/pem/vhosts/262731/webspace/httpdocs/parceldirect.ie/app/webroot/index.php(92): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#14 {main}
Can anyone suggest me what is the issue with connection? Was server down during order process and got that error? Or any other issue?