gtk_check_version logic is backwards for 1958174's fix
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox141 | --- | fixed |
People
(Reporter: jayisoverhere, Assigned: emilio)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0
Steps to reproduce:
ran firefox 139 with the patch for working around the gtk issue described in 1958174. built with gtk 3 24 49.
Actual results:
buggy behavior still appeared described in 1958174.
Expected results:
the patch works as expected, but the version check (1959565) causes the conditional to incorrectly fail.
https://docs.gtk.org/gtk3/func.check_version.html#return-value
gtk_check_version(3, 24, 50)
return would be 'true' if the version is less then 3 24 50 is the way i read the docs (?)
Updated•3 months ago
|
Reporter | ||
Comment 1•2 months ago
|
||
gdb for ref (testing against version 3 24 49):
p (gchar*)gtk_check_version(3, 24, 50)
(gchar *) 0x7ffff5e98e40 "GTK+ version too old (micro mismatch)"
p (gchar*)gtk_check_version(3, 24, 49)
(gchar *) 0x0p (gchar*)gtk_check_version(3, 24, 49)
(gchar *) 0x0
p ((gchar(*)())gtk_check_version)(3, 24, 50)
64 '@'
p ((gchar(*)())gtk_check_version)(3, 24, 49)
0 '\000'
Reporter | ||
Comment 2•2 months ago
|
||
also, pinging :emilio since i see activity on the OG report, but i cannot comment there.
Reporter | ||
Comment 3•2 months ago
|
||
just to add, in nsWindow.cpp there are gtk_check_version calls that compare to nullptr which might be nicer looking since the intent is "more clear"? gtk_check_version(X, X, X) != nullptr
kind of is nicer for "doesnt meet version requirements"
Assignee | ||
Comment 4•2 months ago
|
||
Updated•2 months ago
|
Assignee | ||
Comment 5•2 months ago
|
||
(In reply to jayisoverhere from comment #3)
just to add, in nsWindow.cpp there are gtk_check_version calls that compare to nullptr which might be nicer looking since the intent is "more clear"?
gtk_check_version(X, X, X) != nullptr
kind of is nicer for "doesnt meet version requirements"
That is generally discouraged by our coding style. Maybe an exception could be made here but... In any case it seems I got this wrong because there was another wrong check right above :'(
Assignee | ||
Comment 6•2 months ago
|
||
This is probably why I got the other one wrong as well :(
Assignee | ||
Comment 7•2 months ago
|
||
Maybe we should introduce a clearer bool IsGtkVersionAtLeast(...)
function or something...
Assignee | ||
Comment 8•2 months ago
|
||
The other workaround seems it'd be more problematic to remove. I found that in bug 1775017, but we're no longer using it to implement that API. So I'll do some digging before landing to see where is it causing wrong behavior...
Updated•2 months ago
|
Comment 10•2 months ago
|
||
Reporter | ||
Comment 11•2 months ago
|
||
The other workaround seems it'd be more problematic to remove. I found that in bug 1775017, but we're no longer using it to implement that API. So I'll do some digging before landing to see where is it causing wrong behavior...
i tried looking into this- but got a bit lost anything i can test as far as regressions go?
thanks again for dealing with this corner case issue.
This is probably why I got the other one wrong as well :(
if the function return is already a bit unintuative to the name.... the macro version i think makes i doubly so.
Comment 12•2 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/db31726c9e7c
https://hg.mozilla.org/mozilla-central/rev/f5856b2d895b
Updated•2 months ago
|
Description
•