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

g_uri_join_internal assertion error on Uri::build #1633

Closed
d47081 opened this issue Jan 18, 2025 · 1 comment
Closed

g_uri_join_internal assertion error on Uri::build #1633

d47081 opened this issue Jan 18, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@d47081
Copy link

d47081 commented Jan 18, 2025

Not sure if this is bug,

Uri::build(
    UriFlags::NONE,
    "gemini",
    None,
    Some("tlgs.one"),
    -1,
    "search",  // < requires slash at begin (e.g. /search)
    Some(&Uri::escape_string(query, None, false)),
    None,
)
GLib-CRITICAL **: 08:37:15.596: g_uri_join_internal: assertion 'host == NULL || (path[0] == '\0' || path[0] == '/')' failed
thread 'main' panicked

Only if the begining slash not provided for path

[dependencies.gtk]
package = "gtk4"
version = "0.9.4"
features = ["gnome_46"]
@d47081 d47081 added the bug Something isn't working label Jan 18, 2025
@sdroege
Copy link
Member

sdroege commented Jan 21, 2025

The above code is not complete (what's query?) and does not panic by itself either when fixing that. Please provide complete testcases in the future.

I assume the reason why it panics for you is that you try to use the Display impl of glib::Uri? That indeed panics and I think this can be considered a bug in GLib. Please report it over there: https://gitlab.gnome.org/GNOME/glib/-/issues/new

g_uri_to_string() claims to never return NULL and g_uri_build() neither, and this constraint for the path is not documented anywhere. Unclear what the correct way forward is, but something needs to be fixed and if it's the documentation.

Please add a comment here with the link to the issue you created for future reference, thanks!

@sdroege sdroege closed this as completed Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants