[Bug default/31642] miss-categorizing of incompatible changes on functions
dodji at seketeli dot org
sourceware-bugzilla@sourceware.org
Fri Feb 21 11:59:56 GMT 2025
https://sourceware.org/bugzilla/show_bug.cgi?id=31642
Dodji Seketeli <dodji at seketeli dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ABI break for tree-sitter |miss-categorizing of
|not reported as a breaking |incompatible changes on
|change by abidiff |functions
--- Comment #8 from Dodji Seketeli <dodji at seketeli dot org> ---
Work on this issue is happening in a branch that can be browsed at
https://sourceware.org/cgit/libabigail/commit/?h=users/dodji/PR31642.
That branch can already be tested and should report improvements compared to
the current status on the mainline. The work is still in progress however.
So, here is an update of what I understand is happening.
Once the libabigail's middle-end has computed the graph of changes (aka diff
nodes graph, aka DNG), there are passes that walk the DNG to categorize each
change (aka diff node, aka DN).
The final reporting pass then reports the changes carried by each diff node
which category is deemed "potentially harmful". Changes carried by diff nodes
categorized as "harmless" are not reported; they are filtered out by default.
A "potentially harmful" change can fall into two groups :
1/ changes that are incompatible (ABI breaks)
2/ changes that might not be incompatible and thus require user review to be
eventually categorized.
If there is at least one change categorized as belonging to group 1/, then
abidiff must return an exit code (which is a bit-field) in which the bit
ABIDIFF_ABI_INCOMPATIBLE_CHANGE is set to 1, as described at
https://sourceware.org/libabigail/manual/abidiff.html#return-values. The value
of ABIDIFF_ABI_INCOMPATIBLE_CHANGE is 8.
The problem that is being currently reported is that a diff node that describes
a change in a function that takes or returns struct TSQueryCursor (not a
pointer to the struct) is not categorized as being in the group 1, even though
the change is an incompatible one. More precisely, it's an incompatible change
to struct TSQueryCursor which changes the layout of that struct.
Libabigail detects that change but wrongly categorizes it into group 2.
abidiff thus returns an exit code where only the bit ABIDIFF_ABI_CHANGE (of
value 4) is set.
We must thus teach the middle-end to categorize (incompatible) changes to the
layout of return type of a function as being an incompatible change to the
function.
I suspect something similar must be done for global variables as well.
I have changed the summary of the bug to reflect this analysis.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Libabigail
mailing list