gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash on Linux+Clang (NSTimer)


From: Riccardo Mottola
Subject: Re: Crash on Linux+Clang (NSTimer)
Date: Thu, 12 Nov 2020 00:26:48 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.4

David Chisnall wrote:
This one is slightly more complicated because we're passing the address of `self` in the argument frame into slowMsgLookup, so our stack looks something like this:

{ other args }
_cmd
self
return address from objc_msgSend
_cmd
&self (the stored version a little way up the stack)

To fix this, we need to add 4 bytes of padding before the second copy of _cmd.

I think the simplest way to do that is duplicate the push %ecx. We then also need to fix the CFI directive and the add that does the stack restore to compensate for the extra 4 bytes:


```
    mov   \sel(%esp), %ecx
    lea   \receiver(%esp), %eax

    push  %ecx                           # Unused, stack alignment
    push  %ecx                           # _cmd
    push  %eax                           # &self
    .cfi_def_cfa_offset 16
    call  CDECL(slowMsgLookup)@PLT
    add   $12, %esp                      # restore the stack
```

Does that fix it for you?  If so, please can you raise a PR with that change in it?

It improves things definitely. Now gui apps start again.
Here the test-suite results:

76% tests passed, 44 tests failed out of 186

That's exactly the same number as before and the tests still fail, even if in "real world" things improved? That's mysterious.

I tried starting Ink and more complex GWorkspace, Gorm, GNUMail, they all come up, load bundles, etc. So I think it is better than before and branched.

        Start 125: objc_msgSend
125/186 Test #125: objc_msgSend ......................................Child aborted***Exception: 0.00 sec
        Start 126: objc_msgSend_optimised
126/186 Test #126: objc_msgSend_optimised ............................Child aborted***Exception:   0.00 sec
        Start 127: objc_msgSend_legacy
127/186 Test #127: objc_msgSend_legacy ...............................Child aborted***Exception:   0.00 sec
        Start 128: objc_msgSend_legacy_optimised
128/186 Test #128: objc_msgSend_legacy_optimised .....................Child aborted***Exception:   0.00 sec


How can I give you more details on these (and the other) failures? there are quite a lot.

I don't know what differs from your setup, mine should be pretty "standard" in my intentions.

ccmake . shows I am using clang:

 CMAKE_CXX_COMPILER               /usr/lib/llvm/10/bin/clang++

and gnustep make:
./configure --prefix=/ --with-layout=gnustep --with-library-combo=ng-gnu-gnu


Thanks,
Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]