Bug #71844 [NEW]: Segfault with Symfony3
From: guillaume dot bretou at sidexa dot fr
Operating system: CentOS 7
PHP version: 7.0.4
Package: PDO DBlib
Bug Type: Bug
Bug description:Segfault with Symfony3
Description:
------------
Hello,
I have got a problem running PHP7 with SF3/SQL Server 2008
Env :
- OS : CentOS7
- PHP : PHP 7.0.4
List of modules :
[vagrant@localhost api]$ php -m
[PHP Modules]
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
intl
json
libxml
mbstring
mcrypt
mysql
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
Steps to reproduce :
- configure FreeTDS :
[dev_fr]
host = HOST
port = 1433
tds version = 8.0
once the SF3 application is generated, I created the following entity:
==============
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Company
*
* @ORM\Table(name="company")
*
@ORM\Entity(repositoryClass="AppBundle\Repository\CompanyRepository")
*/
class Company
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity="Customer", mappedBy="company")
*/
private $customers;
/**
* Company constructor.
*/
public function __construct()
{
$this->customers = new ArrayCollection();
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*
* @return Company
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
}
======================================
- configure parameters and config:
doctrine:
dbal:
driver_class: Realestate\MssqlBundle\Driver\PDODblib\Driver
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
- checked that connection was OK with simple Select statement
- Then I tried creating some entity with DoctrineFixturesBundle:
/**
* Created by PhpStorm.
* User: gbu
* Date: 16/03/2016
* Time: 15:57
*/
namespace AppBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use AppBundle\Entity\Company;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class LoadCompanyData implements FixtureInterface,
ContainerAwareInterface
{
/**
* @var array
*/
protected $data = [
[
'name' => 'TESTED'
],
];
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param ObjectManager $manager
*/
public function load(ObjectManager $manager)
{
$em = $this->container->get('doctrine')->getManager();
foreach ($this->data as $companyData) {
$company = new Company();
$company->setName($companyData['name']);
$em->persist($company);
$em->flush();
}
}
}
- Output of the command :
[vagrant@localhost api]$ php bin/console doctrine:fixtures:load
Careful, database will be purged. Do you want to continue y/N ?y
> purging database
> loading AppBundle\DataFixtures\ORM\LoadCompanyData
Segmentation fault
- I tried to run this xdebug to gather some more information:
php -d xdebug.auto_trace=ON -d xdebug.collect_params=4 -d
xdebug.trace_output_dir=/tmp bin/console doctrine:fixtures:load
Here are the last lines in the trace file :
5.2060 11850064 ->
Symfony\Component\Debug\ErrorHandler::stackErrors()
/var/www/html/src/api/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:118
5.2060 11850064 ->
error_reporting()
/var/www/html/src/api/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:619
5.2060 11850064 ->
error_reporting(32767)
/var/www/html/src/api/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:619
5.2060 11850064 ->
Composer\Autoload\ClassLoader->findFile($class =
'Doctrine\\ORM\\Event\\LifecycleEventArgs')
/var/www/html/src/api/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:122
5.2060 11850064 ->
Composer\Autoload\ClassLoader->findFileWithExtension($class =
'Doctrine\\ORM\\Event\\LifecycleEventArgs', $ext = '.php')
/var/www/html/src/api/vendor/composer/ClassLoader.php:329
5.2060 11850064 ->
strtr('Doctrine\\ORM\\Event\\LifecycleEventArgs', '\\', '/')
/var/www/html/src/api/vendor/composer/ClassLoader.php:347
5.2060 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs',
'Doctrine\\Instantiator\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2060 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs',
'Doctrine\\DBAL\\Migrations\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2060 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs',
'Doctrine\\Common\\Cache\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2060 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs', 'Doctrine\\Common\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2060 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs',
'Doctrine\\Bundle\\MigrationsBundle\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2061 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs',
'Doctrine\\Bundle\\FixturesBundle\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2061 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs',
'Doctrine\\Bundle\\DoctrineCacheBundle\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2061 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs',
'Doctrine\\Bundle\\DoctrineBundle\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2061 11850176 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs', 'DeepCopy\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:352
5.2061 11850272 ->
file_exists('/var/www/html/src/api/src/Doctrine/ORM/Event/LifecycleEventArgs.php')
/var/www/html/src/api/vendor/composer/ClassLoader.php:364
5.2064 11850272 ->
strrpos('Doctrine\\ORM\\Event\\LifecycleEventArgs', '\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:370
5.2064 11850272 ->
substr('Doctrine/ORM/Event/LifecycleEventArgs.php', 0, 19)
/var/www/html/src/api/vendor/composer/ClassLoader.php:372
5.2064 11850320 ->
substr('Doctrine/ORM/Event/LifecycleEventArgs.php', 19)
/var/www/html/src/api/vendor/composer/ClassLoader.php:373
5.2064 11850368 ->
strtr('LifecycleEventArgs.php', '_', '/')
/var/www/html/src/api/vendor/composer/ClassLoader.php:373
5.2064 11850352 ->
strpos('Doctrine\\ORM\\Event\\LifecycleEventArgs', 'Doctrine\\ORM\\')
/var/www/html/src/api/vendor/composer/ClassLoader.php:381
5.2064 11850368 ->
file_exists('/var/www/html/src/api/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LifecycleEventArgs.php')
/var/www/html/src/api/vendor/composer/ClassLoader.php:383
Please, feel free to ask further information,
Thank you,
--
Edit bug report at https://bugs.php.net/bug.php?id=71844&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71844&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71844&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71844&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71844&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71844&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71844&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71844&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71844&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71844&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71844&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71844&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71844&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71844&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71844&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71844&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71844&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71844&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71844&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71844&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71844&r=mysqlcfg
Thread (6 messages)
- guillaume dot bretou at sidexa dot fr