Closed Bug 991341 Opened 6 years ago Closed 6 years ago

CID 1122021: OdinMonkey: Unchecked return value in jit/AsmJSSignalHandlers.cpp as found by Coverity

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set

Tracking

()

RESOLVED INVALID

People

(Reporter: gkw, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: coverity)

Coverity analysis of source code in js/src has found an Unchecked return value issue.

________________________________________________________________________________________________________
*** CID 1122021:  Unchecked return value  (CHECKED_RETURN)
/js/src/jit/AsmJSSignalHandlers.cpp: 910 in HandleSignal(int, siginfo *, void *)()
904             return false;
905     
906         // If we faulted trying to execute code in 'module', this must be an
907         // operation callback (see TriggerOperationCallbackForAsmJSCode). Redirect
908         // execution to a trampoline which will call js_HandleExecutionInterrupt.
909         // The trampoline will jump to activation->resumePC if execution isn't
>>>     CID 1122021:  Unchecked return value  (CHECKED_RETURN)
>>>     No check of the return value of "mprotect(module->codeBase(), module->functionBytes(), 4)".
910         // interrupted.
911         if (module.containsPC(faultingAddress)) {
912             activation->setResumePC(pc);
913             *ppc = module.operationCallbackExit();
914     
915             JSRuntime::AutoLockForOperationCallback lock(rt);

Benjamin, how shall we move forward here?
Flags: needinfo?(benj)
The only thing to do if mprotect() fails in these cases is to MOZ_CRASH() (that is what is currently done on tip, I guess you're scanning an old cset).  However, even in the older versions, if the mprotect fails, then we'll still crash since the code was not made executable, so I'm not sure there is anything to do here.
Flags: needinfo?(benj)
OK, let's resolve INVALID then.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Summary: OdinMonkey: Unchecked return value in jit/AsmJSSignalHandlers.cpp as found by Coverity → CID 1122021: OdinMonkey: Unchecked return value in jit/AsmJSSignalHandlers.cpp as found by Coverity
You need to log in before you can comment on or make changes to this bug.