segmentation fault php7 symfony cli command using soap - soap

I am tring to upgrade to php7 and symfony3 from php5.6 and symfony2 resp. I have some symfony console commands which uses soap to request third party apis.
After upgrading to php7 and php7.0-soap, but command fails with segmentation fault. I tried debugging with gdb, below is the trace. Looks like this is the issue with php7.0-soap ? What is the solution ?
Program received signal SIGSEGV, Segmentation fault.
0x00005555557bc4db in zend_hash_destroy ()
(gdb) bt
#0 0x00005555557bc4db in zend_hash_destroy ()
#1 0x00007fffecbbe141 in delete_type_persistent () from /usr/lib/php/20151012/soap.so
#2 0x00005555557bc5dd in zend_hash_destroy ()
#3 0x00007fffecbc55f1 in ?? () from /usr/lib/php/20151012/soap.so
#4 0x00007fffecbc565f in ?? () from /usr/lib/php/20151012/soap.so
#5 0x00005555557bc4d2 in zend_hash_destroy ()
#6 0x00007fffecb95f0b in zm_shutdown_soap () from /usr/lib/php/20151012/soap.so
#7 0x00005555557b25f3 in module_destructor ()
#8 0x00005555557ab08c in ?? ()
#9 0x00005555557bd048 in zend_hash_graceful_reverse_destroy ()
#10 0x00005555557ac055 in zend_shutdown ()
#11 0x000055555574fb3b in php_module_shutdown ()
#12 0x000055555563d796 in main ()

you can't use WSDL_CACHE_MEMORY (or WSDL_CACHE_BOTH) in PHP7 for the time being: https://bugs.php.net/bug.php?id=71931
use WSDL_CACHE_DISK instead by setting soap.wsdl_cache in php.ini, or - if you don't have access to php.ini - using ini_set:
ini_set('soap.wsdl_cache', WSDL_CACHE_DISK);

Related

high-availability nodes for streaming data are disconnected

underversion 1.30.7 of dolphindb , the node is disconnected and can be manually activated after the high-availability flow data table is created, what is the reason for the unsuccessful creation of the table?
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./dolphindb -home /root/dolphindb/server/data/P3-NODE1 -logFile/root/dolphindb'.
Program terminated with signal 11 , Segmentation fault.
#0 0x00000000008da027 in RealtimeTable::getKeyColumnIndex(int) const () Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7.x86_64 libgcc-4.8.5-36.el7.x86_64 (gdb) bt
#0 0x00000000008da027 in RealtimeTable::getKeyC olumnIndex(int) const ()
#1 0x00000000007039b3 in RegisterLogEntry::setTable(SmartPointer<Table> const&) ()
#2 0x000000000070853b in StreamingHA::registerDataFile(std::string const&, SmartPointer< StreamingDataFile> const&, bool) ()
#3 0x0000000000711a9c in StreamingHAManagerImpl::registerStreamTable(int, std::string const&, SmartPointer<Table> const&) ()
#4 0x00000000007ae416 in OperatorImp::haStreamTableInternal(Heap*, std::vector< SmartPointer<Constant>, std::allocator<SmartPointer<Constant>> >&) ()
# 5 0x00000000007aedbf in OperatorImp :: haStreamTable(Heap*, std::vector<SmartPointer<Constant>, std::allocator<SmartPointer<Constant>> >&) ()
#6 0x00007fb64c31877e in SystemFunction::call(Heap*, std::vector<SmartPointer <Constant >, std::allocator<SmartPoin ter<Constant>> >&)() from ./libDolphinDB.so
#7 0x00000000006d9a96 in SessionImp::run(SmartPointer<FunctionDef> const&, std::vector<SmartPointer<Constant> , std ::allocator<SmartPointer<Constant>> >&) ()
#8 0x00000000006deeb8 in SessionImp::run(std:: string const&, std::vector<SmartPointer<Constant>, std::allocator<SmartPointer<Constant> >> &) ()
#9 0x00000000005e5415 in APISocketConsole::execute() ()
#10 0x00000000005e1491 in SocketConsole::run() ()
#11 0x000000000062989e in Worker::run() ()
#12 0x00 007fb64be6b6dc in Runnable:: start() () from ./libDolphinDB.so
#13 0x00007fb64be6c8a0 in Thread::startFunc(void*) () from ./libDolphinDB.so
#14 0x00007fb64b1f5dd5 in start_thread () from /lib64/libpthread.so.0
#15 0x00007e ina2 () fro m /lib64/libc.so.6 
In the latest release of DolphinDB (V1.30.18/V2.00.6), the mentioned issues have been fixed. Upgrade your server and have a try.
The following script creates a high-availability stream table “haDevSt“ in the raft group “2“ where cacheLimit is 100000 and keyColumn is “id“.
t1=table(1:0,
["id","source_address","source_port","destination_address","destination_port"],
[STRING,INT,INT,INT,INT] ) haStreamTable(2,t1,"haDevSt",100000,"id")
To drop a high-availability stream table, call dropStreamTable(tableName).
For more information, please check the https://dolphindb.com/help/index.html

