Skip to content

browserExist() failure #120

Description

@cers000

代码非常简单,可以通过编译但是运行出错

const std = @import("std");
const wu = @import("webui");

pub fn main() !void {
    if (wu.browserExist(.Chrome)) {
        std.log.info("Chrome", .{});
    }
    if (wu.browserExist(.Chromium)) {
        std.log.info("Chromium", .{});
    }
    if (wu.browserExist(.Webview)) {
        std.log.info("Webview", .{});
    }
}

错误:

Segmentation fault at address 0x24
???:?:?: 0x7ffc89613536 in ??? (ntdll.dll)
???:?:?: 0x7ffc895dfcb3 in ??? (ntdll.dll)
???:?:?: 0x7ffc895dfae1 in ??? (ntdll.dll)
F:\code\ziglist\testio\zig-pkg\webui-2.5.0-beta.4-pxqD5TCWQABe1AyvdqsBEmQyFjbMMFb7yJHmMVAq_ZBZ\src\webui.c:5777: 0x7ff775758487 in _webui_mutex_lock (webui.lib)
    EnterCriticalSection(mutex);

F:\code\ziglist\testio\zig-pkg\webui-2.5.0-beta.4-pxqD5TCWQABe1AyvdqsBEmQyFjbMMFb7yJHmMVAq_ZBZ\src\webui.c:4852: 0x7ff77575a640 in _webui_malloc (webui.lib)
    _webui_mutex_lock(&_webui.mutex_mem);

F:\code\ziglist\testio\zig-pkg\webui-2.5.0-beta.4-pxqD5TCWQABe1AyvdqsBEmQyFjbMMFb7yJHmMVAq_ZBZ\src\webui.c:11974: 0x7ff7757604a9 in _webui_str_to_wide (webui.lib)
    wchar_t *wide = (wchar_t *)_webui_malloc(wlen * sizeof(wchar_t));

F:\code\ziglist\testio\zig-pkg\webui-2.5.0-beta.4-pxqD5TCWQABe1AyvdqsBEmQyFjbMMFb7yJHmMVAq_ZBZ\src\webui.c:5126: 0x7ff77577a0bd in _webui_file_exist (webui.lib)
    if (!_webui_str_to_wide(full_path, &wfilePath))

F:\code\ziglist\testio\zig-pkg\webui-2.5.0-beta.4-pxqD5TCWQABe1AyvdqsBEmQyFjbMMFb7yJHmMVAq_ZBZ\src\webui.c:6714: 0x7ff775779f93 in _webui_is_google_chrome_folder (webui.lib)
    if (!_webui_file_exist(browser_full_path)) {

F:\code\ziglist\testio\zig-pkg\webui-2.5.0-beta.4-pxqD5TCWQABe1AyvdqsBEmQyFjbMMFb7yJHmMVAq_ZBZ\src\webui.c:6903: 0x7ff77575cb0b in _webui_browser_exist (webui.lib)
            if (_webui_is_google_chrome_folder(browser_folder)) {

F:\code\ziglist\testio\zig-pkg\webui-2.5.0-beta.4-pxqD5TCWQABe1AyvdqsBEmQyFjbMMFb7yJHmMVAq_ZBZ\src\webui.c:1291: 0x7ff77575c85a in webui_browser_exist (webui.lib)
    return _webui_browser_exist(NULL, browser);

F:\code\ziglist\testio\zig-pkg\zig_webui-2.5.0-beta.4-M4z7zYaiAQCoeY3mDtQkPz_CC_fsFhV9aZol8UY29jPF\src\webui.zig:200:33: 0x7ff775737505 in browserExist (testio_zcu.obj)
    return c.webui_browser_exist(browser);
                                ^
F:\code\ziglist\testio\src\main.zig:5:24: 0x7ff775621017 in main (testio_zcu.obj)
    if (wu.browserExist(.Chrome)) {
                       ^
F:\program\zig-x86_64-windows-0.16.0\lib\std\start.zig:698: 0x7ff7756211a8 in callMain (testio_zcu.obj)
    if (fn_info.params.len == 0) return wrapMain(root.main());

F:\program\zig-x86_64-windows-0.16.0\lib\std\start.zig:658:28: 0x7ff7756211a8 in main (testio_zcu.obj)
            return callMain(std.os.windows.peb().ProcessParameters.CommandLine.slice(), .global);
                           ^
F:\program\zig-x86_64-windows-0.16.0\lib\libc\mingw\crt\crtexe.c:259: 0x7ff77575519b in __tmainCRTStartup (crt2.obj)
    mainret = _tmain (argc, argv, envp);

F:\program\zig-x86_64-windows-0.16.0\lib\libc\mingw\crt\crtexe.c:179: 0x7ff7757551fb in mainCRTStartup (crt2.obj)
  ret = __tmainCRTStartup ();

???:?:?: 0x7ffc88ce7613 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffc896026b0 in ??? (ntdll.dll)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions