GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — PortUnreachableExceptions thrown without detail message · Issue #6179 · netty/netty

PortUnreachableExceptions thrown without detail message #6179

New issue
Copy link
New issue
Copy link
Closed
Closed
PortUnreachableExceptions thrown without detail message#6179
Copy link
Assignees
normanmaurer

Description

@InfoSec812
InfoSec812
opened on Jan 6, 2017
Issue body actions

Expected behavior

When a PortUnreachableException is thrown, calling exception.getLocalizedMessage() should return a non-null String.

Actual behavior

PortUnreachableException has an available empty constructor which is being used by the underlying Netty library... Here's the call stack which leads to the Exception being created:

"vert.x-eventloop-thread-1@1858" prio=5 tid=0x14 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at java.net.PortUnreachableException.<init>(PortUnreachableException.java:51)
	  at sun.nio.ch.DatagramChannelImpl.receive0(DatagramChannelImpl.java:-1)
	  at sun.nio.ch.DatagramChannelImpl.receiveIntoNativeBuffer(DatagramChannelImpl.java:414)
	  at sun.nio.ch.DatagramChannelImpl.receive(DatagramChannelImpl.java:392)
	  at sun.nio.ch.DatagramChannelImpl.receive(DatagramChannelImpl.java:345)
	  - locked <0x868> (a java.lang.Object)
	  at io.netty.channel.socket.nio.NioDatagramChannel.doReadMessages(NioDatagramChannel.java:248)
	  at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:75)
	  at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:610)
	  at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:551)
	  at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:465)
	  at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:437)
	  at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
	  at java.lang.Thread.run(Thread.java:745)

So, this appears to be a JDK or a Netty problem, not a Vert.x problem.

Steps to reproduce

Attempt a UDP socket send to a non-existent service.

Minimal yet complete reproducer code (or URL to code)

I did this in Vert.x, so here is that code in Groovy:

vertx.createDnsClient(8053, '127.0.0.1').lookup('www.google.com', { res ->
    if (res.succeeded()) {
        LOG.info('SUCCESS')
    } else {
        LOG.error('FAILURE')
        LOG.error(res.cause().getLocalizedMessage()) // Returns NULL
    }
})

Netty version

4.1.5

JVM version (e.g. java -version)

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

OS version (e.g. uname -a)

Several

  • Darwin Kernel Version 15.6.0: Wed Nov 2 20:30:56 PDT 2016; root:xnu-3248.60.11.1.2~2/RELEASE_X86_64 x86_64
  • Linux ideapad 4.8.0-32-generic Only release FileRegion if configured to do so. See NETTY-440 #34-Ubuntu SMP Tue Dec 13 14:30:43 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Windows 7 Professional

