Hi David,

David Chisnall wrote:

On 18 Jun 2020, at 12:52, Riccardo Mottola <riccardo.mott...@libero.it> wrote:

you guessed correctly and the protocol is also a very common one, NSCopying
So, part of the question is whether this is the first time we’re seeing this or 
not.  Can you stick a watchpoint on the isa pointer and restart it, see if it’s 
modified before here?

as simple as this?
(gdb) watch aProto->isa
Hardware watchpoint 4: aProto->isa

I rerun the program but it fails through to the crash - so it appears that it does not het changed, or I did not set it correct.


That’s very odd.  Here’s the definition of the enum:

https://github.com/gnustep/libobjc2/blob/369c84db35a6a1e94f8a4689a695fabdac056166/protocol.h#L26

The isa pointer for each protocol is initially set to one of those enum values 
(2, 3, or 4) by the compiler and is then set to a proper Objective-C class.  It 
should never end up 0.  It’s possible that something has corrupted memory or 
that we’ve just read the low 32 bits this has been set to a 64-bit address that 
happens to have nothing in the low 32 bits, but it seems quite unlikely.


I see, this is very strange. What is "really" strange is that that this is amd64 bit architecture and a known compiler, the same code works on FreeBSD (and Linux IIRC). NetBSD would make the difference? or that this is "genuine AMD" and not intel? would be very strange.


I confirm OLDABI_COMPAT is on. I did not touch it. LEGACY_COMPAT is off.

I only changed the linker option and then the build type.

Further question: this is a from-scratch install, all compiled with the same 
version of clang, can I assume that all libraryes have the same ABI or not? 
maybe there is a makefile issue somewhere?
Should be.  You can see if __objc_exec_class is called - that’s the entry point 
used by old ABI code.

(gdb) b __obj_exec_class
Function "__obj_exec_class" not defined.

Apparently it is not even defined, but this is strange, since I compiled with OLDABI_COMPAT:

I tried being more explicit:
(gdb) b loader.c:328
Breakpoint 3 at 0x72b92fe1859f: file /home/multix/code/gnustep-vcs/libobjc2/loader.c, line 330.

and re-run the program, it does not get into that function, so we can assume it is new code.

Riccardo

Reply via email to