graylog-labs / syslog4j-graylog2

The syslog4j fork from Graylog2. This is used since 0.10.0. The original code was very "special" and no actions were taken to improve it. This is planned to be replaced completely in future versions.
GNU Lesser General Public License v2.1
32 stars 40 forks source link

Messed up message ident while using UnixSyslog #21

Closed admirito closed 7 years ago

admirito commented 7 years ago

While using UnixSyslog implementation of SyslogIF, after some time, syslog message ident will become corrupted. Fortunately, I was able to reproduce the problem on my system (ubuntu 16.04, default-jdk). The message ident usually become corrupted after some memory allocation:

syslog = Syslog.getInstance(SyslogConstants.UNIX_SYSLOG);
SyslogConfigIF config = (UnixSyslogConfig) syslog.getConfig();
config.setIdent("prog_name");        
syslog.error("here, syslog message ident is correct");
// some random memory alloction
String a = new String();
for (int i = 0; i < 100000; i++) {
    a += "a";
}
syslog.error("here, syslog message ident is corrupted");