Project

General

Profile

Bug(バグ) #1831

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

Added by Shogo Kawahara over 8 years ago. Updated almost 4 years ago.

Status:
Fixed(完了)
Priority:
High(高め)
Target version:
Start date:
2010-12-04
Due date:
% Done:

100%

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

Description

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)
     {

Related issues

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

Associated revisions

Revision 3b9e179f (diff)
Added by Shogo Kawahara over 8 years ago

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

Revision 62991b1d (diff)
Added by Shogo Kawahara over 8 years ago

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

History

#1 Updated by Shogo Kawahara over 8 years ago

  • Status changed from New(新規) to Pending Review(レビュー待ち)
  • % Done changed from 0 to 50

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

#2 Updated by Shogo Kawahara over 8 years ago

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

#3 Updated by Kousuke Ebihara about 8 years ago

  • Status changed from Pending Review(レビュー待ち) to Pending Testing(テスト待ち)
  • % Done changed from 50 to 70

#4 Updated by Yuma Sakata almost 8 years ago

  • Status changed from Pending Testing(テスト待ち) to Fixed(完了)
  • % Done changed from 70 to 100

テストOKです。

#5 Updated by kaoru n almost 4 years ago

  • 3.8 で発生するか set to Unknown (未調査)

Also available in: Atom PDF