Opened 12 years ago

Closed 12 years ago

#9116 closed bug (fixed)

liblocale.so: Bad port ID

Reported by: luroh Owned by: pulkomandy
Priority: normal Milestone: R1
Component: Servers/app_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

For years now, if you boot an image and open a few applications you can see corresponding entries like these popping up in the syslog:

USER 'liblocale.so'[224]: app application/x-vnd.Haiku-StyledEdit send to client failed: Bad port ID
USER 'liblocale.so'[238]: app application/x-vnd.Haiku-WebPositive send to client failed: Bad port ID
Last message repeated 2 times
USER 'liblocale.so'[373]: app application/x-vnd.Haiku-Terminal send to client failed: Bad port ID

Perhaps not a bug, I have no idea what these are good (or bad, rather) for.

Change History (9)

comment:1 by zooey, 12 years ago

Resolution: fixed
Status: newclosed

Should be fixed in hrev44867, at least the Locale Kit is no longer using syslog.

comment:2 by zooey, 12 years ago

Component: Kits/Locale KitServers/app_server
Resolution: fixed
Status: closedreopened

The log messages are still with us, just no longer attributed to liblocale.so

comment:3 by luroh, 12 years ago

The log messages are generated in src/servers/app/ServerApp.cpp, SendMessageToClient. By running 'tail -f /boot/common/var/log/syslog' I have observed that the messages get logged when quitting an application, if that's of any help.

comment:4 by jackburton, 12 years ago

It could be the app_server, which uses syslog.

comment:5 by jstressman, 12 years ago

This looks like it's coming from http://cgit.haiku-os.org/haiku/tree/src/servers/app/ServerApp.cpp#n294

I don't know the code well enough to get to what is sending the "Bad port ID" message to that, but that's the line that actually sends the message to the syslog as far as I can tell.

The "Bad port ID" part of the message comes from http://cgit.haiku-os.org/haiku/tree/src/system/libroot/posix/string/strerror.c#n114

So if someone who can actually understand the code can see which one of the calls to SendMessageToClient() actually sends that message, and why... that could probably lead to the fix for this. It's a bit over my head still unfortunately.

comment:6 by leavengood, 12 years ago

Given comment:3, I would suspect what is happening is when an application quits, the app_server tries to send one or more messages back to the application. But in some (or maybe all) cases, the application has already closed, so the port is no longer valid and the sending of the message fails, and then the error is logged.

It would require some debugging, but I suspect the solution involves not trying to send messages when an application is quitting.

comment:7 by axeld, 12 years ago

Should be fixed with hrev45437. I'll leave this one open for now, though. Note, the message might still appear, but should not do so regularly anymore.

comment:8 by jscipione, 12 years ago

Verified to be fixed in hrev45437, the message no longer appears when closing an app. Thanks, Axel!

comment:9 by axeld, 12 years ago

Resolution: fixed
Status: reopenedclosed

Well, thanks for the investigation in the first place! This actually will also fix a bug in my background branch at github where the client memory allocator may survive the death of the application.

Note: See TracTickets for help on using tickets.