Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: NetBSD 10.0 compilation issues then conky crashes "attempting to use more CPUs than you have! #2097

Closed
epsheldoni opened this issue Dec 1, 2024 · 0 comments · Fixed by #2101
Labels
bug related to incorrect existing implementation of some functionality os: netbsd related to NetBSD triage issue that hasn't been verified, categorized or acknowledged yet

Comments

@epsheldoni
Copy link

What happened?

I had a similar issue with OpenBSD.
Downloaded latest version. Had compilation issues due to path to ncurses /usr/pkg/include/ncurses/ncurses.h not being in the following files
conky.cc line 92,
nc.h line32,
display-ncursed.cc line 39.
I replaced #<includeNcurses.h> with #include </usr/pkg/include/ncurses/ncurses.h>.

After making those changes compilation completes. However, conky crashes
with the following terminal output

NetBSD-10$ ./conky -d
conky: desktop window (0x1200028) is subwindow of root window (0x111)
conky: window type - normal
conky: drawing to created window (0x2e00002)
conky: drawing to double buffer
conky: forked to background, pid is 2479
NetBSD-10$
conky: FOUND: console
conky: FOUND: ncurses
conky: FOUND: file
conky: FOUND: x11
conky: cannot kvm_openfiles: /dev/mem: Permission denied
conky: maybe you need to setgid kmem this program?
conky: obj->data.i 2 info.cpu_count 1
conky: attempting to use more CPUs than you have!

After commenting out the CPU lines I ran conky and it ran but displayed no top information.
The terminal output was
NetBSD-10$ ./conky -d
conky: desktop window (0x1200028) is subwindow of root window (0x111)
conky: window type - normal
conky: drawing to created window (0x2e00002)
conky: drawing to double buffer
conky: forked to background, pid is 3332
NetBSD-10$
conky: FOUND: console
conky: FOUND: ncurses
conky: FOUND: file
conky: FOUND: x11
conky: cannot kvm_openfiles: /dev/mem: Permission denied
conky: maybe you need to setgid kmem this program?

Version

1.21.9

Which OS/distro are you seeing the problem on?

Linux (other)

Conky config

conky.config = {
background = true,
use_xft = true,
font = 'Liberation Sans:size=12',
update_interval = 1.0,
total_run_times = 0,
own_window = true,
own_window_class = 'Conky',
own_window_transparent = true,
own_window_type = normal,
own_window_argb_visual = true,
own_window_argb_value = 100,
own_window_hints = undecorated,below,sticky,skip_taskbar,skip_pager,
double_buffer = true,
maximum_width = 280,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'white',
default_shade_color = 'gray',
default_outline_color = 'gray',
alignment = 'middle_right',
gap_x = 12,
gap_y = 12,
no_buffers = true,
uppercase = false,
top_name_verbose = false,
cpu_avg_samples = 2,
override_utf8_locale = false,
color1 = blue,
color2 = gray,
}

--##############################################
--#  Output
--##############################################
conky.text = [[

Host:$alignr $nodename
Kernel:$alignr $kernel
Freq$alignr${freq}MHz
RAM:$alignr $mem/$memmax
Disk usage:$alignr ${fs_used /}/${fs_size /}
Uptime:$alignr $uptime

#CPU 0 usage:$alignr ${cpu cpu0}%
#CPU 1 usage:$alignr ${cpu cpu1}%
#CPU 2 usage:$alignr ${cpu cpu2}%
#CPU 3 usage:$alignr ${cpu cpu3}%
#CPU 4 usage:$alignr ${cpu cpu4}%
#CPU 5 usage:$alignr ${cpu cpu5}%
#CPU 6 usage:$alignr ${cpu cpu6}%
#CPU 7 usage:$alignr ${cpu cpu7}%

System Load:$alignr   ${loadavg}  
$cpubar
${cpugraph ffffff 000000}
Processes ${hr 1}
${top name 1}${alignr}${top cpu 1}
${top name 2}${alignr}${top cpu 2}
${top name 3}${alignr}${top cpu 3}
${top name 4}${alignr}${top cpu 4}
${top name 5}${alignr}${top cpu 5}
${top name 6}${alignr}${top cpu 6}
${top name 7}${alignr}${top cpu 7}
${top name 8}${alignr}${top cpu 8}
${top name 9}${alignr}${top cpu 9}

Ethernet wm0 ${hr 1}
Down: $color${downspeed wm0} - ${alignr}Up: ${upspeed wm0} -
${downspeedgraph wm0 25,120 CCCCCC 0000FF} ${alignr}${upspeedgraph wm0 25,120 000000 00ff00} $color
Total: ${totaldown wm0} ${alignr}Total: ${totalup wm0}

]]

Stack trace

(gdb) run -c ~/.conkyrc
Starting program: /home/sheldoni/Downloads/conky-main/build/src/conky -c ~/.conkyrc
[New process 4686]
conky: desktop window (0x1200028) is subwindow of root window (0x111)
conky: window type - normal
conky: drawing to created window (0x2e00002)
conky: drawing to double buffer
conky: forked to background, pid is 3590
[Inferior 1 (process 4686) exited normally]
(gdb) 
conky: FOUND: console
conky: FOUND: ncurses
conky: FOUND: file
conky: FOUND: x11
conky: cannot kvm_openfiles: /dev/mem: Permission denied
conky: maybe you need to setgid kmem this program?

and the previous two lines repeat

Relevant log output

No response

@epsheldoni epsheldoni added bug related to incorrect existing implementation of some functionality triage issue that hasn't been verified, categorized or acknowledged yet labels Dec 1, 2024
@Caellian Caellian added the os: netbsd related to NetBSD label Dec 3, 2024
g0mb4 added a commit to g0mb4/conky that referenced this issue Dec 5, 2024
Report the correct number of CPUs and calculate the per-CPU load.

Start implementing a common BSD interface, as all BSD implementations use
*slightly* different functions to achieve the same goal,
and maintaining them in one place would be easier.

Fixes brndnmtthws#2097.
@g0mb4 g0mb4 closed this as completed in e9f343f Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug related to incorrect existing implementation of some functionality os: netbsd related to NetBSD triage issue that hasn't been verified, categorized or acknowledged yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants