Bug 50606 - Threads break memusage
Threads break memusage
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-08-01 11:21 EDT by Mark H Johnson
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-04 16:25:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
A threaded application that breaks memusage. (2.81 KB, text/plain)
2001-08-01 11:22 EDT, Mark H Johnson
no flags Details

  None (edit)
Description Mark H Johnson 2001-08-01 11:21:21 EDT
Description of Problem:
Running a threaded application with memusage causes a segmentation
violation in the memusage code.

How Reproducible:
See attachment (main.c) for a sample threaded application that breaks

Steps to Reproduce:
1. gcc -o main main.c
2. memusage ./main
3. OR memusage --no-timer ./main

Actual Results:
$ memusage ./main
/usr/bin/memusage: line 1:  1837 Segmentation fault      (core dumped)
LD_PRELOAD=/lib/libmemusage.so "$@"
$ memusage --no-timer ./main
/usr/bin/memusage: line 1:  1839 Segmentation fault      (core dumped)
LD_PRELOAD=/lib/libmemusage.so MEMUSAGE_NO_TIMER=yes "$@"

Expected Results:
Program runs to completion w/ histogram output of memory usage.

Additional Information:
Will attach the source file shortly.
Comment 1 Mark H Johnson 2001-08-01 11:22:58 EDT
Created attachment 25792 [details]
A threaded application that breaks memusage.
Comment 2 Mark H Johnson 2001-08-01 14:37:57 EDT
A slight correction on building the main program...
  gcc -o main main.c -lpthread
I also tried (just in case...)
  gcc -D_REENTRANT -o main main.c -lpthread
and they continue to fail with the segmentation violation.
Comment 3 Jakub Jelinek 2001-08-07 09:03:50 EDT
Should be fixed by http://sources.redhat.com/ml/libc-hacker/2001-08/msg00018.html.
This will appear probably in glibc-2.2.4-3.
Comment 4 Mark H Johnson 2001-08-23 18:55:28 EDT
Thanks for the fix. That certainly helps the start up problem but may
have uncovered another bug. I got the following output from a threaded
app that uses about 34 meg of memory...

Memory usage summary: heap total: 30733622, heap peak: 30731086, stack peak:
         total calls   total memory   failed calls
 malloc|        312       30732854              0
realloc|          0              0              0   (in place: 0, dec: 0)
 calloc|          6            768              0
   free|         15           2536

Note the "stack peak" at about 2G. Should I submit this as a new bug?
Comment 5 Bill Nottingham 2006-08-04 16:25:19 EDT
Red Hat Linux and Red Hat Powertools are currently no longer supported by Red
Hat, Inc. In an effort to clean up bugzilla, we are closing all bugs in MODIFIED
state for these products.

However, we do want to make sure that nothing important slips through the
cracks. If, in fact, these issues are not resolved in a current Fedora Core
Release (such as Fedora Core 5), please open a new issues stating so. Thanks.

Note You need to log in before you can comment on or make changes to this bug.