[Home]

Summary:ASTERISK-15633: [patch] core show sysinfo shows invalid (negative value) for ram on systems whith a lot of ram
Reporter:jlpedrosa (jlpedrosa)Labels:
Date Opened:2010-02-16 07:32:47.000-0600Date Closed:2010-05-24 13:30:01
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20100216_issue16837.patch
( 1) 20100504__issue16837.diff.txt
Description:Hi, i've just installed asterisk and saw this:

system has 12 gigs of ram.

System Statistics
-----------------
 System Uptime:             20 hours
 Total RAM:                 -185548 KiB
 Free RAM:                  2886420 KiB
 Buffer RAM:                68400 KiB
 Total Swap Space:          755012 KiB
 Free Swap Space:           755012 KiB

 Number of Processes:       202

*CLI> Killed


root@bender:~/installation/asterisk-1.6.2.2# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
0  1      0 11283924  68412 952548    0    0     1     2   46   60  1  0 99  0

****** ADDITIONAL INFORMATION ******

It's a 32 bit (pae)  version of linux

root@bender:~/installation/asterisk-1.6.2.2# uname -a
Linux bender 2.6.31-19-generic-pae ASTERISK-52-Ubuntu SMP Thu Jan 28 02:29:51 UTC 2010 i686 GNU/Linux
Comments:By: Sean Bright (seanbright) 2010-02-16 13:06:35.000-0600

I just uploaded a very simple patch (and maybe naive), but give it a shot and let me know if it works for you.

By: Walter Doekes (wdoekes) 2010-02-16 15:29:57.000-0600

I'm guessing the breakage occurs a bit later on, at the (long) casts:

ast_cli(a->fd, "  Total RAM:                 %ld KiB\n", (long)physmem/1024);
ast_cli(a->fd, "  Free RAM:                  %ld KiB\n", (long)freeram);

s/%ld/%llu/ and s/(long)//

By: jlpedrosa (jlpedrosa) 2010-02-17 02:50:56.000-0600

I patched it and get same result (i dind't make the replace of wdoekes):

 500  cd installation/asterisk-1.6.2.2
 501  wget 'https://issues.asterisk.org/file_download.php?file_id=25335&type=bug' -O - | patch -p0
 502  make
 503  make install
 504  asterisk -cdvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
*CLI> core show sysinfo

System Statistics
-----------------
 System Uptime:             39 hours
 Total RAM:                 -185548 KiB
 Free RAM:                  2870500 KiB
 Buffer RAM:                73148 KiB
 Total Swap Space:          755012 KiB
 Free Swap Space:           755012 KiB

 Number of Processes:       197

*CLI> Killed

By: Leif Madsen (lmadsen) 2010-03-23 12:34:49

Setting back to Acknowledged as it seems the patch hasn't resolved the issue.

By: Tilghman Lesher (tilghman) 2010-05-04 16:00:04

New patch uploaded that fixes the outputs correctly.  Please test and report back as to whether this works for you.

By: Tilghman Lesher (tilghman) 2010-05-18 10:09:56

jlpedrosa:  your feedback on this new patch would be appreciated.

By: jlpedrosa (jlpedrosa) 2010-05-18 10:40:35

I'll see what can I do, the PBX is on production environment now, I have to wait a good moment to test it, don't worry I've not forget it.

By: Digium Subversion (svnbot) 2010-05-24 13:19:08

Repository: asterisk
Revision: 265316

U   trunk/main/asterisk.c

------------------------------------------------------------------------
r265316 | tilghman | 2010-05-24 13:19:08 -0500 (Mon, 24 May 2010) | 7 lines

On systems with a LOT of RAM, a signed integer sometimes printed negative.

(closes issue ASTERISK-15633)
Reported by: jlpedrosa
Patches:
      20100504__issue16837.diff.txt uploaded by tilghman (license 14)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=265316

By: Digium Subversion (svnbot) 2010-05-24 13:30:00

Repository: asterisk
Revision: 265318

_U  branches/1.6.2/
U   branches/1.6.2/main/asterisk.c

------------------------------------------------------------------------
r265318 | tilghman | 2010-05-24 13:30:00 -0500 (Mon, 24 May 2010) | 14 lines

Merged revisions 265316 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r265316 | tilghman | 2010-05-24 13:19:08 -0500 (Mon, 24 May 2010) | 7 lines
 
 On systems with a LOT of RAM, a signed integer sometimes printed negative.
 
 (closes issue ASTERISK-15633)
  Reported by: jlpedrosa
  Patches:
        20100504__issue16837.diff.txt uploaded by tilghman (license 14)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=265318