Skip to content
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

segfault after closing webview window #10837

Open
20after4 opened this issue May 4, 2024 · 0 comments
Open

segfault after closing webview window #10837

20after4 opened this issue May 4, 2024 · 0 comments
Labels
bug Something isn't working crash An issue that could cause a crash

Comments

@20after4
Copy link

20after4 commented May 4, 2024

How can we reproduce the crash?

Happens with 1.1.6 and 1.1.7 and seems to be related to calling webview.eval

Ran: bun webview.js

I've included the content of the two files which I am loading with Bun.file and injecting into the webview:

index.html

<!DOCTYPE html>
<html>
    <head>
        <title></title>

    </head>
    <body>
        <table is="tui-table"></table>
    </body>
    <template id="table-content" ><thead><tr><th>head</th></tr></thead><tbody><tr><td>row</td></tr></tbody></template>
</html>

out/tui.js

// tui.ts
class TUITable extends HTMLTableElement {
  constructor() {
    super();
  }
  connectedCallback() {
    console.log("Custom element added to page.");
  }
  disconnectedCallback() {
    console.log("Custom element removed from page.");
  }
  adoptedCallback() {
    console.log("Custom element moved to new page.");
  }
  attributeChangedCallback(name, oldValue, newValue) {
    console.log(`Attribute ${name} has changed.`);
  }
}
customElements.define("tui-table", TUITable, { extends: "table" });

JavaScript/TypeScript code that reproduces the crash?

import { Webview } from "webview-bun";

const index = Bun.file("index.html");
const script = Bun.file("out/tui.js");

const webview = new Webview();
async function init() {
    var html = await index.text();
    var js = await script.text();
    webview.setHTML(html);
    webview.run();
    webview.eval(js);
}

init();

Relevant log output

(bun:1333647): Gtk-CRITICAL **: 17:04:45.141: gtk_main_quit: assertion 'main_loops != NULL' failed
============================================================
Bun v1.1.6 (e58d67b4) Linux x64
Args: "bun", "webview.js"
Features: tsconfig 
Builtins: "bun:ffi" "bun:main" 
Elapsed: 36564ms | User: 399ms | Sys: 144ms
RSS: 1.07GB | Peak: 0.27GB | Commit: 1.07GB | Faults: 0

Stack Trace (bun.report)

Bun v1.1.6 (e58d67b) on linux x86_64 [AutoCommand]

Segmentation fault at address 0x00000010

@20after4 20after4 added bug Something isn't working crash An issue that could cause a crash labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash An issue that could cause a crash
Projects
None yet
Development

No branches or pull requests

1 participant