Bug #71403 [Opn->Fbk]: odbc segfault

From: Date: Mon, 28 Sep 2020 15:53:52 +0000
Subject: Bug #71403 [Opn->Fbk]: odbc segfault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229252@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71403&edit=1

 ID:                 71403
 Updated by:         cmb@php.net
 Reported by:        ice21zero at gmail dot com
 Summary:            odbc segfault
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            PDO ODBC
 Operating System:   CentOS 6.7 , Ubuntu 14.04
 PHP Version:        7.0.3
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Previous Comments:
------------------------------------------------------------------------
[2016-02-08 22:22:24] ice21zero at gmail dot com

updated to php 7.0.3 , result the same segmentation fault mayme memory leak in some module

------------------------------------------------------------------------
[2016-01-21 15:21:12] ice21zero at gmail dot com

not able to exclude code from project to one sript. build php from git php-src and se that now.

Call Stack:
    0.0001     352472   1. {main}() /var/www/optimisator/app/Console/cake.php:0
    0.0006     417832   2. ShellDispatcher::run() /var/www/optimisator/app/Console/cake.php:34
    0.0210    3973768   3. ShellDispatcher->dispatch()
/var/www/optimisator/lib/Cake/Console/ShellDispatcher.php:66
    0.0264    4911936   4. Shell->runCommand()
/var/www/optimisator/lib/Cake/Console/ShellDispatcher.php:207
    0.0439    5393536   5. CronShell->doNow() /var/www/optimisator/lib/Cake/Console/Shell.php:357
    0.4249   12563576   6. k50WorkerJob->gearman_runEvent()
/var/www/optimisator/app/Console/Command/CronShell.php:352
    0.4249   12563952   7. k50WorkerJob->__call()
/var/www/optimisator/app/Console/Command/CronShell.php:352
    0.6536   12609808   8. gearman_runEvent()
/var/www/optimisator/app/Lib/k50/Workers/k50WorkerJob.php:79
    0.6594   13272984   9. Event->run() /var/www/optimisator/app/Lib/k50/Workers/events.php:27
    0.7858   17558792  10. Event->runDirectKeysEvent()
/var/www/optimisator/app/Model/Event.php:493
   13.7959   57432336  11. DirectRules->checkRulesForKeys()
/var/www/optimisator/app/Model/Event.php:1027
   13.7963   57436880  12. DirectAggregatedRows->getKeysParams()
/var/www/optimisator/app/Model/DirectRules.php:388
   14.5799  140151568  13. VerticaReportStatistics->getStoredStat()
/var/www/optimisator/app/Model/DirectAggregatedRows.php:182
   14.6201  140156808  14. VerticaReportStatistics->iterateRecords()
/var/www/optimisator/app/Lib/k50/Stat/VerticaReportStatistics.php:53
   14.6205  140159632  15. VerticaDirectKeys->createSqlParameters()
/var/www/optimisator/app/Lib/k50/Stat/VerticaReportStatistics.php:150
   14.6266  140425336  16. StatQueryBuilder->finalize()
/var/www/optimisator/app/Model/VerticaDirectKeys.php:176
   14.6266  140426536  17. SimpleQueryBuilder->getSql()
/var/www/optimisator/app/Lib/k50/Stat/StatQueryBuilder.php:673
   14.6266  140427232  18. Vertica->buildStatement()
/var/www/optimisator/app/Lib/k50/SimpleQueryBuilder.php:78
   14.6267  140437200  19. Vertica->renderStatement()
/var/www/optimisator/app/Model/Datasource/Database/Vertica.php:1125

Fatal Error Error: Allowed memory size of 12582912000 bytes exhausted (tried to allocate
140453607299560 bytes) in [/var/www/optimisator/app/Model/Datasource/Database/Vertica.php, line
1152]

------------------------------------------------------------------------
[2016-01-18 15:43:22] pajoye@php.net

Do you have a script like please?

1. connect
2. query with the actual query being used
3. fetch
4. close (if used in your initial report)

------------------------------------------------------------------------
[2016-01-18 14:02:48] ice21zero at gmail dot com

odbc_result() /var/www/optimisator/app/Vendor/Vertica/VerticaStatement.php:130
odbc_field_name() /var/www/optimisator/app/Vendor/Vertica/VerticaStatement.php:130
    
--- code sample start ----

public function fetch($fetchMode = null, $cursor_orientation = null, $cursor_offset = null)
    {
        $fetchMode = $fetchMode ?: $this->defaultFetchMode;

        if (!$fetched = @odbc_fetch_row($this->sth)) {
            return false;
        }

        $numFields = odbc_num_fields($this->sth);
        $row = [];

        switch ($fetchMode) {
            case \PDO::FETCH_ASSOC:
            case \PDO::FETCH_OBJ:
            case \PDO::FETCH_LAZY:
                for ($i = 1; $i <= $numFields; $i++) {
/*row 130 */                   $row[odbc_field_name($this->sth, $i)] = odbc_result($this->sth,
$i);
                }
                if (
                    \PDO::FETCH_OBJ == $fetchMode or
                    \PDO::FETCH_LAZY == $fetchMode
                ) {
                    $row = (object)$row;
                }
                break;

            case \PDO::FETCH_NUM:
                for ($i = 1; $i <= $numFields; $i++) {
                    $row[] = odbc_result($this->sth, $i);
                }
                break;

            case \PDO::FETCH_BOTH;
                for ($i = 1; $i <= $numFields; $i++) {
                    $value = odbc_result($this->sth, $i);

                    $row[] = $row[odbc_field_name($this->sth, $i)] = $value;
                }
                break;

            default:
                throw new VerticaException(sprintf('Unsupported fetch mode
"%s"', $fetchMode));
        }

        return $row;
}

--- code sample end ----

------------------------------------------------------------------------
[2016-01-18 13:34:31] pajoye@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=71403


--
Edit this bug report at https://bugs.php.net/bug.php?id=71403&edit=1


Thread (8 messages)

« previous php.bugs (#229252) next »