Closed Bug 1994624 Opened 4 months ago Closed 4 months ago

Build failure in JIT on OpenBSD/riscv64 since bug 1982266

Categories

(Core :: JavaScript Engine: JIT, defect)

RISCV64
OpenBSD
defect

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox144 --- wontfix
firefox145 --- fixed
firefox146 --- fixed

People

(Reporter: gaston, Assigned: gaston)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

I'm just the messenger as i don't have such hardware, but the build fails in the JIT engine since its been enabled by default in bug 1982266:

/local/pobj/firefox-143.0.3/firefox-143.0.3/js/src/jit/riscv64/Architecture-riscv64.cpp:89:4: error: "Unsupported platform" 89
 | #  error "Unsupported platform"

i suppose it might affect the other BSDs.

a simple fix (from jca, in cc) is inlined below, which i can push if deemed acceptable :

--- js/src/jit/riscv64/Architecture-riscv64.cpp.orig
+++ js/src/jit/riscv64/Architecture-riscv64.cpp
@@ -76,7 +76,7 @@ void FlushICache(void* code, size_t size) {
 #if defined(JS_SIMULATOR)
   js::jit::SimulatorProcess::FlushICache(code, size);
 
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__OpenBSD__)
 #  if defined(__GNUC__)
   intptr_t end = reinterpret_cast<intptr_t>(code) + size;
   __builtin___clear_cache(reinterpret_cast<char*>(code),
--- js/src/wasm/WasmSignalHandlers.cpp.orig
+++ js/src/wasm/WasmSignalHandlers.cpp
@@ -100,6 +100,12 @@ using namespace js::wasm;
 #      define RLR_sig(p) ((p)->sc_lr)
 #      define R31_sig(p) ((p)->sc_sp)
 #    endif
+#    if defined(__riscv)
+#      define RPC_sig(p) ((p)->sc_sepc)
+#      define RRA_sig(p) ((p)->sc_ra)
+#      define RFP_sig(p) ((p)->sc_s[0])
+#      define R02_sig(p) ((p)->sc_sp)
+#    endif
 #    if defined(__mips__)
 #      define EPC_sig(p) ((p)->sc_pc)
 #      define RFP_sig(p) ((p)->sc_regs[30])

given the full list of riscv64 bugs (https://bugzilla.mozilla.org/buglist.cgi?quicksearch=riscv64&list_id=17728043) we might disable the jit on OpenBSD/riscv64 until it's been more battle tested - or at least someone (tm) has run the full jit testsuite and compared the results with other platforms.

Set release status flags based on info from the regressing bug 1982266

:csmantle, since you are the author of the regressor, bug 1982266, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(webmaster)

(In reply to Landry Breuil (:gaston) from comment #0)

given the full list of riscv64 bugs (https://bugzilla.mozilla.org/buglist.cgi?quicksearch=riscv64&list_id=17728043) we might disable the jit on OpenBSD/riscv64 until it's been more battle tested - or at least someone (tm) has run the full jit testsuite and compared the results with other platforms.

Agreed.

Flags: needinfo?(webmaster)
Assignee: nobody → landry
Status: NEW → ASSIGNED

Hi Landry,

I tried the patch that you mentioned in #comment 3 in my firefox-v143.0.3 sources and built the firefox.
It was built successfully but still i am facing the crashes when i am trying to launch the new tabs.
can you look into this issue?

Regards,
Saiteja.

(In reply to Saiteja from comment #4)

I tried the patch that you mentioned in #comment 3 in my firefox-v143.0.3 sources and built the firefox.
It was built successfully but still i am facing the crashes when i am trying to launch the new tabs.

Hi Saiteja, are you building for OpenBSD on RV64? If so, I think we can try to look at if it's also caused by the same (seemingly) graphics issues you encountered earlier.

(Replying since I'm on the CC list.)

Hi Rong Bao,

I built firefox for riscv64 on ubuntu-22.04, i observed the similar crash on ubuntu-22.04. so,i patched the #comment 3 in my firefox and built the firefox still observing the tabs getting crashed, not on OpenBSD.

Regards,
Saiteja

(In reply to Saiteja from comment #6)

I built firefox for riscv64 on ubuntu-22.04, i observed the similar crash on ubuntu-22.04. so,i patched the #comment 3 in my firefox and built the firefox still observing the tabs getting crashed, not on OpenBSD.

I'm afraid this patch is a noop for non-OpenBSD builds, so this is consistent with what you have observed.

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch

The patch landed in nightly and beta is affected.
:gaston, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(landry)

Comment on attachment 9520384 [details]
Bug 1994624: fix JIT build on OpenBSD/riscv64. r=#spidermonkey-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: FTBFS on OpenBSD/riscv64
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Tier3
  • String changes made/needed:
  • Is Android affected?: No
Flags: needinfo?(landry)
Attachment #9520384 - Flags: approval-mozilla-beta?
Attachment #9520384 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: