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 Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  lostbard
Originator Name:  Open/Closed:  * Closed
Release:  * other Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 23 Oct 2023 06:42:21 PM UTC, comment #3: 

fixed in  1.3.1

John Donoghue <lostbard>
Group Member
Mon 06 Feb 2023 06:17:40 PM UTC, comment #2: 
John Donoghue <lostbard>
Group Member
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 lostbard (Posted a comment)
  • -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 group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-10-23 lostbard StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2023-02-06 lostbard StatusNone Ready For Test
        Assigned toNone lostbard
    2022-11-17 rlaboiss Attached File- Added unwind-protect-cleanup.patch, #53968

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code