How to log SQL query in Zend on Zend_Db_Statement_Exception

When an application error occures on my site and it is connected with malformed SQL query, I'd like to know the query to solve the problem. But it's not easy, when such an error occurs, information is given like this:
An error occurred
Application error
Exception information:
Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column
'p.name' in 'where clause'
Stack trace:
#0 /var/www/ksiegarnia/library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/ksiegarnia/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/ksiegarnia/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Table_Select), Array)
#3 /var/www/ksiegarnia/library/Zend/Db/Select.php(686): Zend_Db_Adapter_Pdo_Abstract->query(Object(Zend_Db_Table_Select))
#4 /var/www/ksiegarnia/library/Zend/Paginator/Adapter/DbSelect.php(142): Zend_Db_Select->query(2)
#5 /var/www/ksiegarnia/library/Zend/Paginator/Adapter/DbSelect.php(183): Zend_Paginator_Adapter_DbSelect->setRowCount(Object(Zend_Db_Table_Select))
#6 [internal function]: Zend_Paginator_Adapter_DbSelect->count()
#7 /var/www/ksiegarnia/library/Zend/Paginator.php(540): count(Object(Zend_Paginator_Adapter_DbTableSelect))
#8 /var/www/ksiegarnia/library/Zend/Paginator.php(1081): Zend_Paginator->getTotalItemCount()
#9 /var/www/ksiegarnia/library/Zend/Paginator.php(753): Zend_Paginator->_calculatePageCount()
#10 /var/www/ksiegarnia/application/modules/default/controllers/IndexController.php(702): Zend_Paginator->setItemCountPerPage(10)
#11 /var/www/ksiegarnia/library/Zend/Controller/Action.php(516): IndexController->searchadvancedAction()
#12 /var/www/ksiegarnia/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('searchadvancedA...')
#13 /var/www/ksiegarnia/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#14 /var/www/ksiegarnia/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#15 /var/www/ksiegarnia/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#16 /var/www/ksiegarnia/public_html/index.php(32): Zend_Application->run()
#17 {main}
How to log an SQL query that caused the error?
I've found a quite complicated, but useful solution, which is adding the following code to ErrorController.php:
when the exception is of class Zend_Db_Statement_Exception, go to a specific line of trace, get the Zend_Db_Select argument that was used there and get parts of SQL clause (where, from, order, group etc.) from it and log them into a log file. Nasty, isn't it? ;) But works :)
Here is the code to be inserted into ErrorController.php
$thread_id = exec('echo $$');
if (get_class($errors->exception) == 'Zend_Db_Statement_Exception') {
$trace = $errors->exception->getTrace();
foreach(array('columns', 'from', 'where', 'order', 'group', 'limitcount', 'limitoffset', 'union') as $queryPartName) {
$parts = $trace[2]['args'][0]->getPart($queryPartName);
if ((is_array($parts) && !empty($parts)) ||
(!is_array($parts) && trim($parts) !== '')) {
$log->log($thread_id. "\t".strtoupper($queryPartName) .': ', $priority);
if (is_array($parts)) {
foreach($parts as $part)
$log->log($thread_id. "\t"."\t". (is_array($part) ? 'Array: '. implode(', ', $part) : $part), $priority);
} else
$log->log($thread_id. "\t"."\t". $parts, $priority);
}
}
}

mongod crash(terminated with signal 5)

