When I was testing #366, I triggered something by reloading the config 3rd or 4th time.
conky: '/home/chris/conky/write_to_file.conf' modified, reloading...
munmap_chunk(): invalid pointer
Thread 1 "conky" received signal SIGABRT, Aborted.
0x00007ffff5c04b5f in raise () from /usr/lib/libc.so.6
(gdb) bt full
#0 0x00007ffff5c04b5f in raise () from /usr/lib/libc.so.6
No symbol table info available.
#1 0x00007ffff5bef452 in abort () from /usr/lib/libc.so.6
No symbol table info available.
#2 0x00007ffff5c47658 in __libc_message () from /usr/lib/libc.so.6
No symbol table info available.
#3 0x00007ffff5c4df6a in malloc_printerr () from /usr/lib/libc.so.6
No symbol table info available.
#4 0x00007ffff5c4e4c4 in munmap_chunk () from /usr/lib/libc.so.6
No symbol table info available.
#5 0x00007ffff6941332 in ?? () from /usr/lib/liblua.so.5.3
No symbol table info available.
#6 0x00007ffff6936531 in ?? () from /usr/lib/liblua.so.5.3
No symbol table info available.
#7 0x00007ffff693426e in ?? () from /usr/lib/liblua.so.5.3
No symbol table info available.
#8 0x00007ffff6934bd1 in ?? () from /usr/lib/liblua.so.5.3
No symbol table info available.
#9 0x00007ffff693ac0e in ?? () from /usr/lib/liblua.so.5.3
No symbol table info available.
#10 0x0000555555575705 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5555556424d0)
at /usr/include/c++/8.2.0/ext/atomicity.h:69
this = 0x5555556424d0
#11 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x55555566af20,
__in_chrg=<optimized out>) at /usr/include/c++/8.2.0/bits/shared_ptr_base.h:706
No locals.
#12 std::__shared_ptr<lua_State, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x55555566af18,
__in_chrg=<optimized out>) at /usr/include/c++/8.2.0/bits/shared_ptr_base.h:1145
No locals.
#13 std::shared_ptr<lua_State>::~shared_ptr (this=0x55555566af18, __in_chrg=<optimized out>)
at /usr/include/c++/8.2.0/bits/shared_ptr.h:103
No locals.
---Type <return> to continue, or q <return> to quit---
#14 lua::state::~state (this=0x55555566aef0, __in_chrg=<optimized out>) at /home/chris/src/conky/src/luamm.hh:143
No locals.
#15 std::default_delete<lua::state>::operator() (this=0x5555555fa220 <state>, __ptr=0x55555566aef0) at /usr/include/c++/8.2.0/bits/unique_ptr.h:81
No locals.
#16 std::unique_ptr<lua::state, std::default_delete<lua::state> >::reset (__p=0x55555566aef0, this=0x5555555fa220 <state>) at /usr/include/c++/8.2.0/bits/unique_ptr.h:382
No locals.
#17 clean_up_without_threads (memtofree1=<optimized out>, memtofree2=<optimized out>) at /home/chris/src/conky/src/conky.cc:2610
No locals.
#18 0x0000555555579962 in clean_up (memtofree2=0x0, memtofree1=0x0) at /home/chris/src/conky/src/conky.cc:2615
No locals.
#19 reload_config() () at /home/chris/src/conky/src/conky.cc:2535
sb = <optimized out>
sb = {st_dev = 65025, st_ino = 2757715, st_nlink = 1, st_mode = 33188, st_uid = 1000, st_gid = 985, __pad0 = 0, st_rdev = 0, st_size = 179, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 1534205503, tv_nsec = 939913841}, st_mtim = {tv_sec = 1534205503, tv_nsec = 939913841}, st_ctim = {
tv_sec = 1534205503, tv_nsec = 939913841}, __glibc_reserved = {0, 0, 0}}
#20 0x000055555557a693 in main_loop () at /home/chris/src/conky/src/conky.cc:2488
ev = 0x7fffffffdc00
len = 16
idx = 0
descriptors = {fds_bits = {8, 0 <repeats 15 times>}}
time_to_wait = {tv_sec = 0, tv_usec = 0}
terminate = 0
t = <optimized out>
inotify_config_wd = 6
inotify_buff = "\006\000\000\000\000\200", '\000' <repeats 11 times>, "\356aUUU\000\000\270*fUUU", '\000' <repeats 26 times>, "\003\000\000\000\000\000\000\000\360\335\377\377\377\177\000\000\344趻\366\377\177\000\000\360\060fUUU\000\000\000\000\000\000UU\000\000\340\334\377\377\377\177\000\000\000\037{\372%\001k褷\356aUUU\000\000\220\334\377\377\377\177\000\000\000\000\000\000\000\000\000\000[qZUUU", '\000' <repeats 11 times>, "\037{\372%\001k\321h@]UUU\000\000\320\334\377\377\377\177\000\000h@]UUU\000\000\340n_UUU\000\000\330\337\377\377\377\177\000\000o\200"...
#21 0x000055555556ad5f in main () at /home/chris/src/conky/src/conky.cc:3161
curl_global = <optimized out>
#22 0x00007ffff5bf1003 in __libc_start_main () from /usr/lib/libc.so.6
No symbol table info available.
#23 0x000055555556f90e in _start () at /home/chris/src/conky/src/conky.cc:3211
No symbol table info available.
(gdb)
Good news - I have no such issues - just reloaded all conky configs - 4 of them - 7 to 8 times - not a squeak.
I have been using conky with lua 5.3 since mid 2016... I also noticed that there are refs to liblua.so.5.3 - if you are using tolua++ for 5.1 - then there should'nt be a call to this file.
To get conky and lua 5.3 integration is dead simple - just small change in conky to use lua 5.3 or higher and the main juice is the patch to tolua++ for 5.1 Arch Linux tolua++_5.3 at AUR
I use the lua_startup_hook in nearly all configs as there has been a slight lag in startup of lua since 1.10.x . On startup lua changes the update_interval to 0.1 for 3 counts and then resets this variable to it's original value. So I present conky on steroids ...
I have tolua++ installed.
local/tolua++ 1.0.93-3
Tool to integrate C/C++ code with Lua
Second (different) backtrace doing the same thing. I didn't change a thing.
conky: '/home/chris/conky/write_to_file.conf' modified, reloading...
Thread 1 "conky" received signal SIGSEGV, Segmentation fault.
0x00007ffff693b359 in ?? () from /usr/lib/liblua.so.5.3
(gdb) bt full
#0 0x00007ffff693b359 in ?? () from /usr/lib/liblua.so.5.3
No symbol table info available.
#1 0x00007ffff692cec5 in lua_pushlstring () from /usr/lib/liblua.so.5.3
No symbol table info available.
#2 0x00005555555a6027 in lua::state::pushstring (s="own_window_title", this=0x55555566af40)
at /usr/include/c++/8.2.0/bits/basic_string.h:2281
No locals.
#3 conky::set_config_settings(lua::state&) () at /home/chris/src/conky/src/setting.cc:222
i = 0x555555620b00 <own_window_title[abi:cxx11]>
__for_range = std::vector of length 111, capacity 111 = {0x5555555fa1c0 <no_buffers>,
0x5555555fb200 <disable_auto_reload>, 0x5555555fb120 <use_spacer>, 0x5555555fb0e0 <short_units>,
0x5555555fb0a0 <format_human_readable>, 0x5555555fb060 <out_to_stdout>, 0x5555555fb020 <out_to_stderr>,
0x5555555fafe0 <extra_newline>, 0x5555555fa960 <update_interval>,
0x5555555fa900 <update_interval_on_battery>, 0x5555555fa8a0 <detect_battery[abi:cxx11]>,
0x5555555fa860 <music_player_interval>, 0x5555555faf80 <max_text_width>,
0x5555555faf20 <stuff_in_uppercase>, 0x5555555faec0 <total_run_times>,
0x5555555fae80 <fork_to_background>, 0x5555555fa3c0 <cpu_avg_samples>, 0x5555555fa380 <net_avg_samples>,
0x5555555fa340 <diskio_avg_samples>, 0x5555555fae20 <overwrite_file>, 0x5555555fadc0 <append_file>,
0x5555555fad80 <show_graph_scale>, 0x5555555fad40 <show_graph_range>, 0x5555555fad00 <gap_x>,
0x5555555facc0 <gap_y>, 0x5555555fac80 <draw_borders>, 0x5555555fac40 <draw_graph_borders>,
0x5555555fa300 <stippled_borders>, 0x5555555fac00 <draw_shades>, 0x5555555fabc0 <draw_outline>,
0x5555555fab60 <minimum_height>, 0x5555555fab20 <minimum_width>, 0x5555555faae0 <maximum_width>,
0x5555555fa2c0 <utf8_mode>, 0x5555555fa280 <max_user_text>, 0x5555555fa240 <text_buffer_size>,
0x5555555faaa0 <pad_percents>, 0x555555604d20 <current_mail_spool>,
0x555555604de0 <(anonymous namespace)::imap>, 0x555555604d80 <(anonymous namespace)::pop3>,
0x55555561d480 <if_up_strictness>, 0x55555561d540 <(anonymous namespace)::_template>,
0x55555561d598 <(anonymous namespace)::_template+88>,
0x55555561d5f0 <(anonymous namespace)::_template+176>,
0x55555561d648 <(anonymous namespace)::_template+264>,
0x55555561d6a0 <(anonymous namespace)::_template+352>,
0x55555561d6f8 <(anonymous namespace)::_template+440>,
0x55555561d750 <(anonymous namespace)::_template+528>,
---Type <return> to continue, or q <return> to quit---
>, 0x55555561d800 <(anonymous namespace)::_template+704>, 0x55555561d858 <(anonymous namespace)::_template+792>, 0x55555561dbc0 <(anonymous namespace)::default_bar_width>,
0x55555561db80 <(anonymous namespace)::default_bar_height>, 0x55555561db40 <(anonymous namespace)::default_graph_width>, 0x55555561db00 <(anonymous namespace)::default_graph_height>,
0x55555561dac0 <(anonymous namespace)::default_gauge_width>, 0x55555561da80 <(anonymous namespace)::default_gauge_height>, 0x55555561da20 <(anonymous namespace)::console_graph_ticks>, 0x55555561dc20 <output_unit>,
0x55555561dcc0 <times_in_seconds>, 0x55555561dd60 <top_name_width>, 0x55555561dd20 <top_name_verbose>, 0x55555561ee20 <conky::asdf>, 0x55555561f060 <(anonymous namespace)::lua_load>,
0x55555561f000 <(anonymous namespace)::lua_startup_hook>, 0x55555561efa0 <(anonymous namespace)::lua_shutdown_hook>, 0x55555561ef40 <(anonymous namespace)::lua_draw_hook_pre>,
0x55555561eee0 <(anonymous namespace)::lua_draw_hook_post>, 0x5555556206c0 <top_cpu_separate>, 0x555555620840 <(anonymous namespace)::mpd_port>, 0x5555556207e0 <(anonymous namespace)::mpd_host>,
0x555555620780 <(anonymous namespace)::mpd_password>, 0x555555620880 <max_port_monitor_connections>, 0x5555556210e0 <text_alignment>, 0x555555621080 <display_name[abi:cxx11]>, 0x5555556211e0 <head_index>,
0x555555621040 <out_to_x>, 0x555555620dc0 <color>, 0x555555620e00 <color+64>, 0x555555620e40 <color+128>, 0x555555620e80 <color+192>, 0x555555620ec0 <color+256>, 0x555555620f00 <color+320>, 0x555555620f40 <color+384>,
0x555555620f80 <color+448>, 0x555555620fc0 <color+512>, 0x555555621000 <color+576>, 0x555555620d80 <default_color>, 0x555555620d40 <default_shade_color>, 0x555555620d00 <default_outline_color>,
0x555555620cc0 <border_inner_margin>, 0x555555620c80 <border_outer_margin>, 0x555555620c40 <border_width>, 0x555555620c00 <use_xft>, 0x555555620bc0 <set_transparent>, 0x555555620b60 <own_window_class[abi:cxx11]>,
0x555555620b00 <own_window_title[abi:cxx11]>, 0x555555620ac0 <own_window_type>, 0x555555620a80 <own_window_hints>, 0x555555620a40 <background_colour>, 0x555555620a00 <use_argb_visual>, 0x5555556209c0 <own_window_argb_value>,
0x555555620980 <own_window>, 0x555555620940 <use_xdbe>, 0x5555556208e0 <imlib_cache_size>, 0x555555621700 <font>, 0x555555621780 <(anonymous namespace)::xftalpha>, 0x555555621860 <hddtemp_host>, 0x555555621800 <hddtemp_port>,
0x555555624320 <(anonymous namespace)::imlib_cache_flush_interval>, 0x555555624540 <out_to_ncurses>}
__for_begin = <optimized out>
__for_end = <optimized out>
v = std::vector of length 111, capacity 111 = {0x5555555fa1c0 <no_buffers>, 0x5555555fb200 <disable_auto_reload>, 0x5555555fb120 <use_spacer>, 0x5555555fb0e0 <short_units>, 0x5555555fb0a0 <format_human_readable>,
0x5555555fb060 <out_to_stdout>, 0x5555555fb020 <out_to_stderr>, 0x5555555fafe0 <extra_newline>, 0x5555555fa960 <update_interval>, 0x5555555fa900 <update_interval_on_battery>, 0x5555555fa8a0 <detect_battery[abi:cxx11]>,
0x5555555fa860 <music_player_interval>, 0x5555555faf80 <max_text_width>, 0x5555555faf20 <stuff_in_uppercase>, 0x5555555faec0 <total_run_times>, 0x5555555fae80 <fork_to_background>, 0x5555555fa3c0 <cpu_avg_samples>,
0x5555555fa380 <net_avg_samples>, 0x5555555fa340 <diskio_avg_samples>, 0x5555555fae20 <overwrite_file>, 0x5555555fadc0 <append_file>, 0x5555555fad80 <show_graph_scale>, 0x5555555fad40 <show_graph_range>, 0x5555555fad00 <gap_x>,
0x5555555facc0 <gap_y>, 0x5555555fac80 <draw_borders>, 0x5555555fac40 <draw_graph_borders>, 0x5555555fa300 <stippled_borders>, 0x5555555fac00 <draw_shades>, 0x5555555fabc0 <draw_outline>, 0x5555555fab60 <minimum_height>,
0x5555555fab20 <minimum_width>, 0x5555555faae0 <maximum_width>, 0x5555555fa2c0 <utf8_mode>, 0x5555555fa280 <max_user_text>, 0x5555555fa240 <text_buffer_size>, 0x5555555faaa0 <pad_percents>, 0x555555604d20 <current_mail_spool>,
0x555555604de0 <(anonymous namespace)::imap>, 0x555555604d80 <(anonymous namespace)::pop3>, 0x55555561d480 <if_up_strictness>, 0x55555561d540 <(anonymous namespace)::_template>,
0x55555561d598 <(anonymous namespace)::_template+88>, 0x55555561d5f0 <(anonymous namespace)::_template+176>, 0x55555561d648 <(anonymous namespace)::_template+264>, 0x55555561d6a0 <(anonymous namespace)::_template+352>,
0x55555561d6f8 <(anonymous namespace)::_template+440>, 0x55555561d750 <(anonymous namespace)::_template+528>, 0x55555561d7a8 <(anonymous namespace)::_template+616>, 0x55555561d800 <(anonymous namespace)::_template+704>,
0x55555561d858 <(anonymous namespace)::_template+792>, 0x55555561dbc0 <(anonymous namespace)::default_bar_width>, 0x55555561db80 <(anonymous namespace)::default_bar_height>,
0x55555561db40 <(anonymous namespace)::default_graph_width>, 0x55555561db00 <(anonymous namespace)::default_graph_height>, 0x55555561dac0 <(anonymous namespace)::default_gauge_width>,
0x55555561da80 <(anonymous namespace)::default_gauge_height>, 0x55555561da20 <(anonymous namespace)::console_graph_ticks>, 0x55555561dc20 <output_unit>, 0x55555561dcc0 <times_in_seconds>, 0x55555561dd60 <top_name_width>,
0x55555561dd20 <top_name_verbose>, 0x55555561ee20 <conky::asdf>, 0x55555561f060 <(anonymous namespace)::lua_load>, 0x55555561f000 <(anonymous namespace)::lua_startup_hook>,
0x55555561efa0 <(anonymous namespace)::lua_shutdown_hook>, 0x55555561ef40 <(anonymous namespace)::lua_draw_hook_pre>, 0x55555561eee0 <(anonymous namespace)::lua_draw_hook_post>, 0x5555556206c0 <top_cpu_separate>,
0x555555620840 <(anonymous namespace)::mpd_port>, 0x5555556207e0 <(anonymous namespace)::mpd_host>, 0x555555620780 <(anonymous namespace)::mpd_password>, 0x555555620880 <max_port_monitor_connections>,
0x5555556210e0 <text_alignment>, 0x555555621080 <display_name[abi:cxx11]>, 0x5555556211e0 <head_index>, 0x555555621040 <out_to_x>, 0x555555620dc0 <color>, 0x555555620e00 <color+64>, 0x555555620e40 <color+128>,
0x555555620e80 <color+192>, 0x555555620ec0 <color+256>, 0x555555620f00 <color+320>, 0x555555620f40 <color+384>, 0x555555620f80 <color+448>, 0x555555620fc0 <color+512>, 0x555555621000 <color+576>, 0x555555620d80 <default_color>,
0x555555620d40 <default_shade_color>, 0x555555620d00 <default_outline_color>, 0x555555620cc0 <border_inner_margin>, 0x555555620c80 <border_outer_margin>, 0x555555620c40 <border_width>, 0x555555620c00 <use_xft>,
0x555555620bc0 <set_transparent>, 0x555555620b60 <own_window_class[abi:cxx11]>, 0x555555620b00 <own_window_title[abi:cxx11]>, 0x555555620ac0 <own_window_type>, 0x555555620a80 <own_window_hints>,
0x555555620a40 <background_colour>, 0x555555620a00 <use_argb_visual>, 0x5555556209c0 <own_window_argb_value>, 0x555555620980 <own_window>, 0x555555620940 <use_xdbe>, 0x5555556208e0 <imlib_cache_size>, 0x555555621700 <font>,
0x555555621780 <(anonymous namespace)::xftalpha>, 0x555555621860 <hddtemp_host>, 0x555555621800 <hddtemp_port>, 0x555555624320 <(anonymous namespace)::imlib_cache_flush_interval>, 0x555555624540 <out_to_ncurses>}
s = {L = <optimized out>, n = 0}
#4 0x000055555557934c in initialisation(int, char**) () at /usr/include/c++/8.2.0/bits/unique_ptr.h:342
act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
oact = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
#5 0x00005555555799ee in reload_config() () at /home/chris/src/conky/src/conky.cc:2539
sb = <optimized out>
sb = {st_dev = 65025, st_ino = 2757715, st_nlink = 1, st_mode = 33188, st_uid = 1000, st_gid = 985, __pad0 = 0, st_rdev = 0, st_size = 176, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 1534207754, tv_nsec = 865648244},
st_mtim = {tv_sec = 1534207754, tv_nsec = 865648244}, st_ctim = {tv_sec = 1534207754, tv_nsec = 865648244}, __glibc_reserved = {0, 0, 0}}
#6 0x000055555557a693 in main_loop () at /home/chris/src/conky/src/conky.cc:2488
ev = 0x7fffffffdc10
len = 16
idx = 0
descriptors = {fds_bits = {8, 0 <repeats 15 times>}}
time_to_wait = {tv_sec = 0, tv_usec = 0}
terminate = 0
t = <optimized out>
inotify_config_wd = 4
inotify_buff = "\004\000\000\000\000\200", '\000' <repeats 11 times>, "\356aUUU\000\000\270*fUUU", '\000' <repeats 26 times>, "\003\000\000\000\000\000\000\000\000\336\377\377\377\177\000\000\344趻\366\377\177\000\000\360\060fUUU\000\000\000\000\000\000UU\000\000\360\334\377\377\377\177\000\000\000R\266\274\374\223?j\240\356aUUU\000\000\240\334\377\377\377\177\000\000\000\000\000\000\000\000\000\000[qZUUU", '\000' <repeats 11 times>, "R\266\274\374\223?jh@]UUU\000\000\340\334\377\377\377\177\000\000h@]UUU\000\000\340n_UUU\000\000\350\337\377\377\377\177\000\000o"...
#7 0x000055555556ad5f in main () at /home/chris/src/conky/src/conky.cc:3161
curl_global = <optimized out>
#8 0x00007ffff5bf1003 in __libc_start_main () from /usr/lib/libc.so.6
No symbol table info available.
#9 0x000055555556f90e in _start () at /home/chris/src/conky/src/conky.cc:3211
No symbol table info available.
(gdb)
We really should sort out the Lua-related issues. Not wanting to reference, but... #116, #263, and maybe this too. @brndnmtthws Can you look into patching and/or upgrading Lua support to 5.3 ?
@plikhari Actually, maybe it's better if you can put together a branch / PR since you are already familiar with Lua stuffs as well as Conky stuffs. If you can do that, then we can test it. Hopefully it'd solve this particular issue too. We leave it to the Owner to merge it. Just an idea.
EDIT: Not sure if I make any sense here because of tolua++ 5.3.
That is a great idea...
If you look at the tolua and tolua++ in particular - it has not been updated for a many years like since 2009 perhaps - we should bring that as part of conky - apply the patch and let it be compiled and installed with conky.
for change in conky
sed -i 's|-Werror||' cmake/ConkyBuildOptions.cmake
sed -i \
-e 's|\(LUA REQUIRED\) lua5.1 lua-5.1 lua51 lua|\1 lua>=5.3|' \
-e 's|\(NOT LUA_VERSION VERSION_LESS\) 5.2.0|\1 5.4.0|' \
cmake/ConkyPlatformChecks.cmake
for tolua++ we have a patch tolua53.patch
I do not see any new versions coming for tolua happening.
We've got a few options here:
Thoughts?
I picked hands off approach 1 because forking 2 could mean focusing less on conky since other projects may be using it too or will start to... and 3 mean supporting something stale... What if you want to deprecate tolua++ one day?
We might have other things to deprecate too... like audacious and possibly nvidia since it does not work correctly anymore due to split drivers. Out with the old, in with the new... such as mpris variables.
We have a working patch for tolua++. Distros can use that to make tolua++ (5.3).
@lasers the main problem with relying on distros to patch it is that we have no guarantee that each distro will patch it the same way, or that they will patch it at all. You could (hypothetically) have different ABIs between different distros. That sounds like a mess to me.
Well - it is the way lua integrates with C++ - that is how it is embedded in conky.
I would go with option 3 - you have control over tolua and it is integrated within conky.
A case in point is VLC - they were using tolua++ for 5.1 and now have tolua++ integrated for 5.3
Yes depending on distros - is unreliable for conky to work out of the box - and the performance gain is worth it
I do not even have lua 5.1 or 5.2 installed on my system
For the record, I agree option 3 is the way to go.
Let's leave this issue open for a little while for anyone who wants to weigh in.
Point 3 :+1:
That sounds like a mess to me.
Conky is already messy. :smile:
@brndnmtthws Proceed with 3? No need to wait for anybody else imho. Get Conky up to speed.
@lasers I'd like to wait at least a couple days to give other people a chance to speak if they have an opinion about it.
Bisected. Fixed via #707.
Most helpful comment
@lasers I'd like to wait at least a couple days to give other people a chance to speak if they have an opinion about it.