[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-edac
Subject:    rasdaemon: setup_report_socket() leaks file descriptors
From:       hiroya ito <hiroyan () gmail ! com>
Date:       2017-10-23 6:44:05
Message-ID: CAHQkfaq_9GC6mheEnmvNkBMGQY4MvzPnSJAdR7JJHTg2SSCtGw () mail ! gmail ! com
[Download RAW message or body]

Hi,

I noticed that rasdaemon's setup_report_socket() leaks file
descriptors in the follwing situation

1) socket(2) + AF_UNIX success
2) connect(2) to "/var/run/abrt/abrt.socket" fails (e.g. abrtd not running )

If rasdaemon continues leaking descriptors, it will reach the
RLIMIT_NOFILE and fail to open(2) sqlite DB, errno 14 = ENFILE, like
below

  rasdaemon: Failed to do mce_record step on sqlite: error = 14
  rasdaemon: Failed reset mce_record on sqlite: error = 14

steps to reproduce:

1) build and run radaemon with --enable-abrt-report

  # ./configure --enable-abrt-report --enable-mce --enable-sqlite3
# make
# make install
  # rasdaemon -f -r

2) mce-inject

# mce-inject test/corrected

3) check file descriptors
# lsof -p $(pgrep rasdaemon)

I have tested with rasdaemon-0.6.0.

Regards,
hiroya
--
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic