bugGNU Octave - Bugs: bug #63381, [octave forge] (string) Properly...

 
 

bug #63381: [octave forge] (string) Properly cleanup of PCRE2 data

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Thu 17 Nov 2022 08:24:24 PM UTC
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * other Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Fri 18 Nov 2022 03:39:38 AM UTC, comment #1: 

Memory leaking can be observed, without the patch, like this:

$ echo 'pkg load strings ; while 1 ; pcregexp("x", "y") ; endwhile' | octave-cli & while true ; do sleep 5 ; ps uax | grep octave-cli | grep -v grep ; done
rlaboiss   19084 62.0  4.1 378872 84356 pts/2    Rl   00:37   0:03 octave-cli
rlaboiss   19084 81.1  6.8 433916 139268 pts/2   Rl   00:37   0:08 octave-cli
rlaboiss   19084 87.4  9.7 491732 197084 pts/2   Rl   00:37   0:13 octave-cli
rlaboiss   19084 90.7 12.5 549152 254636 pts/2   Rl   00:37   0:18 octave-cli

On the other hand, with my patch:

$ echo 'pkg load strings ; while 1 ; pcregexp("x", "y") ; endwhile' | octave-cli & while true ; do sleep 5 ; ps uax | grep octave-cli | grep -v grep ; done
rlaboiss   18095 61.8  2.7 350892 56036 pts/2    Rl   00:35   0:03 octave-cli
rlaboiss   18095 81.0  2.7 350892 56036 pts/2    Rl   00:35   0:08 octave-cli
rlaboiss   18095 87.8  2.7 350892 56036 pts/2    Rl   00:35   0:13 octave-cli
rlaboiss   18095 90.9  2.7 350892 56036 pts/2    Rl   00:35   0:18 octave-cli

Rafael Laboissière <rlaboiss>
Thu 17 Nov 2022 08:24:24 PM UTC, original submission:  

Some time ago, I contributed to the port of the code in src/pcregexp.cc to PCRE2 (bug #61570). I just discovered that, in my patch, the data created by the functions pcre2_compile and pcre2_match_data_create_from_pattern are not cleaned up properly, what may cause a memory leak.

The patch attached to this bug report seems to fix the problem.

Rafael Laboissière <rlaboiss>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rlaboiss (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.

     

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-17 rlaboiss Attached File- Added unwind-protect-cleanup.patch, #53968

    Back to the top


    Powered by Savane 3.9