Bug 1215399

Summary: logtail segfaults if it doesn't have permissions to write the *.offset file
Product: [openSUSE] openSUSE Tumbleweed Reporter: Christian Boltz <suse-beta>
Component: OtherAssignee: Peter Nixon <nix>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: lars.vogdt, ncutler
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Christian Boltz 2023-09-15 19:52:55 UTC
I get lots of logtail segfaults reported in /var/log/messages:

Sep 15 21:00:03 da4 kernel: logtail[26615]: segfault at 0 ip 00007f0d0439d144 sp 00007ffc00eea5e0 error 4 in libc-2.31.so[7f0d04318000+1e8000]
Sep 15 21:00:03 da4 kernel: Code: 84 00 00 00 00 00 e8 b9 c3 00 00 e9 09 ff ff ff e8 af 45 0a 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 41 54 55 53 <8b> 07 48 89 fb f6 c4 20 0f 85 e6 00 00 00 89 c2 81 e2 00 80 00 00
Sep 15 21:00:03 da4 kernel: logtail[26618]: segfault at 0 ip 00007fde45fda144 sp 00007ffcfb94b450 error 4 in libc-2.31.so[7fde45f55000+1e8000]
Sep 15 21:00:03 da4 kernel: Code: 84 00 00 00 00 00 e8 b9 c3 00 00 e9 09 ff ff ff e8 af 45 0a 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 41 54 55 53 <8b> 07 48 89 fb f6 c4 20 0f 85 e6 00 00 00 89 c2 81 e2 00 80 00 00

The "segfault" line slightly differs every time, the "Code:" line is always exactly the same.

The issue seems to be triggered by munin which calls
    logtail /etc/hosts
but runs as user "munin" and therefore doesn't have permissions to write /etc/hosts.offset


Reproducer: run   logtail /etc/hosts   as non-root:

# logtail /etc/hosts
[... content of /etc/hosts ...]
File /etc/hosts.offset cannot be created. Check your permissions.
Segmentation fault (core dumped)


I'll open a separate bug for munin (which should specify a writeable path for the *.offset file) - but please the logtail segfault nevertheless ;-)
Comment 1 Chenzi Cao 2023-10-12 10:09:58 UTC
The package comes from Packagehub, I assign it to packagehub team to take a look at it, thanks.
Comment 2 Christian Boltz 2023-10-12 11:24:11 UTC
Thanks, but - can you please make it public again, instead of restricting it to "novellonly"?
Comment 3 Nathan Cutler 2024-03-26 18:12:00 UTC
I can reproduce the bug using the latest logtail in openSUSE:Factory

Moving the bug there and resetting to default assignee.
Comment 4 Nathan Cutler 2024-03-26 18:14:10 UTC
@Peter, @Lars: Any ideas what to do about this segfault?