Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash while parsing syslog for netfilter logs #189

Closed
fukawi2 opened this issue May 2, 2023 · 4 comments · Fixed by #191
Closed

Crash while parsing syslog for netfilter logs #189

fukawi2 opened this issue May 2, 2023 · 4 comments · Fixed by #191

Comments

@fukawi2
Copy link

fukawi2 commented May 2, 2023

I got the attached crash while trying to parse netfilter (iptables) logs from /var/log/syslog. Full command and output below.

Crash report (renamed to .txt. because GitHub won't permit .toml files as attachments): report-79c5d249-00d8-4ad4-bfbe-29b534be5307.txt

Input file was slightly less than 310,076,892 lines (counted immediately after the crash while typing this Issue).

$ ./agrind -f /var/log/syslog --output json 'kernel:* | parse "* * kernel: [*] * IN=* OUT=* SRC=* DST=* LEN=* TOS=* PREC=* TTL=* ID=* PROTO=* SPT=* DPT=* WINDOW=* RES=* * URGP=*" as timestamp, hostname, x, tag, ifIn, ifOut, src, dst, len, tos, prec, ttl, id, protocol, sport, dport, window, res, flags, urgp | count'
Well, this is embarrassing.

ag had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-a8b8a71c-bdb4-484a-a0ee-7be663a3a952.toml". Submit an issue or email with the subject of "ag Crash Report" and include the report as an attachment.

- Authors: Russell Cohen <russell.r.cohen@gmail.com>

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
278
@fukawi2
Copy link
Author

fukawi2 commented May 2, 2023

FWIW, I get the same crash if I cat /var/log/syslog | ./agrind .... instead of making ag read it using -f argument.

Using grep kernel: /var/log/syslog | ./agrind '* | parse .... does NOT crash. I'm guessing some kind of weird character in one of the log lines that ag isn't handling nicely. Hopefully the crash report has enough info for you to work it out - I don't really want to dig through 310mm log lines to find it 😂

(For my own reference if I do need to refer to the archived log file: /var/log/syslog-20230502-1683025201.gz)

rcoh added a commit that referenced this issue May 19, 2023
Gracefully handle binary input with from_utf8_lossy.

Fixes #189
@rcoh
Copy link
Owner

rcoh commented May 19, 2023

thanks for the report! will release a version with the fix today

rcoh added a commit that referenced this issue May 19, 2023
Gracefully handle binary input with from_utf8_lossy.

Fixes #189
@rcoh rcoh closed this as completed in #191 May 19, 2023
rcoh added a commit that referenced this issue May 19, 2023
Gracefully handle binary input with from_utf8_lossy.

Fixes #189
@rcoh
Copy link
Owner

rcoh commented May 19, 2023

releaesed #v0.19.1

@fukawi2
Copy link
Author

fukawi2 commented May 22, 2023

Thanks! :) 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants