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

Latest changes makes examples crash on macos #453

Closed
fernandolguevara opened this issue Jul 11, 2024 · 5 comments
Closed

Latest changes makes examples crash on macos #453

fernandolguevara opened this issue Jul 11, 2024 · 5 comments

Comments

@fernandolguevara
Copy link

fernandolguevara commented Jul 11, 2024

@hassandraga

Latest changes makes examples crash on macos
image

@hassandraga
Copy link
Member

Can you please try last commit?
If issue still exist, please run make debug && ./main, then share the logs.

@fernandolguevara
Copy link
Author

fernandolguevara commented Jul 11, 2024

@hassandraga

it seems static lib name changed

ld: library 'webui-2-static' not found

@hassandraga
Copy link
Member

If you want to build examples in debug mode, you should also build first the library in debug mode.

cd webui
make debug
cd examples/C/minimal
make debug

@fernandolguevara
Copy link
Author

@hassandraga here you have the output on debug mode

(base) ➜  minimal git:(main) make debug && ./main
Build C Example (clang debug static)...
Build C Example (clang debug dynamic)...
Done.
[User] webui_new_window()
[User] webui_get_new_window_id()
[Core]          WebUI v2.5.0-beta.2 (Apple macOS, Clang, Non-Encrypted)
[Core]          _webui_init()
[Core]          _webui_get_current_path()
[Core]          _webui_malloc([1024])
[Core]          _webui_ptr_add(0x0x135012400)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x135012400) -> Allocate 2048 bytes
[Core]          _webui_malloc([1024])
[Core]          _webui_ptr_add(0x0x135012c00)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x135012c00) -> Allocate 2048 bytes
[User] webui_new_window_id([1])
[Core]          _webui_malloc([8448])
[Core]          _webui_ptr_add(0x0x135013400)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x135013400) -> Allocate 16384 bytes
[Core]          _webui_malloc([1024])
[Core]          _webui_ptr_add(0x0x135017400)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x135017400) -> Allocate 2048 bytes
[Core]          _webui_malloc([1024])
[Core]          _webui_ptr_add(0x0x135017c00)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x135017c00) -> Allocate 2048 bytes
[User] webui_bind([1])
[Core]          _webui_get_cb_index([1])
[Core]          _webui_get_cb_index() -> Element: [__webui_core_api__]
[Core]          _webui_get_cb_index() -> Not found
[Core]          _webui_malloc([18])
[Core]          _webui_ptr_add(0x0x1348054b0)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x1348054b0) -> Allocate 32 bytes
[User] webui_bind() -> Save bind at 0
[Core]          _webui_send_all()
[User] webui_new_window_id() -> New window #1 @ 0x0x135013400
[User] webui_show([1])
[Core]          _webui_show([1])
[Core]          _webui_malloc([73])
[Core]          _webui_ptr_add(0x0x1348054d0)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x1348054d0) -> Allocate 128 bytes
[Core]          _webui_is_valid_url([<html><h...])
[Core]          _webui_show() -> Embedded HTML:
- - -[HTML]- - - - - - - - - -
<html><head><script src="webui.js"></script></head> Hello World ! </html>
- - - - - - - - - - - - - - - -
[Core]          _webui_show_window(HTML, [1])
[Core]          _webui_get_free_port()
[Core]          _webui_port_is_used([26340])
[Core]          _webui_socket_test_listen_mg([26340])
[Core]          _webui_malloc([64])
[Core]          _webui_ptr_add(0x0x134805550)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x134805550) -> Allocate 128 bytes
[Core]          _webui_malloc([32])
[Core]          _webui_ptr_add(0x0x134904080)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x134904080) -> Allocate 64 bytes
[Core]          _webui_malloc([22])
[Core]          _webui_ptr_add(0x0x1349040c0)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x1349040c0) -> Allocate 32 bytes
[Core]          _webui_wv_show([http://localhost:26340])
[ObjC]                  _webui_macos_wv_new([1])
[ObjC]                  _webui_macos_wv_new([1]) -> Creating NSApplication and AppDelegate
[ObjC]                  _webui_macos_wv_set_close_cb()
[Core]          _webui_malloc([22])
[Core]          _webui_ptr_add(0x0x12080b400)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x12080b400) -> Allocate 32 bytes
[Core]          _webui_malloc([40])
[Core]          _webui_ptr_add(0x0x12080b420)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x12080b420) -> Allocate 64 bytes
[ObjC]                  _webui_macos_wv_show([1])
[ObjC]                  _webui_macos_wv_show([1]) -> url: [http://localhost:26340]
[ObjC]                  _webui_macos_wv_show([1]) -> x: [100]
[ObjC]                  _webui_macos_wv_show([1]) -> y: [100]
[ObjC]                  _webui_macos_wv_show([1]) -> width: [800]
[ObjC]                  _webui_macos_wv_show([1]) -> height: [600]
[Core]          _webui_timer_start()
[Core]          [Thread .] _webui_webview_thread()
[Core]          _webui_dereference_win_ptr()
[Core]          _webui_show_window() -> WebView Found
[Core]          _webui_free_mem(0x0x1349040c0)
[Core]          _webui_free_mem(0x0x1349040c0) -> Free 32 bytes
[Core]          _webui_show_window() -> Waiting for window connection
[Core]          _webui_timer_start()
[Core]          _webui_server_thread()
[Core]          _webui_dereference_win_ptr()
[Core]          _webui_server_thread([1]) -> URL: [http://localhost:26340]
[Core]          _webui_malloc([64])
[Core]          _webui_ptr_add(0x0x12080b4e0)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x12080b4e0) -> Allocate 128 bytes
[Core]          _webui_server_thread([1]) -> Listening Success
[Core]          _webui_server_thread([1]) -> HTTP/WS Port: 127.0.0.1:26340
[Core]          _webui_server_thread([1]) -> Root path: .
[Core]          _webui_server_thread([1]) -> Timeout is 15 seconds
[Core]          _webui_server_thread([1]) -> Waiting for connection
[Core]          _webui_timer_start()
[ObjC]                  _webui_macos_wv_show([1]) -> dispatch_async
[Core]          _webui_http_handler()
[Core]          _webui_dereference_win_ptr()
[Core]          _webui_http_handler() -> GET [/]
[Core]          _webui_get_cookies()
[Core]          _webui_http_handler() -> Client cookies []
[Core]          _webui_client_cookies_get_id()
[Core]          _webui_http_handler() -> Client ID not found
[Core]          _webui_http_handler() -> Embedded Index HTML
[Core]          _webui_http_send([1])
[Core]          _webui_http_send_header([1])
[Core]          _webui_http_send_header() -> mime_type: [text/html]
[Core]          _webui_http_send_header() -> body_len: [73]
[Core]          _webui_http_send_header() -> cache: [0]
[Core]          _webui_get_cookies()
[Core]          _webui_generate_cookies()
[Core]          _webui_client_cookies_save()
[Core]          _webui_malloc([33])
[Core]          _webui_ptr_add(0x0x133782750)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x133782750) -> Allocate 64 bytes
[Core]          _webui_http_send() -> New auth cookies [1_OFFVXOfG16whhhkqwpfepdRTPrtmhsU]
---[ HTTP Header ]-----------------
HTTP/1.1 200 OK
Set-Cookie: webui_auth=1_OFFVXOfG16whhhkqwpfepdRTPrtmhsU; Path=/; HttpOnly; SameSite=Strict
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0
Content-Type: text/html
Content-Length: 73
Connection: close


