-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deno test segfaults after upgrading to 1.35.x #19926
Comments
I'm also experiencing this after upgrading from 1.34.x to 1.36.0 (Kernel is import { assertEquals } from 'std/assert/assert_equals.ts';
import { abortController } from './main.ts';
const baseUrl = 'http:https://localhost:8000';
Deno.test({
name: 'HTTP Server',
fn: async () => {
let response = await fetch(`${baseUrl}/`);
assertEquals(response.status, 200);
let responseText = await response.text();
assertEquals(responseText.includes('Something'), true);
response = await fetch(`${baseUrl}/blah`);
assertEquals(response.status, 404);
responseText = await response.text();
assertEquals(responseText, 'Not found');
abortController.abort('Test finished');
},
sanitizeResources: false,
sanitizeOps: false,
});
import routes, { Route } from './routes.ts';
function handler(request: Request, connectionInfo: Deno.ServeHandlerInfo) {
const routeKeys = Object.keys(routes);
for (const routeKey of routeKeys) {
const route: Route = routes[routeKey];
const match = route.pattern.exec(request.url);
if (match) {
return route.handler(request, match, connectionInfo);
}
}
return new Response('Not found', {
status: 404,
});
}
export const abortController = new AbortController();
const PORT = Deno.env.get('PORT') || 8000;
Deno.serve({ port: PORT as number, signal: abortController.signal }, handler); Finally, export interface Route {
pattern: URLPattern;
handler: (
request: Request,
match: URLPatternResult,
connectionInfo: Deno.ServeHandlerInfo,
) => Response | Promise<Response>;
}
interface Routes {
[routeKey: string]: Route;
}
const routes: Routes = {
index: {
pattern: new URLPattern({ pathname: '/' }),
handler: () => {
return new Response('Something!');
},
},
};
export default routes; I'm not getting segmentation faults all the time (it's like in 4 out of 5 runs), and in GH Actions I haven't seen it fail yet. Here's a "simple app" repo where this is happening: https://github.com/BrunoBernardino/deno-boilerplate-simple-website |
@BrunoBernardino thanks for the reproducer. I tried to run |
Dang, I think this might be Linux-only problem. I'm not able to reproduce it no matter how many times I run it. I will upgrade V8 next week, let's see if that helps. |
Nevermind, I re-read what you said. You didn't say it happens all the time on Linux, only that it happens only in Linux. Carry on! |
I'm also getting this on Linux with some code that uses Wasm. Occurs in 1.35.0+
|
I'm erring on the side of V8 bug as we haven't touched WASM support at all in a few months. I'll let you know once we get a new version of V8 landed some time next week. |
I'm getting this error on Ubuntu 22.04 after #20135 was merged, both release and debug builds, only happen on builds after |
Not sure if it's connected, but I also get a segfault just running
I'm running on Arch Linux (on an AMD Ryzen 9 5950X Processor.):
UPDATE: This no longer happens on the latest HEAD with |
I get the problem above again with the latest HEAD (since deno_core was updated again). I also get it running |
This is a mitigation for segfaults happening in V8 on CPU with MPK (memory protected keys). After much trail and error we found that unless V8 platform is initialized on main thread the segfaults start appears once JIT kicks in. "deno test" and "deno bench" were affected by this problem. Fixes #19926 Fixes #20243 Fixes #20450 --------- Co-authored-by: Bartek Iwańczuk <[email protected]>
I'm still seeing a segfault, I think even after these changes. Running
|
I have a mildly large testsuite in a private repo, and after upgrading
deno
from 1.34.x to 1.35.x I'm starting to see segmentation faults. Specifically, 1.34.3 seems to be working fine while all newer releases up to 1.35.2 do segfault.I wasn't able to pin down what triggers the segfaults nor to get a minimal reproducer, but so far I've observed that they are easier to reach if I set up the test environment so that the testsuite fails quickly.
As a concrete example, the testsuite uses puppeteer against a local web app, and if I stop the local service then the test run used to fail in this way in 1.34.x:
Here above,
misc_test.ts
contains some Deno tests and there is setup logic inutils.ts
andgithub_signin.ts
which runs on import (and can fail, as seen).Under the same conditions, 1.35.x hits a segfault:
Stacktrace shows the following:
This on Linux kernel 5.19.0 and glibc 2.36 (stock Ubuntu 22.10).
The text was updated successfully, but these errors were encountered: