Modify

Opened 5 weeks ago

Last modified 5 weeks ago

#24591 needinfo defect

on startup, JOSM throws "crash window" about encoding of files in my homedir

Reported by: mnalis Owned by: mnalis
Priority: normal Milestone:
Component: Core Version: tested
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. unset LANG (I normally run with LANG=hr_HR.UTF-8, but am now disabling it due to https://josm.openstreetmap.de/ticket/24374#comment:3)
  2. have file with non-ASCII characters in your homedir
  3. start JOSM
  4. click file/new

What is the expected result?

  • firstly, I would not expect JOSM to search for / open random files in my homedir (but only stuff in ~/.config/JOSM, ~/.cache/JOSM etc) on opening an empty map ?! That sounds more like some virus/trojan horse / cryptolocker
  • secondly, even if I were explicitly trying to open directory listing, I'd expect for unreadable chars to be replaced with some character (or perhaps whole file skipped in listing, or displayed with strange name), and mere warning to be logged in console, instead of JOSM complaining so violently about that

What happens instead?

"you have encountered a bug in JOSM" popup jumps.

Please provide any additional information below. Attach a screenshot if possible.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2025-08-31 14:19:57 +0200 (Sun, 31 Aug 2025)
Revision:19439
Build-Date:2025-09-02 01:30:58
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (19439 en) Linux Debian GNU/Linux 13 (trixie)
Memory Usage: 349 MB / 2987 MB (172 MB allocated, but free)
Java version: 21.0.9+10-Debian-1deb13u1, Debian, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1920x1080x[Multi depth]@60Hz (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: ANSI_X3.4-1968
Locale info: en_US
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: ICEWM
Java package: openjdk-21-jre:amd64-21.0.9+10-1~deb13u1
fonts-noto: fonts-noto:all-20201225-2
VM arguments: [-Dsun.java2d.opengl=true, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED]
Dataset consistency test: No problems found

Plugins:
+ DirectUpload (36438)
+ FixAddresses (36438)
+ ImageWayPoint (36438)
+ Mapillary (1815)
+ PicLayer (270)
+ Review.Changes (1.1.1)
+ apache-commons (36438)
+ apache-http (36438)
+ areaselector (366)
+ austriaaddresshelper (101)
+ buildings_tools (36438)
+ conflation (274)
+ ejml (36438)
+ geotools (36438)
+ imagery_offset_db (36438)
+ jackson (36438)
+ jaxb (36438)
+ jna (36438)
+ jts (36438)
+ log4j (36438)
+ mbtiles (v2.6.1)
+ opendata (36460)
+ osmwiki-dataitem (0.0.8)
+ pmtiles (36438)
+ pt_assistant (677)
+ reverter (36447)
+ todo (156)
+ turnrestrictions (36458)
+ undelete (36438)
+ urbaneye3d (1.6.1)
+ utilsplugin2 (36438)
+ wikipedia (441)

Tagging presets:
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Healthcare&zip=1
+ https://<user.name>.com/prezentacije/OpenStreetMap/josm-preset.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Xmas&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ http://bezdomni.net/Styles_HighlightedCapesBays-style.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/ColorWays&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/CyclewaysStylingBNA&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/SidewalksPlus&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/BuildingColors&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/FixmeAndNote&zip=1
+ ${HOME}/tmp/g/1/openaddresses-HR.mapcss

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/KeepRight&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/QAToolInspiredValidations&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/OSMLint&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/MissingWeekdays&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/SourceObjectTag&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/IndoorRules&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/Pictures&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/MissingOpeningHours&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/CheckDate&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/FacebookWebsite&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/DuplicateAttributes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/MissingMain&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/OldCovid&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/NotCheck&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/ThisOrThat&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/ChargeRules&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/InvalidWebsiteProtocol&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/AddrFullWarning&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/AddrRelationWarning&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/CountryCodeCheck&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Rules/Geology&zip=1
+ https://raw.githubusercontent.com/stefan-a-bauer/josm-validators/master/mtb.validator.mapcss
+ https://github.com/Jungle-Bus/transport_mapcss/raw/gh-pages/transport.validator.zip
+ https://github.com/open-energy-transition/validate-my-grid/raw/refs/heads/gh-pages/power.validator.zip
+ https://josm.openstreetmap.de/josmfile?page=Rules/PublicTransportGtfs&zip=1
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/Seamark.validator.mapcss

Last errors/warnings:
- 00000.846 W: Missing plugin main version in plugin panoramax
- 00001.164 W: Missing plugin main version in plugin panoramax
- 00012.349 E: Failed to locate image 'reset_camera'
- 00012.502 E: Handled by bug report queue: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: ${HOME}/Old_town_��ur��evac.jpg



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: Basic L&F File Loading Thread (85)
java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/mnalis/Old_town_��ur��evac.jpg
	at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:129)
	at java.base/sun.nio.fs.UnixPath.<init>(UnixPath.java:76)
	at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:312)
	at java.base/java.nio.file.Path.of(Path.java:148)
	at java.base/java.nio.file.Paths.get(Paths.java:69)
	at java.desktop/sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:260)
	at java.desktop/javax.swing.filechooser.FileSystemView.getFiles(FileSystemView.java:585)
	at java.desktop/javax.swing.plaf.basic.BasicDirectoryModel$FilesLoader.run0(BasicDirectoryModel.java:307)
	at java.desktop/javax.swing.plaf.basic.BasicDirectoryModel$FilesLoader.run(BasicDirectoryModel.java:298)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Attachments (0)

