Bugzilla – Attachment 875255 Details for
Bug 1225754
samba: new non-determinism in 4.20.1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
upstream patch
upstream-pidl.patch (text/plain), 2.48 KB, created by
Noel Power
on 2024-06-01 16:27:16 UTC
(
hide
)
Description:
upstream patch
Filename:
MIME Type:
Creator:
Noel Power
Created:
2024-06-01 16:27:16 UTC
Size:
2.48 KB
patch
obsolete
>From f3433f60b8ee83fc785a6e6838513de31bff5a6a Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Wed, 29 May 2024 12:14:04 +1200 >Subject: [PATCH] pidl:Typelist: resolveType(): don't mistake a reference for a > name > >This function is only used by Python.pm, and was assuming any argument >unrecognised by hasType is a name. It sometimes isn't, resulting in >structures like this: > > { > 'DATA' => { > 'TYPE' => 'STRUCT' > }, > 'NAME' => { > 'TYPE' => 'STRUCT', > 'ALIGN' => undef, > 'SURROUNDING_ELEMENT' => undef, > 'ORIGINAL' => { > 'TYPE' => 'STRUCT', > 'FILE' => 'source3/librpc/idl/smbXsrv.idl', > 'LINE' => 101, > 'NAME' => 'tevent_context' > }, > 'ELEMENTS' => undef, > 'NAME' => 'tevent_context', > 'PROPERTIES' => undef > }, > 'TYPE' => 'TYPEDEF' > }; > >The problem with that is we end up with the HASH reference as a name >in Python bindings, like this > > PyErr_SetString(PyExc_TypeError, "Can not convert C Type struct HASH(0x5e2dfe5ee278) from Python"); > >which makes the build nondeterministic (as well as making the message >a little mysterious). > >I think all the structures for which this happens are marked >'[ignore]' in IDL, meaning they are not transmitted on the wire. They >should perhaps also not have useless Python getsetters, but let's call >that a different problem. > >Thanks to Freexian and the Debian LTS project for sponsoring this work. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13213 > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Reviewed-by: Andrew Bartlett <abartlet@samba.org> >--- > pidl/lib/Parse/Pidl/Typelist.pm | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm >index 31ea19e357c..2a98a16b2b5 100644 >--- a/pidl/lib/Parse/Pidl/Typelist.pm >+++ b/pidl/lib/Parse/Pidl/Typelist.pm >@@ -138,8 +138,18 @@ sub resolveType($) > my ($ctype) = @_; > > if (not hasType($ctype)) { >- # assume struct typedef >- return { TYPE => "TYPEDEF", NAME => $ctype, DATA => { TYPE => "STRUCT" } }; >+ if (! ref $ctype) { >+ # it looks like a name. >+ # assume struct typedef >+ return { TYPE => "TYPEDEF", NAME => $ctype, DATA => { TYPE => "STRUCT" } }; >+ } >+ if ($ctype->{NAME} && ($ctype->{TYPE} eq "STRUCT")) { >+ return { >+ TYPE => "TYPEDEF", >+ NAME => $ctype->{NAME}, >+ DATA => $ctype >+ }; >+ } > } else { > return getType($ctype); > } >-- >2.35.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 1225754
: 875255