I configured a mongodb's capped collection,with capacity more than 3G,after that mongod crash for many times,but there was nothing wrong in the mongd.log.Howerver linux abrt has core dumped for mongod,messages from coredump are as following:
Program terminated with signal 5, Trace/breakpoint trap. #0 0x00000000010b9951 in v8::internal::OS::DebugBreak() () Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.107.el6.x86_64 libgcc-4.4.7-3.el6.x86_64 libstdc++-4.4.6-4.el6.x86_64 (gdb) where #0 0x00000000010b9951 in v8::internal::OS::DebugBreak() () #1 0x00000000010ba06a in
v8::internal::OS::Abort() () #2 0x0000000000f1c5f3 in API_Fatal(char const*, char const*, ...) () #3 0x0000000000ece607 in ?? () #4 0x0000000000ece916 in
v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) () #5 0x000000000108c891 in v8::internal::Map::UpdateCodeCache(v8::internal::Handle<v8::internal::Map>,
v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::Code>) () #6 0x0000000001149180 in
v8::internal::StubCache::ComputeKeyedLoadOrStoreElement(v8::internal::Handle<v8::internal::Map>, v8::internal::KeyedIC::StubKind, v8::internal::StrictModeFlag) () #7
0x0000000001000bfc in v8::internal::KeyedIC::ComputeMonomorphicStub(v8::internal::Handle<v8::internal::Map>,
v8::internal::KeyedIC::StubKind, v8::internal::StrictModeFlag, v8::internal::Handle<v8::internal::Code>) () #8 0x000000000100779a in
v8::internal::KeyedIC::ComputeStub(v8::internal::Handle<v8::internal::JSObject>, v8::internal::KeyedIC::StubKind, v8::internal::StrictModeFlag,
v8::internal::Handle<v8::internal::Code>) () #9 0x0000000001008551 in v8::internal::KeyedLoadIC::Load(v8::internal::InlineCacheState,
v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, bool) () #10 0x000000000100894d in v8::internal::KeyedLoadIC_Miss(v8::internal::Arguments,
v8::internal::Isolate*) ()
my mongodb is 2.4.1, running in centos 6.3,16G memory and 8cpus.
Anyone can help me? Thanks very much.
The out of memory error mentioned makes me suspect that this could be an occurrence of this bug (V8 memory leaking):
https://jira.mongodb.org/browse/SERVER-9230
Can you upgrade to 2.4.2+ and see if the error still happens for you?

How do I create application tests in a Cocoa Touch Unit Testing Bundle with Xcode 4?