-----------------------------------
[Core]          _webui_http_handler() -> HTTP Status Code: 200
[Core]          _webui_http_handler()
[Core]          _webui_dereference_win_ptr()
[Core]          _webui_http_handler() -> GET [/webui.js]
[Core]          _webui_get_cookies()
[Core]          _webui_http_handler() -> Client cookies [1_OFFVXOfG16whhhkqwpfepdRTPrtmhsU]
[Core]          _webui_client_cookies_get_id()
[Core]          _webui_http_handler() -> Client ID found [0]
[Core]          _webui_http_handler() -> WebUI-Bridge
[Core]          _webui_generate_js_bridge()
[Core]          _webui_malloc([14812])
[Core]          _webui_ptr_add(0x0x13584de00)
[Core]          _webui_ptr_exist()
[Core]          _webui_ptr_add(0x0x13584de00) -> Allocate 16384 bytes
[Core]          _webui_http_send([1])
[Core]          _webui_http_send_header([1])
[Core]          _webui_http_send_header() -> mime_type: [application/javascript]
[Core]          _webui_http_send_header() -> body_len: [14716]
[Core]          _webui_http_send_header() -> cache: [0]
[Core]          _webui_get_cookies()
[Core]          _webui_client_cookies_get_id()
[1]    91650 trace trap  ./main

hassandraga added a commit that referenced this issue Jul 12, 2024
@hassandraga
Copy link
Member

Thank you @fernandolguevara for reporting this, I appreciate it.
Fixed (0826a2c).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants