Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#60588 - VnStat stopped accepting combined interfaces and segfaults with --oneline option

Attached to Project: Community Packages
Opened by Alessandro (vegburger) - Thursday, 25 October 2018, 21:17 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 04 November 2018, 15:59 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
VnStat stopped accepting combined interfaces and segfaults with --oneline option

Additional info:
* vnstat 2.0-1


Steps to reproduce:

# vnstat -i enp8s0 --oneline 1;enp8s0;25/10/18;0 B;0 B;0 B;0.00 bit/s;Oct '18;0 B;0 B;0 B;0.00 bit/s;907.76 GiB;633.65 GiB;1.51 TiB

# vnstat -i wlp9s0 --oneline 1;wlp9s0;25/10/18;2.02 GiB;109.21 MiB;2.13 GiB;236.55 kbit/s;Oct '18;16.24 GiB;2.50 GiB;18.75 GiB;74.99 kbit/s;26.93 GiB;3.20 GiB;30.12 GiB

Yet:

# vnstat -i wlp9s0+enp8s0 --oneline
Nothing to do. Use --help for help.

# vnstat --oneline
Segmentation fault
This task depends upon

Closed by  Doug Newgard (Scimmia)
Sunday, 04 November 2018, 15:59 GMT
Reason for closing:  Not a bug
Comment by Teemu Toivola (Vergo) - Friday, 26 October 2018, 15:08 GMT
vnStat 2.0 dropped the support for interface data merging (that + syntax, full list of changes at https://humdi.net/vnstat/CHANGES). That's why it no longer works. However, that "Nothing to do" message could use some improvement and the segmentation fault suggests there may also be some real issue.

Could you attach the output of 'vnstat -D --oneline'? It's possible the debug output will give a better idea of what's going wrong, assuming it manages to output something before the segmentation fault.
Comment by Alessandro (vegburger) - Friday, 26 October 2018, 16:18 GMT
Right. I would recommend then also updating the man page to reflect the change.

Here's the output:

# vnstat -D --oneline

Debug enabled, vnstat 2.0
Config file: /etc/vnstat.conf
c: Interface "wlo1"
-> "Interface": "wlo1"
c: DatabaseDir "/var/lib/vnstat"
-> "DatabaseDir": "/var/lib/vnstat"
c: Locale "-"
-> "Locale": "-"
i: MonthRotate 1
-> "MonthRotate": 1
c: DayFormat "%x"
-> "DayFormat": "%x"
c: MonthFormat "%b '%y"
-> "MonthFormat": "%b '%y"
c: TopFormat "%x"
-> "TopFormat": "%x"
c: RXCharacter "%"
-> "RXCharacter": "%"
c: TXCharacter ":"
-> "TXCharacter": ":"
c: RXHourCharacter "r"
-> "RXHourCharacter": "r"
c: TXHourCharacter "t"
-> "TXHourCharacter": "t"
i: UnitMode 0
-> "UnitMode": 0
i: OutputStyle 3
-> "OutputStyle": 3
i: RateUnit 1
-> "RateUnit": 1
i: BandwidthDetection 1
-> "BandwidthDetection": 1
i: MaxBandwidth 1000
-> "MaxBandwidth": 1000
i: Sampletime 5
-> "Sampletime": 5
i: QueryMode 0
-> "QueryMode": 0
i: CheckDiskSpace 1
-> "CheckDiskSpace": 1
Unknown configuration line: UseFileLocking 1
i: BootVariation 15
-> "BootVariation": 15
Unknown configuration line: TrafficlessDays 1
c: DaemonUser ""
-> "DaemonUser" with no value, keeping default.
c: DaemonGroup ""
-> "DaemonGroup" with no value, keeping default.
i: UpdateInterval 30
-> "UpdateInterval": 30
i: PollInterval 5
-> "PollInterval": 5
i: SaveInterval 5
-> "SaveInterval": 5
i: OfflineSaveInterval 30
-> "OfflineSaveInterval": 30
i: BandwidthDetectionInterval 5
-> "BandwidthDetectionInterval": 5
i: SaveOnStatusChange 1
-> "SaveOnStatusChange": 1
i: UseLogging 2
-> "UseLogging": 2
i: CreateDirs 1
-> "CreateDirs": 1
i: UpdateFileOwner 1
-> "UpdateFileOwner": 1
c: LogFile "/var/log/vnstat/vnstat.log"
-> "LogFile": "/var/log/vnstat/vnstat.log"
c: PidFile "/var/run/vnstat/vnstat.pid"
-> "PidFile": "/var/run/vnstat/vnstat.pid"
c: HeaderFormat "%x %H:%M"
-> "HeaderFormat": "%x %H:%M"
i: HourlyRate 1
-> "HourlyRate": 1
i: SummaryRate 1
-> "SummaryRate": 1
Unknown configuration line: SummaryLayout 1
i: TransparentBg 0
-> "TransparentBg": 0
c: CBackground "FFFFFF"
-> "CBackground": "FFFFFF"
c: CEdge "AEAEAE"
-> "CEdge": "AEAEAE"
c: CHeader "606060"
-> "CHeader": "606060"
c: CHeaderTitle "FFFFFF"
-> "CHeaderTitle": "FFFFFF"
c: CHeaderDate "FFFFFF"
-> "CHeaderDate": "FFFFFF"
c: CText "000000"
-> "CText": "000000"
c: CLine "B0B0B0"
-> "CLine": "B0B0B0"
c: CLineL "-"
-> "CLineL": "-"
c: CRx "92CF00"
-> "CRx": "92CF00"
c: CTx "606060"
-> "CTx": "606060"
c: CRxD "-"
-> "CRxD": "-"
c: CTxD "-"
-> "CTxD": "-"
Config file: /etc/vnstat.conf
ibw: 1: i"ethnone" l8 f8 r0 d0
arg 1: "-D"
arg 2: "--oneline"
Dir OK
Database "/var/lib/vnstat/vnstat.db" open
Database version "1", current version "1"
3 interface(s) found
Segmentation fault
Comment by Teemu Toivola (Vergo) - Friday, 26 October 2018, 18:14 GMT
Thanks, looks like one mention of the data merging feature was missed during cleanup.

Sadly that output doesn't provide any good hints of what's going wrong other that the existence of the third interface "wlo1" which has been set as default. Do any other outputs (-5, -h, -d, -m, -y) work for that interface or is this problem specific to the --oneline output?
Comment by Alessandro (vegburger) - Friday, 26 October 2018, 19:00 GMT
The two interfaces of my laptop are called enp8s0 (ethernet) and wlp9s0 (wifi), plus loopback -- so I don't really know where wlo1 comes from.

# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp8s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
link/ether 48:0f:cf:dd:05:11 brd ff:ff:ff:ff:ff:ff
3: wlp9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
link/ether b0:10:41:0b:5d:55 brd ff:ff:ff:ff:ff:ff

The options -5, -h, -d, -y all return "no data available"

The option -m returns a table with all entries 0

The problem seems specific to the --oneline option.
Comment by Alessandro (vegburger) - Saturday, 27 October 2018, 09:53 GMT
I've modified the /etc/vnstat.conf file and assigned a sensible value as a default interface. It stopped segfaulting.
Comment by Teemu Toivola (Vergo) - Saturday, 27 October 2018, 11:19 GMT
The problem is most likely related to the database content for the 'wlo1' interface, or more exactly the lack of it. The testset has tests for all outputs with and without data and neither triggers the segementation fault so this is most likely some in between scenario as the --oneline implementation has different content checks than the other outputs.

I'm guessing that you'll still see the 'wlo1' interface with no data if you execute 'vnstat' without any parameters as it should show all the three interfaces you database currently has. You can --remove the 'wlo1' interface if it's something your laptop currently doesn't see or you don't want to see it via vnStat.

Loading...