Bug 50606

Summary: Threads break memusage
Product: [Retired] Red Hat Linux Reporter: Mark H Johnson <mark_h_johnson>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NEXTRELEASE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-04 20:25:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A threaded application that breaks memusage. none

Description Mark H Johnson 2001-08-01 15:21:21 UTC
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
memusage.

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 15:22:58 UTC
Created attachment 25792 [details]
A threaded application that breaks memusage.

Comment 2 Mark H Johnson 2001-08-01 18:37:57 UTC
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 13:03:50 UTC
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 22:55:28 UTC
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:
2143715564
         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?
Thanks.


Comment 5 Bill Nottingham 2006-08-04 20:25:19 UTC
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.