Change History (4)

comment:1 by stoecker, 5 weeks ago

Owner: changed from team to mnalis
Status: newneedinfo

firstly, I would not expect JOSM to search for / open random files in my homedir

How do you expect a file dialog to show the file list without reading the names?

Anyway there is nothing we can do about this, as that's pure java functionality not influenced by JOSM.

I find it strange thought, that "System property file.encoding: UTF-8" seems correct, but you still get that error. The files on your disc are UTF-8 encoded?

I don't understand you reason for LANG settings, but probably you should use LANG=en_US.UTF-8 instead your unset command.

comment:2 by mnalis, 5 weeks ago

How do you expect a file dialog to show the file list without reading the names?

But that is exactly the issue, I'm not trying to do File / Open (which would have a reason to do readdir(3)).

But I am using File / New which just creates empty data layer, and should have no reason whatsoever to try to look what files exist in my homedir. IOW, it never shows (nor should show) any file list.

Anyway there is nothing we can do about this, as that's pure java functionality not influenced by JOSM.

Oh, OK. Feel feel to close the issue then, if there is nothing that can be improved in JOSM.

I find it strange thought, that "System property file.encoding: UTF-8" seems correct, but you still get that error. The files on your disc are UTF-8 encoded?

yes. That file the logs complain about are:

`
% ls Old_town*
Old_town_Đurđevac.jpg

% ls Old_town* | hd
00000000 4f 6c 64 5f 74 6f 77 6e 5f c4 90 75 72 c4 91 65 |Old_town_..ur..e|
00000010 76 61 63 2e 6a 70 67 0a |vac.jpg.|
`

c4 90 is Đ LATIN CAPITAL LETTER D WITH STROKE, and c4 91 is đ (LATIN SMALL LETTER D WITH STROKE)

but probably you should use LANG=en_US.UTF-8 instead your unset command.

yes, I can confirm that using that one avoids the issue.

comment:3 by stoecker, 5 weeks ago

But that is exactly the issue, I'm not trying to do File / Open (which would have a reason to do readdir(3)).

Hmm, can't reproduce. For me that error happens only when I call the open function. Probably one of your plugins causes this? Sadly your stack trace is not helpful to find the origin of the call.

P.S. I agree that causing an exception for this, is really a brain-damaged decision of the Java developers.

comment:4 by mnalis, 5 weeks ago

Probably one of your plugins causes this?

Good call. It was PicLayer (version 270). If I remove it, then File / New no longer throws exception (File / Open still does, of course)

Sadly your stack trace is not helpful to find the origin of the call.

I found out there is --debug that can be passed which was helpful:

2026-01-11 05:25:26.456 INFO: Opening URL: https://josm.openstreetmap.de/wiki/Help/Plugin/PicLayer
2026-01-11 05:25:26.481 WARNING: java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!
java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as needinfo The owner will remain mnalis.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from mnalis to the specified user. Next status will be 'new'.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from mnalis to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.