Activity

  1. normanmaurer commented on Jan 6, 2017

    @normanmaurer
    normanmaurer
    on Jan 6, 2017
    Member
    More actions

    @InfoSec812 this is thrown by the JDK impl itself so not much we can do here

  2. InfoSec812 commented on Jan 6, 2017

    @InfoSec812
    InfoSec812
    on Jan 6, 2017 via email
    Author
    More actions
    That's unfortunate! What about catch8ng and rethrowing? Deven
    …
    On Jan 6, 2017 8:13 AM, "Norman Maurer" ***@***.***> wrote: @InfoSec812 <https://github.com/InfoSec812> this is thrown by the JDK impl itself so not much we can do here — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#6179 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGFa1J-dAQgVPjBTOQ3cvqaE78BVdWRks5rPj3wgaJpZM4LcqCL> .
  3. normanmaurer commented on Jan 6, 2017

    @normanmaurer
    normanmaurer
    on Jan 6, 2017
    Member
    More actions

    Yep that is a good idea.. let me do this

  4. normanmaurer
    self-assigned this
    on Jan 6, 2017
  5. InfoSec812 commented on Jan 6, 2017

    @InfoSec812
    InfoSec812
    on Jan 6, 2017 via email
    Author
    More actions
    Awesome! Thanks!
    …
    On Jan 6, 2017 10:29 AM, "Norman Maurer" ***@***.***> wrote: Yep that is a good idea.. let me do this — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#6179 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGFa0QgwKdMTUMLlkMPN7asnekDYVi6ks5rPl3ggaJpZM4LcqCL> .
  6. InfoSec812 commented on Jan 6, 2017

    @InfoSec812
    InfoSec812
    on Jan 6, 2017
    Author
    More actions

    The Vert.x project is also tracking this as eclipse-vertx/vert.x#1755

  7. normanmaurer commented on Jan 7, 2017

    @normanmaurer
    normanmaurer
    on Jan 7, 2017
    Member
    More actions

    @InfoSec812 one question.. what you would link to have in the exception message ?

  8. InfoSec812 commented on Jan 7, 2017

    @InfoSec812
    InfoSec812
    on Jan 7, 2017 via email
    Author
    More actions
    Received Port Unreachable when attempting to send to <socket addr>? Something like that. And thanks again! Deven
    …
    On Jan 7, 2017 3:23 PM, "Norman Maurer" ***@***.***> wrote: @InfoSec812 <https://github.com/InfoSec812> one question.. what you would link to have in the exception message ? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#6179 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGFa00NxBNNl45-0tDvhn63EWRqaXGkks5rP_QmgaJpZM4LcqCL> .
  9. Scottmitch commented on Jan 7, 2017

    @Scottmitch
    Scottmitch
    on Jan 7, 2017
    Member
    More actions

    Can't the rethrowing be done at a higher level? I just wonder if this will be useful for all use cases, or maybe some won't care about the message ... or can derive their own if necessary? Maybe not a big deal but just want to make sure the extra object allocation / wrapping is more generally useful.

  10. InfoSec812 commented on Jan 7, 2017

    @InfoSec812
    InfoSec812
    on Jan 7, 2017 via email
    Author
    More actions
    I would suggest that the error should be useful at the lowest level possible so the all downstream users benefit. Also, adding the message will not break existing implementations which currently handle the value being null. Deven
    …
    On Jan 7, 2017 3:47 PM, "Scott Mitchell" ***@***.***> wrote: Can't the rethrowing be done at a higher level? I just wonder if this will be useful for all use cases, or maybe some won't care about the message ... or can derive their own if necessary? Maybe not a big deal but just want to make sure the extra object allocation / wrapping is more generally useful. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#6179 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGFa0RlJHZygwlLZ5ldxSHwMv-X26W3ks5rP_nWgaJpZM4LcqCL> .
  11. normanmaurer commented on Jan 7, 2017

    @normanmaurer
    normanmaurer
    on Jan 7, 2017
    Member
    More actions

    @Scottmitch I think it make sense to add it to netty as its basically the same as we do with out "ConnectException" stuff. I will also do an openjdk patch so we may get it fixed in openjdk at some point tho 👍

  12. InfoSec812 commented on Jan 7, 2017

    @InfoSec812
    InfoSec812
    on Jan 7, 2017 via email
    Author
    More actions
    Woot! Thanks all!
    …
    On Sat, Jan 7, 2017 at 4:18 PM, Norman Maurer ***@***.***> wrote: @Scottmitch <https://github.com/Scottmitch> I think it make sense to add it to netty as its basically the same as we do with out "ConnectException" stuff. I will also do an openjdk patch so we may get it fixed in openjdk at some point tho 👍 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#6179 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGFa8tmeA7-3O_ALUmtQ0gDGFWPo2UFks5rQAE9gaJpZM4LcqCL> .
  13. normanmaurer commented on Mar 28, 2018

    @normanmaurer
    normanmaurer
    on Mar 28, 2018
    Member
    More actions

    At the end we decided we dont want to catch and rethrow.

  14. normanmaurer
    closed this as completedon Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @normanmaurer
    normanmaurer

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.