<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p><span id="ms-rterangepaste-start"></span></p>
<div>
<div>Hello,<br>
<br>
I faced with issue when while loading module and registering classes/categories/protocols, some protocol has corrupted fields, and gnustep-libobjc2 doesn't recognize it.<br>
<br>
<br>
I've used clang 3.9.1 <span>compiler</span> and libobjc2 is based on <a href="https://github.com/gnustep/libobjc2" target="_blank" id="LPlnk644038" class="x_OWAAutoLink" previewremoved="true">
https://github.com/gnustep/libobjc2.</a><br>
target is arm-linux-gnueabi<br>
<br>
During protocol initialization, initiated from <span>.objc_load_function<br>
<br>
I found following protocol in some of our compiled modules:<br>
<br>
it's in isEmptyProtocol<br>
<br>
<div>p *p2<br>
$1 = {isa = 0xb1f9ef88 <_OBJC_CLASS_Protocol2>, name = 0xb6e95115 "AVPlayerItemOutputPushDelegate", protocol_list = 0xb86cf000, instance_methods = 0xb86cf008,
<br>
class_methods = 0xb86cf008, optional_instance_methods = 0xb86cf008, optional_class_methods = 0xb86cf008, properties = 0x2, optional_properties = 0xb6f5d65e}</div>
<br>
As you can see field <span>properties ha</span>s value 0x2, sometimes it's 0xe, sometime 0x1.<br>
<br>
</span>To exclude probability of runtime corruption I checked binary disassembler and found 0xe on the<br>
referenced offset.<br>
<br>
.data:023B2538 unk_23B2538 DCB 3 ; DATA XREF: .data:023B2528o<br>
.data:023B2539 DCB 0<br>
.data:023B253A DCB 0<br>
.data:023B253B DCB 0<br>
.data:023B253C DCD aAvplayeritemou ; "AVPlayerItemOutputPushDelegate"<br>
.data:023B2540 DCD unk_34B2F70<br>
.data:023B2544 DCD unk_34B2F78<br>
.data:023B2548 DCD unk_34B2F78<br>
.data:023B254C DCD unk_34B2F78<br>
.data:023B2550 DCD unk_34B2F78<br>
.data:023B2554 unk_23B2554 DCB 0xE ; DATA XREF: .data:023B06F0o<br>
.data:023B2555 DCB 0<br>
.data:023B2556 DCB 0<br>
.data:023B2557 DCB 0<br>
<br>
<span>So looks like it's compiler issue</span>, but it appears in that case after applying -flto optimization.<br>
Before that I faced with issue when <span>optional_properties</span> was 0x1, as I know both properties and optional_properties is pointers.<br>
<br>
Unfortunately, I don't have minimal compiled sample for that issue. I tried to search the same issue in bugzilla, but didn't find something about it.<br>
</div>
<div><br>
</div>
</div>
<span id="ms-rterangepaste-end"></span><br>
<p></p>
</div>
</body>
</html>