Bug 50606 - Threads break memusage
Summary: Threads break memusage
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-01 15:21 UTC by Mark H Johnson
Modified: 2016-11-24 15:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-04 20:25:19 UTC
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2001:121 0 normal SHIPPED_LIVE GNU C Library bugfix update 2001-10-04 04:00:00 UTC

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.


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