Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-07 Thread Beauregard,Christophe (ECCC)
Reported to the GCC maintainers: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110156

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-06 Thread Beauregard,Christophe (ECCC)
037...@bugs.debian.org> Subject: Re: Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak I've managed to find a workaround. Not a great workaround, but it seems to let me take advantage of all cores for OMP without penalty. I'll be running some more tests on that. The thread needs t

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-05 Thread Beauregard,Christophe (ECCC)
I've managed to find a workaround. Not a great workaround, but it seems to let me take advantage of all cores for OMP without penalty. I'll be running some more tests on that. The thread needs to call: #include omp_pause_resource_all(omp_pause_soft); at thread termination (a hard

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-05 Thread Bob Friesenhahn
On Mon, 5 Jun 2023, Beauregard,Christophe (ECCC) wrote: FWIW, I think I may have figured out what's happening. It's probably something to note in the http://www.graphicsmagick.org/OpenMP.html documentation. In a nutshell, my understanding is that libgomp keeps track of its thread pool in

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-05 Thread Beauregard,Christophe (ECCC)
5, 2023 08:58 To: László Böszörményi (GCS) ; Bob Friesenhahn ; 1037...@bugs.debian.org <1037...@bugs.debian.org> Subject: Re: Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak >Do you think it might be a problem with another system component, a GCC optimization

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-05 Thread Beauregard,Christophe (ECCC)
; 1037...@bugs.debian.org <1037...@bugs.debian.org> Subject: Re: Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak >Do you think it might be a problem with another system component, a GCC optimization or this is fixed meanwhile? I'm not sure. It took me most of a week to e

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-05 Thread Beauregard,Christophe (ECCC)
ers, etc. c. From: László Böszörményi (GCS) Sent: Sunday, June 4, 2023 06:25 To: Bob Friesenhahn ; 1037...@bugs.debian.org <1037...@bugs.debian.org> Cc: Beauregard,Christophe (ECCC) Subject: Re: Bug#1037042: graphicsmagick: GetImageDepth has a thr

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-04 Thread Bob Friesenhahn
My own testing is under Ubuntu 20.04 using GCC 10. Do you think it might be a problem with another system component, a GCC optimization or this is fixed meanwhile? At least I do wonder why this issue is CPU / machine dependent. As a further data point, I compiled the test program under

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-04 Thread Bob Friesenhahn
On Sun, 4 Jun 2023, László Böszörményi wrote: Hi, On Sat, Jun 3, 2023 at 8:30 PM Bob Friesenhahn wrote: I am definitely able to confirm that memory consumption builds due to invoking GetImageDepth() via a POSIX thread. The rate that it builds is image sensitive since some images cause

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-04 Thread GCS
Hi, On Sat, Jun 3, 2023 at 8:30 PM Bob Friesenhahn wrote: > I am definitely able to confirm that memory consumption builds due to > invoking GetImageDepth() via a POSIX thread. The rate that it builds > is image sensitive since some images cause GetImageDepth() to perform > more OpenMP loops.

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-03 Thread Bob Friesenhahn
I am definitely able to confirm that memory consumption builds due to invoking GetImageDepth() via a POSIX thread. The rate that it builds is image sensitive since some images cause GetImageDepth() to perform more OpenMP loops. In /proc/PID/smaps I see multiple memory-mapped regions

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-03 Thread Bob Friesenhahn
I did manage to get the test program compiled on my PC (a laptop). It was challenging since the source code (extracted from email) seemed to have hidden characters in it that the C compiler did not like. I do see the reported RSS very gradually creeping up. It seems to go up and then go back

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-02 Thread Beauregard,Christophe (ECCC)
32 To: Bob Friesenhahn ; 1037...@bugs.debian.org <1037...@bugs.debian.org> Subject: Re: Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak I'm kind of stuck with this version of GM; my organization is currently tracking Debian LTS. I suppose I should have added

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-02 Thread Beauregard,Christophe (ECCC)
my sanity. From: Bob Friesenhahn Sent: Friday, June 2, 2023 14:38 To: Beauregard,Christophe (ECCC) ; 1037...@bugs.debian.org <1037...@bugs.debian.org> Subject: Re: Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak [You don't often get

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-02 Thread Bob Friesenhahn
Christophe, It would be good to test a modern GM version which supports "resource limited memory". Probably Debian's 1.4 version supports that. For a version which supports the resource limited memory allocator, you can set 'MAGICK_DEBUG=resource' in the environment prior to running the

Bug#1037042: graphicsmagick: GetImageDepth has a thread arena and memory leak

2023-06-02 Thread Beauregard,Christophe (ECCC)
Package: graphicsmagick Version: 1.4+really1.3.36+hg16481-2+deb11u1 Severity: normal Tags: upstream The GraphicsMagick API has a thread arena and more general memory leak somewhere in the GetImageDepth() API call, presumably a side-effect of the OpenMP usage. First, you need a server class