Menu

#2356 (ok 2.10.0-rc2) Memory Error (BLOB browsing)

Latest_Git
fixed
1
2013-06-11
2007-02-13
Thog
No

Script runs out of memory while listing large BLOB fields... Screenshot should show everything...

Discussion

  • Thog

    Thog - 2007-02-13

    Image Of Error...

     
  • Marc Delisle

    Marc Delisle - 2007-02-14

    Logged In: YES
    user_id=210714
    Originator: NO

    Which revision is marked on your common.lib.php at about line 36?

     
  • Marc Delisle

    Marc Delisle - 2007-02-14
    • assigned_to: nobody --> lem9
     
  • Thog

    Thog - 2007-02-15

    Logged In: YES
    user_id=1718492
    Originator: YES

    phpMyAdmin 2.10.0-rc1 UTF-8

    /* $Id: common.lib.php 9935 2007-02-06 13:34:35Z cybot_tm $ */

     
  • Jürgen Wind

    Jürgen Wind - 2007-02-16

    Logged In: YES
    user_id=1383652
    Originator: NO

    reproducable on demo (svn trunk at the moment)
    http://pma.cihar.com/trunk-config/sql.php?db=Test&table=blobsizetest

    after uploading a ~700k blob and trying to *browse* :
    Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 1443117 bytes)
    in /srv/http/pma.cihar.com/trunk-config/libraries/display_tbl.lib.php on line 1141

    on pma 2.9.2 dito
    Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 1443117 bytes)
    in /srv/http/pma.cihar.com/STABLE/libraries/display_tbl.lib.php on line 1134

     
  • Marc Delisle

    Marc Delisle - 2007-02-16

    Logged In: YES
    user_id=210714
    Originator: NO

    This table does not have a primary key. In display_tbl.lib.php, the logic tries to compensate for this by generating $unique_condition which is obviously too big. I guess we'll have to put some artificial limit on its size, and we won't be able to display Modify and Delete links/icons.

     
  • Marc Delisle

    Marc Delisle - 2007-02-16
    • summary: Memory Error --> Memory Error (BLOB and no PK)
     
  • Jürgen Wind

    Jürgen Wind - 2007-02-16

    Logged In: YES
    user_id=1383652
    Originator: NO

    Marc,
    my bad, after adding a PK th *browse display* is ok now.

    but trying to upload a 1.8 MB file
    i got:
    Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 3796274 bytes) in /srv/http/pma.cihar.com/trunk-config/tbl_replace.php on line 273
    note: attempt to allocate ~twice the size of the file.

    uploading a smaller file (~650K) the "Run SQL query/queries on database" textarea still is populated with 2.6MB data (html source of that frame)!

     
  • Thog

    Thog - 2007-02-16

    Logged In: YES
    user_id=1718492
    Originator: YES

    I have a primary key on the id... As you can see in the screen shot... (well you don't see it but id is a primary key)...

     
  • Marc Delisle

    Marc Delisle - 2007-02-17

    Logged In: YES
    user_id=210714
    Originator: NO

    nymphonics, please attach here the export of your table's structure

    windkiel, I can't reproduce this textarea problem; are you talking about the one in the querywindow?
    (The "twice the size" is because we use bin2hex(), if you have a better idea I would be interested).

     
  • Jürgen Wind

    Jürgen Wind - 2007-02-17

    Logged In: YES
    user_id=1383652
    Originator: NO

    ok,
    >uploading a smaller file (~650K) the "Run SQL query/queries on database"
    >textarea still is populated with 2.6MB data (html source of that frame)!
    this is not reproducable any more :)
    (maybe "demo" was not uptodate yesterday...)

    *but*:
    click "insert"
    choose a file ~1.8MB ->go
    throws
    Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 3616215 bytes)
    in /srv/http/pma.cihar.com/trunk-config/tbl_replace.php on line 273

    how to reproduce:

    CREATE TABLE `blobsizetest` (
    `autoID` int(11) NOT NULL auto_increment,
    `what` varchar(222) NOT NULL,
    `size_KB` int(11) NOT NULL,
    `mediumBlob16M` longblob NOT NULL,
    `comment` tinytext NOT NULL,
    PRIMARY KEY (`autoID`)
    ) ENGINE=MyISAM COMMENT='pma bug trk [ 1659176 ] Memory Error (BLOB and no PK)' ;

    see (at the moment ;) :
    http://pma.cihar.com/trunk-config/sql.php?db=Test&table=blobsizetest

     
  • Thog

    Thog - 2007-02-17

    Logged In: YES
    user_id=1718492
    Originator: YES

    CREATE TABLE `audios` (
    `id` smallint(5) unsigned NOT NULL auto_increment,
    `audio` longblob NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=78;
    <br />
    <b>Notice</b>: Undefined index: charset_of_file in <b>C:\Websites\phpMyAdmin\libraries\export\sql.php</b> on line <b>165</b><br />

     
  • Marc Delisle

    Marc Delisle - 2007-02-17

    Logged In: YES
    user_id=210714
    Originator: NO

    windkiel: Yes I can reproduce this memory error, that's why I wrote that it's because we are using bin2hex() which doubles the size but is the best way we found to protect the binary data inside the generated SQL.

    nymphonics: ok, I just fixed this "undefined index" while exporting :) But me and windkiel cannot reproduce your bug. How many rows are there in your table? When browsing, do you see all the rows (your screenshot displays 3 rows in your table).

     
  • Marc Delisle

    Marc Delisle - 2007-02-17
    • summary: Memory Error (BLOB and no PK) --> Memory Error (BLOB browsing)
     
  • Jürgen Wind

    Jürgen Wind - 2007-02-18

    Logged In: YES
    user_id=1383652
    Originator: NO

    Marc,
    if the "Fatal error" can't be catched
    maybe the displayed MAX_FILE_SIZE should be devided by two?

    btw.
    the "int(x)" value edit fields in tbl_change.php
    open as "select" instead of "input"
    do you want me to lauch a separate error report?

     
  • Marc Delisle

    Marc Delisle - 2007-02-18

    Logged In: YES
    user_id=210714
    Originator: NO

    Juergen,
    Currently, the MAX_FILE_SIZE and the Max: caption are generated, taking into account
    - the BLOB's size
    - php.ini's upload_max_filesize and post_max_size

    We should also take into account MySQL's max_allowed_packet.

    For PHP's memory_limit, we could detect if the user is not running in safe mode. In this case, the displayed limit can be the same as now because we can do ini_set('memory_limit', -1) just before the binhex().
    If running in safe mode, I agree that we'll have to display a lower limit but I don't know how much lower, we'll have to experiment to see the needs of bin2hex().

     
  • Thog

    Thog - 2007-02-21

    Logged In: YES
    user_id=1718492
    Originator: YES

    There are about 30 rows in the table... All mp3 files...

    memory_limit = 32M

    It seems to lock after displaying 16 megs of files...

     
  • Marc Delisle

    Marc Delisle - 2007-02-22

    Logged In: YES
    user_id=210714
    Originator: NO

    windkiel:
    ------
    the "int(x)" value edit fields in tbl_change.php
    open as "select" instead of "input"
    ------
    Do you mean you are seeing a select box instead of an input box for an integer field?
    ===========
    nymphonics:
    I still cannot reproduce this problem. Could I get the full export of your table (data included)? I can set up a ftp account if you want to upload it at my site.

     
  • Jürgen Wind

    Jürgen Wind - 2007-02-23

    Logged In: YES
    user_id=1383652
    Originator: NO

    Hi Marc,
    >Do you mean you are seeing a select box instead of an
    >input box for an integer field?
    exactly!

    But the issue is gone since the demo server was purged lately,
    but it was clearly to be seen then after the failed upload,
    not at table creation time ( checked with IE6, FF 1.5 and Opera 9)!

    I am not able to reproduce it now.

    Juergen

    p.s.
    could you plz merge theme "Grid" but not "grid", see
    http://sourceforge.net/tracker/index.php?func=detail&aid=1656956&group_id=23067&atid=689412

     
  • Thog

    Thog - 2007-02-27

    Logged In: YES
    user_id=1718492
    Originator: YES

    http://www.olamgallery.com/a.rar for the database files...

     
  • Marc Delisle

    Marc Delisle - 2007-02-27

    Logged In: YES
    user_id=210714
    Originator: NO

    Ok now I see your bug...

     
  • Marc Delisle

    Marc Delisle - 2007-02-27
    • priority: 5 --> 1
    • summary: Memory Error (BLOB browsing) --> (ok 2.10.0-rc2) Memory Error (BLOB browsing)
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-02-28
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed