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

Malformed log formats cause NullPointerException #336

Closed
telendt opened this issue Apr 24, 2018 · 1 comment
Closed

Malformed log formats cause NullPointerException #336

telendt opened this issue Apr 24, 2018 · 1 comment
Labels
type/bug A general bug
Milestone

Comments

@telendt
Copy link

telendt commented Apr 24, 2018

Expected behavior

Log message format should have equal number of placeholders to number of given values.

Normally this should not cause any major issues (other that "incomplete" log messages) but with combination of buggy ConsoleLogger from reactor-core (bug to be reported) it causes NullPointerExceptions.

Actual behavior

Exception in thread "main" java.lang.NullPointerException
	at reactor.util.Loggers$ConsoleLogger.format(Loggers.java:457)
	at reactor.util.Loggers$ConsoleLogger.debug(Loggers.java:497)
	at reactor.ipc.netty.ReactorNetty.removeHandler(ReactorNetty.java:172)
	at reactor.ipc.netty.NettyContext.removeHandler(NettyContext.java:270)
	at EventSource.main(EventSource.java:37)

Steps to reproduce

import io.netty.channel.local.LocalChannel;
import reactor.ipc.netty.NettyContext;
import reactor.util.Loggers;

// main
Loggers.useConsoleLoggers();
NettyContext context = LocalChannel::new;
context.removeHandler("nonexistent");  // throws NPE

Reactor Netty version

0.7.6.RELEASE (reactor-core: 3.1.6.RELEASE)

JVM version (e.g. java -version)

java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

(same thing on java 9 and 8)

OS version (e.g. uname -a)

Darwin XXX 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64

@telendt
Copy link
Author

telendt commented Apr 24, 2018

These are the malformed log formats that I found.

@smaldini: What text editor/IDE do you use? Do you think you could set it up somehow so it could help you detect such issues in the future?

@violetagg violetagg added this to the 0.7.7.RELEASE milestone Apr 25, 2018
@violetagg violetagg added the type/bug A general bug label Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants