Summary
Confirmed locally with a definitive root-cause verification, reproduces on this fork's current CEF version (146.0.10+g8219561+chromium-146.0.7680.179): matches upstream chromiumembedded/java-cef#445, reported from WSL2 Ubuntu -- the exact environment this fork's entire test suite runs in.
native/util_posix.cpp's GetTempFileName() concatenates the temp directory path and filename with no separator:
std::string GetTempFileName(const std::string& identifer, bool useParentId) {
std::stringstream tmpName;
CefString tmpPath;
if (!CefGetPath(PK_DIR_TEMP, tmpPath))
tmpPath = "/tmp/";
tmpName << tmpPath.ToString().c_str();
tmpName << "jcef-p" << (useParentId ? util::GetParentPid() : util::GetPid());
tmpName << (identifer.empty() ? "" : "_") << identifer.c_str() << ".tmp";
return tmpName.str();
}
If CefGetPath(PK_DIR_TEMP, tmpPath) succeeds and returns a path without a trailing slash -- which is exactly what Chromium's base::GetTempDir() does on Linux -- the result is a malformed path (e.g. /tmpjcef-p1234.tmp instead of /tmp/jcef-p1234.tmp). Custom (non-standard, non-http) scheme registrations are communicated to renderer subprocesses via a file at this path; when it's malformed, subprocesses never find the registration, and any navigation to a real custom scheme just hangs (no page ever loads, no error either).
Repro -- with definitive causation check, not just correlation
Added java/tests/junittests/UpstreamIssue445Test.java (currently @Disabled with a link to this issue, so it doesn't fail the normal suite -- remove @Disabled to re-run it):
- Register a real
CefSchemeHandlerFactory for a genuinely custom scheme (jceftestscheme, already registered via CefSchemeRegistrar elsewhere in this suite's harness) serving real HTML content.
- Navigate a browser to a URL under that scheme.
- Without
$TMPDIR set (this fork's default CI/dev environment): the page never loads. Confirmed via TestFrame's watchdog cleanly timing out after 15s (not a real hang).
- With
TMPDIR=/tmp/ set (trailing slash -- the exact workaround the upstream report itself documents): the identical test passes in ~2 seconds.
This isn't just "the bug still exists" -- toggling the one environment variable the upstream report names as the cause flips the test from failing to passing, confirming the root cause precisely.
Fix sketch (not implemented here)
In native/util_posix.cpp's GetTempFileName(), ensure a separator is always present between tmpPath and the filename -- e.g. check whether tmpPath ends in / and append one if not, rather than assuming CefGetPath(PK_DIR_TEMP, ...) always returns a trailing slash.
Found via
This fork's coverage-expansion effort (tracked in #5), while triaging upstream's issue tracker for bugs that could become regression tests in this fork's suite per the user's explicit direction to "start harvesting the upstream git issues for problematic tests."
Summary
Confirmed locally with a definitive root-cause verification, reproduces on this fork's current CEF version (146.0.10+g8219561+chromium-146.0.7680.179): matches upstream chromiumembedded/java-cef#445, reported from WSL2 Ubuntu -- the exact environment this fork's entire test suite runs in.
native/util_posix.cpp'sGetTempFileName()concatenates the temp directory path and filename with no separator:If
CefGetPath(PK_DIR_TEMP, tmpPath)succeeds and returns a path without a trailing slash -- which is exactly what Chromium'sbase::GetTempDir()does on Linux -- the result is a malformed path (e.g./tmpjcef-p1234.tmpinstead of/tmp/jcef-p1234.tmp). Custom (non-standard, non-http) scheme registrations are communicated to renderer subprocesses via a file at this path; when it's malformed, subprocesses never find the registration, and any navigation to a real custom scheme just hangs (no page ever loads, no error either).Repro -- with definitive causation check, not just correlation
Added
java/tests/junittests/UpstreamIssue445Test.java(currently@Disabledwith a link to this issue, so it doesn't fail the normal suite -- remove@Disabledto re-run it):CefSchemeHandlerFactoryfor a genuinely custom scheme (jceftestscheme, already registered viaCefSchemeRegistrarelsewhere in this suite's harness) serving real HTML content.$TMPDIRset (this fork's default CI/dev environment): the page never loads. Confirmed viaTestFrame's watchdog cleanly timing out after 15s (not a real hang).TMPDIR=/tmp/set (trailing slash -- the exact workaround the upstream report itself documents): the identical test passes in ~2 seconds.This isn't just "the bug still exists" -- toggling the one environment variable the upstream report names as the cause flips the test from failing to passing, confirming the root cause precisely.
Fix sketch (not implemented here)
In
native/util_posix.cpp'sGetTempFileName(), ensure a separator is always present betweentmpPathand the filename -- e.g. check whethertmpPathends in/and append one if not, rather than assumingCefGetPath(PK_DIR_TEMP, ...)always returns a trailing slash.Found via
This fork's coverage-expansion effort (tracked in #5), while triaging upstream's issue tracker for bugs that could become regression tests in this fork's suite per the user's explicit direction to "start harvesting the upstream git issues for problematic tests."