Boscop / Boscop/web-view

macos webview_cocoa.c unknown error

Open
#328 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2k
Forks
179
PR merge metrics
No merged PRs in 30d

Description

### description
I'm using the master branch in a rust project and it fails to render a webview on macos and the program crashes when instantiating webview
according to my debugger my program just quits when this is hit

Issues lie here:
https://github.com/Boscop/web-view/blob/master/webview-sys/webview_cocoa.c

https://github.com/Boscop/web-view/blob/82d7cbce6228b1a964673cc0f22944ad808eab42/src/lib.rs#L348

## debugger leads

### line 61
```c
if (webview_init(wv) != 0) {
webview_free(wv);
return NULL;
}
return wv;
}
```
### line 328 in webview_cocoa.c
```c
id wkPref = ((id(*)(id, SEL))objc_msgSend)((id)__WKPreferences, sel_registerName("new"));
```

### finally src/lib.rs line 348

```rust
let user_data = Box::new(UserData {
inner: user_data,
live: Arc::new(RwLock::new(())),
invoke_handler: Box::new(invoke_handler),
result: Ok(()),
});
let user_data_ptr = Box::into_raw(user_data);
```



### Somethings up with user_data according to the debugging

Screenshot 2024-01-09 at 4 13 59 PM

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with webview-sys/webview_cocoa.c at line 328 and src/lib.rs at line 348, then reproduce the macOS webview-instantiation failure from the master branch under a debugger. Trace the webview_init failure path around line 61 to identify why the program quits. Done means the webview renders without crashing during instantiation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos, objective-c, rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.