conky icon indicating copy to clipboard operation
conky copied to clipboard

journal: regression results in an invalid arg and mixed bugs

Open lasers opened this issue 6 years ago • 8 comments

I was going through @MeisterP's https://github.com/brndnmtthws/conky/issues/388 when I noticed something. I was not able to specify optional args and @MeisterP had no problem doing that with app-admin/conky-1.10.8-r1 on gentoo version.

4b92556fca9cbede3cbac4112f0a24b554390099 is the first bad commit

4b92556fca9cbede3cbac4112f0a24b554390099 is the first bad commit
commit 4b92556fca9cbede3cbac4112f0a24b554390099
Author: Brenden Matthews <[email protected]>
Date:   Sat May 12 19:26:31 2018 -0400

    Build improvements: clang-tidy, sonar, Dockerfile. (#488)

You can use this config.

conky.config = {
	own_window = true,
	own_window_type = 'desktop',
	text_buffer_size = 1000000,
}
conky.text = [[
--------------------------exec
${exec journalctl -n 5}

--------------------------sys
${journal 10 system}

--------------------------user
${journal 10 user}
]]

NOTE: ${exec journalctl -n 5} is broken somewhere between commits. ${journal 10 user} is broken somewhere between commits too. Window will resize if the line is too long on commit 4b92556f which is something @MeisterP might like, but may prefer the line to be wrapped instead. Thanks.

lasers avatar Aug 05 '18 11:08 lasers

Under Manjaro the following flags is not found, thus compilation is skipped:

https://github.com/brndnmtthws/conky/blob/0edc80bf9b7622866e752258dba66fbfa53e151a/src/journal.cc#L82

When I remove the ifdef it doesn't give me any error that SD_JOURNAL_CURRENT_USER isn't found and proceeds ahead. When I use any combination of

${journal 10 system}
${journal 10 user}

I get blank line, although according to https://manpages.debian.org/testing/libsystemd-dev/SD_JOURNAL_CURRENT_USER.3.en.html SD_JOURNAL_CURRENT_USER and SD_JOURNAL_SYSTEM are correct flags, on Manjaro they return nothing. Maybe when the journal.cc module was written they worked out, but today they do nothing.

su8 avatar Aug 14 '18 12:08 su8

When I checkout 4b92556, I get user and sys so the old code currently still work though? For unknown reasons, exec journal -n 5 printed nothing. I commented out your ifdef to bypass (on master) and got nothing too. Can you checkout that commit too?

2018-08-14-082011_695x967_scrot

lasers avatar Aug 14 '18 13:08 lasers

It consist of several changes:

---
+++
void free_journal(struct text_object *obj) {
  struct journal *j = (struct journal *)obj->data.opaque;
- obj->data.opaque = NULL;
+ obj->data.opaque = nullptr;
  delete j;
}
 @@ -113,7 +113,7 @@ static int print_field(sd_journal *jh, const char *field, char spacer,
void print_journal(struct text_object *obj, char *p, int p_max_size) {
  size_t read = 0, length;
  struct journal *j = (struct journal *)obj->data.opaque;
- sd_journal *jh = NULL;
+ sd_journal *jh = nullptr;

and doesn't include the journal.cc overflow checks committed here - https://github.com/brndnmtthws/conky/commit/4155ac253b77ff736a1fd32ef61dde15f636b16a and here https://github.com/brndnmtthws/conky/commit/fd4ab7fc074bd498cf3708cfbee60277808c20be

su8 avatar Aug 14 '18 13:08 su8

@SU8 WYD WITH THIS ISSUE?

lasers avatar Aug 31 '18 11:08 lasers

There is nothing to be done at this stage.

${journal 10 system} ${journal 10 user} I get blank line, although according to https://manpages.debian.org/testing/libsystemd-dev/SD_JOURNAL_CURRENT_USER.3.en.html SD_JOURNAL_CURRENT_USER and SD_JOURNAL_SYSTEM are correct flags, on Manjaro they return nothing. Maybe when the journal.cc module was written they worked out, but today they do nothing.

su8 avatar Aug 31 '18 13:08 su8

I'm wondering what the status of this bug is...

I compiled the latest version of conky (version 1.11.5_pre)
with the respective option (-DBUILD_JOURNAL=ON) but

${journal 10 user}

only results in the error conky: invalid arg for journal, type must be 'system' or 'user'

Is there anything that can be done about this?

GHPS avatar Aug 07 '19 18:08 GHPS

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.

github-actions[bot] avatar Sep 17 '23 01:09 github-actions[bot]

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.

Well, it's undoubtedly stale... but the issue is still there.

MeisterP avatar Sep 17 '23 06:09 MeisterP