プロジェクト

全般

プロフィール

Bug(バグ) #1831

Segmentation fault occurs by openpne:migrate task (openpne:migrateタスクでセグメンテーション違反)

Shogo Kawahara13年以上前に追加. 8年以上前に更新.

ステータス:
Fixed(完了)
優先度:
High(高め)
担当者:
対象バージョン:
開始日:
2010-12-04
期日:
進捗率:

100%

3.6 で発生するか:
Yes
3.8 で発生するか:
Unknown (未調査)

説明

Overview

Segmentation fault occurs by openpne:migrate task (openpne:migrateタスクでセグメンテーション違反)

>> plugin    installing plugin "opRankingPlugin" 
>> opPluginManager Plugin is already installed
zsh: segmentation fault
$ php -v 
PHP 5.3.3-0.dotdeb.1 with Suhosin-Patch (cli) (built: Oct  1 2010 08:49:29) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologie

GDB debug trace

(gdb) file /usr/bin/php
(gdb) run symfony openpne:migrate
...
...
(gdb) bt
#0 0x000000000075f6e2 in zend_hash_get_current_key_type_ex ()
#1 0x0000000000638b44 in ?? ()
#2 0x0000000000747950 in zend_call_function ()
#3 0x00000000007481e8 in zend_lookup_class_ex ()
#4 0x0000000000766198 in ?? ()
#5 0x00000000007a73ee in ?? ()
#6 0x0000000000782871 in execute ()
#7 0x0000000000753061 in zend_execute_scripts ()
#8 0x00000000006fc4a8 in php_execute_script ()
#9 0x00000000007e6d8b in ?? ()
#10 0x00007fd06cf7d1a6 in __libc_start_main () from /lib/libc.so.6
#11 0x0000000000430f09 in _start ()
(gdb) print (char *)executor_globals.active_op_array->filename
$1 = 0x5cc7658 "/home/kawahara/dev/OpenPNE3/lib/vendor/PEAR/Net/UserAgent/Mobile.php" 
(gdb) print (char *)executor_globals.active_op_array->function_name
$2 = 0x5d20f30 "factory" 

Causes

This segmentation fault occurs by lib/vendor/PEAR/Net/UserAgent/Mobile.php line 158.

        if (!class_exists($class)) {

I think that cause is auto-loader.

Way to fix

"lib/vendor/PEAR/Net/UserAgent/Mobile.php" is changed as follows as a temporary measure.

diff --git a/lib/vendor/PEAR/Net/UserAgent/Mobile.php b/lib/vendor/PEAR/Net/UserAgent/Mobile.php
index 51404d8..317a283 100644
--- a/lib/vendor/PEAR/Net/UserAgent/Mobile.php
+++ b/lib/vendor/PEAR/Net/UserAgent/Mobile.php
@@ -155,7 +155,7 @@ class Net_UserAgent_Mobile

         $class = "Net_UserAgent_Mobile_$driver";

-        if (!class_exists($class)) {
+        if (!class_exists($class, false)) {
             $file = str_replace('_', '/', $class) . '.php';
             if (!include_once $file) {
                 return PEAR::raiseError(null,

And opMobileUserAgent is changed as follows.

diff --git a/lib/util/opMobileUserAgent.class.php b/lib/util/opMobileUserAgent.class.php
index 95ce784..7277665 100644
--- a/lib/util/opMobileUserAgent.class.php
+++ b/lib/util/opMobileUserAgent.class.php
@@ -24,7 +24,8 @@ class opMobileUserAgent
   protected function __construct()
   {
     require_once 'Net/UserAgent/Mobile.php';
-    
+    require_once 'Net/UserAgent/Mobile/NonMobile.php';
+
     self::$mobile = Net_UserAgent_Mobile::factory();
     if (self::$mobile instanceof Net_UserAgent_Mobile_Error)
     {

関連するチケット

関連している OpenPNE 3 - Backport(バックポート) #1832: Segmentation fault occurs by openpne:migrate task (openpne:migrateタスクでセグメンテーション違反) Fixed(完了) 2010-12-04
関連している OpenPNE 3 - Backport(バックポート) #2298: Segmentation fault occurs by openpne:migrate task (openpne:migrateタスクでセグメンテーション違反) Fixed(完了) 2010-12-04

関係しているリビジョン

リビジョン 3b9e179f (差分)
Shogo Kawahara13年以上前に追加

fixed opMobileUserAgent and Net_UserAgent_Mobile, because segmentation fault occurs by openpne:migrate task (fixes #1831)

リビジョン 62991b1d (差分)
Shogo Kawahara13年以上前に追加

reverted an unnecessary change in 3b9e179 (fixes #1831)

履歴

#1 Shogo Kawahara13年以上前に更新

  • ステータスNew(新規) から Pending Review(レビュー待ち) に変更
  • 進捗率0 から 50 に変更

更新履歴 62991b1d2d4c5c5e829184d13491e1bfe8ee177b で適用されました。

#2 Shogo Kawahara13年以上前に更新

更新履歴 3b9e179f7627119f9197b77ba13eb59f29a601d5 で適用されました。

#3 Kousuke Ebihara12年以上前に更新

  • ステータスPending Review(レビュー待ち) から Pending Testing(テスト待ち) に変更
  • 進捗率50 から 70 に変更

#4 Yuma Sakata12年以上前に更新

  • ステータスPending Testing(テスト待ち) から Fixed(完了) に変更
  • 進捗率70 から 100 に変更

テストOKです。

#5 kaoru n8年以上前に更新

  • 3.8 で発生するかUnknown (未調査) にセット

他の形式にエクスポート: Atom PDF