buglibsigsegv - Bugs: bug #59539, Detect aarch64 as 64-bit for...

 
 

bug #59539: Detect aarch64 as 64-bit for mach/darwin

Submitter:  None
Submitted:  Wed 25 Nov 2020 02:56:05 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 05 Dec 2020 07:34:11 AM UTC, comment #10: 

Thank you for your report and help in resolving it!

Bruno Haible <haible>
Group administrator
Sat 05 Dec 2020 05:37:53 AM UTC, comment #9: 

Tried libsigsegv-2.13-20201204.tar.gz. "./configure && make && make check" worked.

Anonymous
Fri 04 Dec 2020 11:47:11 AM UTC, comment #8: 

Thank you! I've incorporated the change.

To complete the testing on this platform, could you please try
https://alpha.gnu.org/gnu/libsigsegv/libsigsegv-2.13-20201204.tar.gz
and see whether it works out of the box ("./configure && make && make check")?

Bruno Haible <haible>
Group administrator
Fri 04 Dec 2020 07:47:17 AM UTC, comment #7: 

Adding


new_safe_esp &= -16; /* align */`


to _aarch64_ made all tests pass!

Anonymous
Thu 03 Dec 2020 10:12:13 AM UTC, comment #6: 

Thank you for the logs.

"Exception: 0x1 Code: 0x103" means "SP alignment fault".

Can you, in handler-macos.c, around line 270, replace

#if defined __x86_64__ || defined __i386__
      new_safe_esp &= -16; /* align */
      new_safe_esp -= sizeof (void *); /* make room for (unused) return address slot */
#endif

with

#if defined __aarch64__ || defined __x86_64__ || defined __i386__
      new_safe_esp &= -16; /* align */
#endif
#if defined __x86_64__ || defined __i386__
      new_safe_esp -= sizeof (void *); /* make room for (unused) return address slot */
#endif


and repeat the "make check" for stackoverflow1 ?

If that doesn't succeed, try this:


#if defined __aarch64__ || defined __x86_64__ || defined __i386__
      new_safe_esp &= -16; /* align */
      new_safe_esp -= sizeof (void *); /* make room for (unused) return address slot */
#endif


Bruno Haible <haible>
Group administrator
Thu 03 Dec 2020 07:10:14 AM UTC, comment #5: 

Attached the logs from running `make check TESTS=stackoverflow1` and  `make check TESTS=stackoverflow2`. Since stackoverflow1 hangs I copied the file out before Ctrl+C (which deletes the file). The original file for me was 254M so I only included the first 10000 lines.

(file #50385, file #50386)

Anonymous
Wed 02 Dec 2020 04:24:39 PM UTC, comment #4: 

When you compile the modified libsigsegv with CC="cc -DDEBUG_EXCEPTION_HANDLING", then run "make check", there should be debugging printouts that should help spotting the problems with the stackoverflow tests.

Bruno Haible <haible>
Group administrator
Tue 01 Dec 2020 03:47:54 AM UTC, comment #3: 

#define CFG_FAULT "fault-macos.h"
#define CFG_HANDLER "handler-macos.c"
#define CFG_LEAVE "leave-nop.c"
#define CFG_MACHFAULT "machfault-macos.h"
#define CFG_SIGNALS "signals-macos.h"
#define CFG_STACKVMA "stackvma-mach.c"

Anonymous
Mon 30 Nov 2020 11:58:58 AM UTC, comment #2: 

Excellent! Your patch looks good. I have applied it.

> The tests status is sigsegv[123] passing, stackoverflow1 hangs, stackoverflow2 fails.


Good to know. This will need further investigations. What are the values of
CFG_FAULT
CFG_HANDLER
CFG_LEAVE
CFG_MACHFAULT
CFG_SIGNALS
CFG_STACKVMA
in the generated config.h?

Bruno Haible <haible>
Group administrator
Fri 27 Nov 2020 08:07:26 PM UTC, comment #1: 

Thank you for the patch. But several other files (configure.ac, machfault-macos.h, handler-macos.c) surely need changes as well.

Bruno Haible <haible>
Group administrator
Wed 25 Nov 2020 02:56:05 AM UTC, original submission:  

Some new aarch64 hardware is released recently: https://www.phoronix.com/scan.php?page=article&item=apple-mac-m1&num=1

A patch is attached.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #50385:  stackoverflow1.log.10000 added by None (265KiB - application/octet-stream)
file #50386:  stackoverflow2.log added by None (463B - application/octet-stream)
file #50365:  0001-mach-macos-preliminary-support-for-darwin-arm64.patch added by None (4KiB - application/octet-stream - Done. The tests status is sigsegv[123] passing, stackoverflow1 hangs, stackoverflow2 fails.)
file #50338:  0001-mach-detect-aarch64-as-64-bit.patch added by None (961B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2020-12-05 haible StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2020-12-03 None Attached File- Added stackoverflow1.log.10000, #50385
        Attached File- Added stackoverflow2.log, #50386
    2020-11-30 haible StatusConfirmed In Progress
    2020-11-29 None Attached File- Added 0001-mach-macos-preliminary-support-for-darwin-arm64.patch, #50365
    2020-11-27 haible StatusNone Confirmed
        Assigned toNone haible
    2020-11-25 None Attached File- Added 0001-mach-detect-aarch64-as-64-bit.patch, #50338

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code