Skip to content

[bug / limitation] : WadMerge NullPointerException on empty directories with network paths (windows) #151

@aJynks

Description

@aJynks

TL;DR:
There seems to be some kind of limitation with java and networked drives on windows. On Windows network shares (mapped drives / UNC), Java File.list()/listFiles() may return null instead of an empty array when the directory cannot be read due to SMB reconnects, permission/session issues, or transient I/O failures. This is a "windows" problem with how network shares work... I think.

I'm pretty sure Java list()/listFiles() returning null on Windows network shares is a documented behaviour.

I think some kind of check for null returns in wadmerge would get around this...... maybe even treating null returns as if they are in infact exist but are empty would bypass the null return problem?

To be clear, there is no issue when running locally.

Details
Creating a doommake project on a network drive... (x:,or using//serverName/share`). Then using a doom2.wad path (local, x:, //servername ... all same results)

  • Create doomtools project
  • run doommake
  • run doommake clean
  • run doommake

you will get an error the 2nd make...

Building assets...
ERROR: scripts\merge-assets.txt, line 32: Bad command call: mergedir. Internal error.
    Caused by: NullPointerException: Cannot read the array length because "a" is null
ERROR: [ToolError]: WadMerge threw an error.

but... wait a little bit.. do absolutely nothing... and run doommake again and it will build correctly.

My Personal Situation
I made a new build target called "fresh"

check entry fresh(args) {
    doClean();
    doInit();
    doAll();
    doRelease();
    doDist();
}

This works fine locally but fails on network drives.... there seems to be no way I could work out to put in proper wait functions between doClean(); and doInit();. Or do some kind of wait until there is no longer a null return.... I tried mixing local and network iwads, using //serernam/paths and "mapped network drive" paths like x: and even tried symbolic links to the dirs (both mapped and serverpaths)

Anyway, I couldn't get around this.

I was able to use a bat file to wait, and run one command after the other, as in run doommake clean, then doommake.. but the wait time for the network refresh seems to vairy and could be as long as 30 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIntroduced unintentional problem.dependent on 3rd partyThis issue requires a fix or change in a dependent library.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions