linux_logo icon indicating copy to clipboard operation
linux_logo copied to clipboard

sysctl: Cannot allocate memory on FreeBSD 10

Open dereckson opened this issue 9 years ago • 5 comments

Output on FreeBSD 10:

  • a "sysctl: Cannot allocate memory" error message
  • the correct logo
  • an information line with RAM information missing
FreeBSD Version 10.0-RELEASE, Compiled FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014   
Zero  Intel(R) Atom(TM) CPU  C2750  @ 2.40GHz Processors, 0M RAM, -1.00 Bogomips Total
                               ysul.nasqueron.org

dereckson avatar Mar 28 '15 17:03 dereckson

I've opened two PR's:

  • Memory-handling improvements on #10
  • Fix broken sysctl() calls on FreeBSD (64-bit) on #11

As you can see, both changes are merged to my own master branch.

@dereckson, can you try it out?

thevilledev avatar Oct 10 '16 21:10 thevilledev

Ǹew output with your fixes works and shows RAM information correctly.

$ hub fetch vtorhonen
$ git checkout vtorhonen-freebsd-libsysinfo
$ git rebase vtorhonen-memory-handling
$ gmake clean all
$ ./linux_logo 
             ,        ,
            /(        )`
            \ \___   / |
            /- _  `-/  '
           (/\/ \ \   /\
           / /   | `    \
           O O   ) /    |
           `-^--'`<     '
          (_.)  _  )   /
           `.___/`    /
             `-----' /
<----.     __ / __   \
<----|====O)))==) \) /====
<----'    `--' `.__,' \
             |        |
              \       /       /\
         ______( (_  / \______/
       ,'  ,-----'   |
       `--{__________)

FreeBSD Version 10.1-RELEASE-p26, Compiled FreeBSD 10.1-RELEASE-p26 #0: Wed Jan 13 20:59:29 UTC 2016     ro
Four  Intel(R) Atom(TM) CPU  C2750  @ 2.40GHz Processors, 3.6GB RAM, -1.00 Bogomips Total
                               ysul.nasqueron.org

dereckson avatar Oct 10 '16 21:10 dereckson

Unfortunately, there is a problem with contact with @deater, @vtorhonen I will however include your patched in the Debian package.

tdi avatar Oct 11 '16 11:10 tdi

Thanks @tdi.

thevilledev avatar Oct 11 '16 15:10 thevilledev

I've a new one for FreeBSD, a segmentation fault for #R memory information:

(lldb) thread list
Process 37158 stopped
* thread #1: tid = 101506, 0x00000008004107dd libc.so.7`memcpy + 205, name = 'linux_logo', stop reason = signal SIGSEGV: invalid address (fault address: 0x7ffefffff240)
(lldb) thread backtrace
* thread #1, name = 'linux_logo', stop reason = signal SIGSEGV: invalid address (fault address: 0x7ffefffff240)
  * frame #0: 0x00000008004107dd libc.so.7`memcpy + 205
    frame #1: 0x000000080040e5cd libc.so.7`___lldb_unnamed_symbol1635$$libc.so.7 + 397
    frame #2: 0x00000008003a8a0c libc.so.7`___lldb_unnamed_symbol1024$$libc.so.7 + 14044
    frame #3: 0x0000000800408005 libc.so.7`snprintf + 325
    frame #4: 0x00000000002042c7 linux_logo`main [inlined] generate_sysinfo at linux_logo.c:396
    frame #5: 0x00000000002041cf linux_logo`main [inlined] draw_logo at linux_logo.c:463

dereckson avatar Jan 18 '20 05:01 dereckson