Slack sous Ubuntu : CPU & RAM max par moment

Visiblement il y a un bug … Slack essaye d’avoir accès a un fichier de logs, dont il n’a plus accès. Il tourne donc en boucle et par la même occasion il sature de logs syslog.

Misère.

Dans syslog en boucle:

Sep 23 07:47:19 XXXXXX kernel: [1541572.057366] audit: type=1400 audit(1663912039.268:1467395959):
apparmor="DENIED" operation="rename_src" profile="snap.slack.slack"
name="/home/XXXXX/snap/slack/64/.config/Slack/logs/default/webapp-console1.log"
pid=18282 comm="slack" requested_mask="wd" denied_mask="wd" fsuid=1000
ouid=1000

Quand je regarde la fin du fichier sur Slack :

tail -f /home/XXXXX/snap/slack/64/.config/Slack/logs/default/webapp-console1.log
[09/05/22, 11:39:35:001] info: [CHECK-UNREADS] (TJ5HTNKGB) Checking unreads after unread line became visible
[09/05/22, 11:39:35:001] info: [CHECK-UNREADS] (TJ5HTNKGB) Not marking C020NGCFJ7R because last_read >= latest && channel is read
[09/05/22, 11:39:37:301] info: Breadcrumb: ui.click: div.c-message__reply_bar_description > span.c-message__reply_bar_view_thread
[09/05/22, 11:39:37:320] info: [ROUTES] [ROUTE_FLEX_THREAD] navigateToRoute called with reason workspace-store/setSecondaryView
[09/05/22, 11:39:37:320] info: [ROUTES] [ROUTE_FLEX_THREAD] Attempting to navigate to new route {"teamId":"TJ5HTNKGB","entityId":"C020NGCFJ7R","memberId":"UKJ6492EP","threadId":"C020NGCFJ7R-1662365958.376179"}
[09/05/22, 11:39:37:320] info: [ROUTES] [ROUTE_FLEX_THREAD] About to run notifyRouteWillNavigateListeners to determine shouldNavigate
[09/05/22, 11:39:37:320] info: [ROUTES] [ROUTE_FLEX_THREAD] notifyRouteWillNavigateListeners finished, shouldNavigate is true
[09/05/22, 11:39:37:322] info: [HISTORY-NAVIGATION] Adding route to the history stack
[09/05/22, 11:39:37:322] info: [ROUTES] [ROUTE_FLEX_THREAD] Navigated to new route
[09/05/22, 11:39:37:340] info: [API-Q] (TJ5HTNKGB) e5b6d985-1662370777.339 conversations.replies called with reason: history-api/fetchReplies

Ubuntu 22.04.1 : GCC 11 ( -fcommon ) : Issue … Multiple definition of.

Avec GCC 11 on a changer la valeur par défaut.

Donc pour supprimer les problèmes (de facon rapide) il suffit d’ajouter la directive -fcommon. La solution idéale est de revoir le code … et surtout les .h.

Misère.

Pour information Ubuntu 22.04.1 utilise gcc 11.2.0-19 .

La doc : https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html

-fcommon

In C code, this option controls the placement of global variables defined without an initializer, known as tentative definitions in the C standard. Tentative definitions are distinct from declarations of a variable with the extern keyword, which do not allocate storage.

The default is -fno-common, which specifies that the compiler places uninitialized global variables in the BSS section of the object file. This inhibits the merging of tentative definitions by the linker so you get a multiple-definition error if the same variable is accidentally defined in more than one compilation unit.

The -fcommon places uninitialized global variables in a common block. This allows the linker to resolve all tentative definitions of the same variable in different compilation units to the same object, or to a non-tentative definition. This behavior is inconsistent with C++, and on many targets implies a speed and code size penalty on global variable references. It is mainly useful to enable legacy code to link without errors.

Quels sont les langages de programmation les plus verts ? (Dr. Milan Milanović)

𝗖 𝗶𝘀 𝘁𝗵𝗲 𝗺𝗼𝘀𝘁 𝗲𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗶𝗻𝗴 𝗹𝗮𝗻𝗴𝘂𝗮𝗴𝗲, 𝘄𝗵𝗶𝗹𝗲 𝗣𝘆𝘁𝗵𝗼𝗻 𝗮𝗻𝗱 𝗣𝗲𝗿𝗹 𝗮𝗿𝗲 𝘁𝗵𝗲 𝗹𝗲𝗮𝘀𝘁 𝗲𝗻𝘃𝗶𝗿𝗼𝗻𝗺𝗲𝗻𝘁𝗮𝗹 𝗳𝗿𝗶𝗲𝗻𝗱𝗹𝘆 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗶𝗻𝗴 𝗹𝗮𝗻𝗴𝘂𝗮𝗴𝗲

Artcile complet : https://medium.com/codex/what-are-the-greenest-programming-languages-e738774b1957

Voici pourquoi linux est plus facile à débugger :

Galerie

Cette galerie contient 1 photo.

Mes preférés : lsof, strace, netstat, tcpdump, top.