I've created an Xcode 4 project with a Cocoa Touch Unit Testing Bundle. I'm able to create and run logic tests successfully. However, I'm not sure how to create a test as an application test that runs on an iOS device and uses UIKit. When I create a test that uses UIKit and try to run the tests in the bundle on the device, Xcode 4 pops up a dialog saying:
Logic Testing Unavailable
Logic Testing on iOS devices is not supported. You can run logic tests on the Simulator.
I tried running the test on the simulator, but of course it failed when making UIKit calls.
Does anyone know how to create and run application tests on iOS devices using Xcode 4 and a Cocoa Touch Unit Testing Bundle?
EDIT: In case it helps, here is the test code:
#implementation TinyWordsTests
- (void)setUp
{
[super setUp];
CC_DIRECTOR_INIT();
}
- (void)tearDown
{
CC_DIRECTOR_END();
[super tearDown];
}
- (void)testExample
{
CCScene *scene = [TWOHelloWorldLayer scene];
STAssertNotNil(scene, #"Scene must not be nil.");
}
#end
and the resulting stack trace from gdb when the test is run in the simulator:
(gdb) bt
#0 0x00464781 in __HALT ()
#1 0x003af8ed in _CFRuntimeCreateInstance ()
#2 0x00da81ea in GSFontCreateWithName ()
#3 0x038f55eb in UINewFont ()
#4 0x038f56bd in +[UIFont fontWithName:size:traits:] ()
#5 0x038f507d in +[UIFont fontWithName:size:] ()
#6 0x01a49205 in -[CCTexture2D(Text) initWithString:fontName:fontSize:] (self=0x197f9f0, _cmd=0xe10840, string=0x1a9c900, name=0x1a9c8f0, size=64) at CCTexture2D.m:487
#7 0x01a2d897 in -[CCLabelTTF setString:] (self=0x1981d70, _cmd=0x156e07, str=0x1a9c900) at CCLabelTTF.m:95
#8 0x01a2dc9d in -[CCLabelTTF initWithString:fontName:fontSize:] (self=0x1981d70, _cmd=0xe10840, str=0x1a9c900, name=0x1a9c8f0, size=64) at CCLabelTTF.m:79
#9 0x01a2da9a in +[CCLabelTTF labelWithString:fontName:fontSize:] (self=0x1a9b53c, _cmd=0xe0ddc0, string=0x1a9c900, name=0x1a9c8f0, size=64) at CCLabelTTF.m:53
#10 0x01a01b10 in -[TWOHelloWorldLayer init] (self=0x197ee40, _cmd=0x2c7c) at TWOHelloWorldLayer.m:39
#11 0x01a341bb in +[CCNode node] (self=0x1a99ee4, _cmd=0x3baad59) at CCNode.m:231
#12 0x01a01a80 in +[TWOHelloWorldLayer scene] (self=0x1a99ee4, _cmd=0xe00fa0) at TWOHelloWorldLayer.m:22
#13 0x01a5d430 in -[TinyWordsTests testExample] (self=0x197e490, _cmd=0xe59dd0) at TinyWordsTests.m:30
#14 0x00410c7d in __invoking___ ()
#15 0x00410b51 in -[NSInvocation invoke] ()
#16 0x201043d2 in -[SenTestCase invokeTest] ()
#17 0x20104aa7 in -[SenTestCase performTest:] ()
#18 0x201041d3 in -[SenTest run] ()
#19 0x20106eda in -[SenTestSuite performTest:] ()
#20 0x201041d3 in -[SenTest run] ()
#21 0x20106eda in -[SenTestSuite performTest:] ()
#22 0x201041d3 in -[SenTest run] ()
#23 0x201067a4 in +[SenTestProbe runTests:] ()
#24 0x000023c7 in ?? ()
#25 0x000025f2 in ?? ()
#26 0x0000209a in ?? ()
#27 0x00002049 in ?? ()
To allow this to work correctly, you need to go to your testing bundle's build settings and set the Test Host key to $(BUNDLE_LOADER).
In addition, make sure that Bundle Loader key is set to to $(BUILT_PRODUCTS_DIR)/yourAppName.app/yourAppName in the bundle's build settings as well.
Unfortunately, testing on iOS is a hodgepodge with the official tools. There are two types of unit tests. Logic Tests which have no UI invocations and runs in the Simulator. Application Tests which can exercise and manipulate the UI but only runs on the device.
It sounds like you have written Logic Tests that exercise the UI. What you want is to create Application Tests and run that on the device. To do this you have to follow http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/135-Unit_Testing_Applications/unit_testing_applications.html and create an independent Application Target to run on the device that includes the AppTest target.
But, just an aside is this gets quite tedious as you have to add all code under test and dependencies into each target and application target. You also have to only place logic tests in the logic test target and application tests in the application test target.

MKMapView crashing with EXC_BAD_ACCESS

I have the following line of code which activates the breakpoint
[mapView addAnnotations:grabinstance.itemArray];
This crashing randomly. grabinstance.itemArray is fully populated always and is never changing at the time due to this bit of code only being called once the array is full. This particular time this was confirmed as 323 items in the array.
NSZombieEnabled doesn't find anything at all either.
The backtrace is below and line 1154 is the line above.
#0 0x0126a372 in _insert ()
#1 0x0126a312 in _splitNode ()
#2 0x0126a3b7 in _insert ()
#3 0x011db253 in -[MKAnnotationContainerView addAnnotation:] ()
#4 0x011dfc2e in -[MKAnnotationContainerView addAnnotations:] ()
#5 0x011b0b30 in -[MKMapView addAnnotations:] ()
#6 0x00009257 in -[BigViewController plotItems] (self=0x614de90, _cmd=0x16464f) at /Users/zzzz/Documents/iPhone Projects/BigProject/Classes/BigViewController.m:1154
#7 0x005336c1 in _nsnote_callback ()
#8 0x01c18f99 in __CFXNotificationPost_old ()
#9 0x01b9833a in _CFXNotificationPostNotification ()
#10 0x00529266 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#11 0x00024071 in -[ItemGrabber parserDidEndDocument:] (self=0x617b540, _cmd=0x689aa3, parser=0xf6b4ab0) at /Users/zzzz/Documents/iPhone Projects/BigProject/Classes/ItemGrabber.m:267
You should check your annotations using CLLocationCoordinate2DIsValid():
if (CLLocationCoordinate2DIsValid(place.coordinate)) {
[_mapView addAnnotation:place];
} else {
NSLog(#"place %# has invalid coordinates", place.name);
}
Bug reported to Apple and as been acknowledged
I also had the same problem and i fixed it,The problem was with my locations,The objects in the array may not contain valid locations,They may be garbage values