【问题标题】:Why is mongoCursor->key() causing php to crash?为什么 mongoCursor->key() 导致 php 崩溃?
【发布时间】:2012-06-11 00:36:42
【问题描述】:

我正在尝试在我的本地机器上运行学说\mongo-odm 的测试套件。 php 在 is 测试中崩溃且没有错误消息(当我说崩溃时,我的意思是崩溃,php 进程终止):Doctrine\ODM\MongoDB\Test\Functional\FilesTest::testFiles

测试内容如下:

public function testFiles()
{
    $image = new File();
    $image->setName('Test');
    $image->setFile(__DIR__ . '/file.txt');

    $profile = new Profile();
    $profile->setFirstName('Jon');
    $profile->setLastName('Wage');
    $profile->setImage($image);

    $this->dm->persist($profile);
    $this->dm->flush();

    $this->assertInstanceOf('Doctrine\MongoDB\GridFSFile', $image->getFile());
    $this->assertFalse($image->getFile()->isDirty());
    $this->assertEquals(__DIR__ . '/file.txt', $image->getFile()->getFilename());
    $this->assertTrue(file_exists($image->getFile()->getFilename()));
    $this->assertEquals('These are the bytes...', $image->getFile()->getBytes());

    $image->setName('testing');
    $this->dm->flush();
    $this->dm->clear();

fails here ===>>$image = $this->dm->find('Documents\File', $image->getId());
    $this->assertNotNull($image);
    $this->assertEquals('testing', $image->getName());
    $this->assertEquals('These are the bytes...', $image->getFile()->getBytes());
}

我已在Doctrine\MongoDB\Cursor::key() 中更深入地跟踪故障至mongoCursor->key()

我已经使用 MongoFiles 命令行工具在我的系统上测试了 Mongo Grid FS,它运行良好。

没有错误消息,我不知道去哪里找。有人有建议吗?

【问题讨论】:

  • 您使用的是哪个版本的驱动程序?
  • @Derick mongo 驱动程序版本 1.2.10,php 5.4 msvc9 ts
  • 请在jira.mongodb.org提交错误报告。
  • 德里克,感谢您的支持。我还没有提出错误报告,因为听起来它已经在开发版本中修复了 - 请参阅下面的 @bojori 的 cmets。

标签: mongodb doctrine-orm phpunit


【解决方案1】:

在 1.2.11-dev 中已经修复了几个相关的错误。 我可以使用 pecl/mongo v1.2.10 重现崩溃,但不能使用当前的 v1.2.11-dev。

【讨论】:

  • 谢谢@bjori,很高兴知道。知道 1.2.11 什么时候发布吗?
  • 我们可能会在一周或两/三周内完成。
  • @superdweebie:我今天偶然发现了这个问题,信不信由你。我立即想知道为什么 Travis CI 构建很好,然后意识到它们运行 1.2.7。 1.2.11 发布后我会更新。
【解决方案2】:

回到 1.2.9 也可以解决您的问题

【讨论】:

    猜你喜欢
    • 2013-01-27
    • 2021-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多