flat assembler
Message board for the users of flat assembler.

Index > Unix > to report malloc bug in fasmg on macOS

Author
Thread Post new topic Reply to topic
Melissa



Joined: 12 Apr 2012
Posts: 124
Melissa
Latest Monterey beta causes bug in fasmg x64:
bmaxa@Branimirs-Air asmFish % fasmg "x86/fish.asm" "asmfish" -e 100 -i "VERSION_OS='X'" -i "VERSION_POST = 'popcnt'"
Error: not enough memory to complete the assembly.

but:
Code:
bmaxa@Branimirs-Air memtest % cat mem.c
#include <stdlib.h>
#include <stdio.h>

int main(void) {
  for (long int i=4096;;i*=2){
    void *p = malloc(i);
    if (p)free(p);
    else {
      printf("max %ld\n", i);
      break;
    }
  }
}
    

bmaxa@Branimirs-Air memtest % ./mem
max 140737488355328
bmaxa@Branimirs-Air memtest % symbols mem
mem [arm64, 0.250362 seconds]:
9599C034-0152-3550-9A7F-01E288534647 /Users/bmaxa/projects/memtest/mem [AOUT, PIE, FaultedFromDisk, MMap64]
0x0000000000000000 (0x100000000) __PAGEZERO SEGMENT
0x0000000100000000 ( 0x4000) __TEXT SEGMENT
0x0000000100000000 ( 0x3ed8) MACH_HEADER
0x0000000100003ed8 ( 0x74) __TEXT __text
0x0000000100003ed8 ( 0x74) main [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts]
0x0000000100003f4c ( 0x24) __TEXT __stubs
0x0000000100003f4c ( 0xc) DYLD-STUB$$free [DYLD-STUB, LENGTH, NameNList, MangledNameNList, NList]
0x0000000100003f58 ( 0xc) DYLD-STUB$$malloc [DYLD-STUB, LENGTH, NameNList, MangledNameNList, NList]
0x0000000100003f64 ( 0xc) DYLD-STUB$$printf [DYLD-STUB, LENGTH, NameNList, MangledNameNList, NList]
0x0000000100003f70 ( 0x3c) __TEXT __stub_helper
0x0000000100003fac ( 0x9) __TEXT __cstring
0x0000000100003fb8 ( 0x48) __TEXT __unwind_info
0x0000000100004000 ( 0x4000) __DATA_CONST SEGMENT
0x0000000100004000 ( 0x8) __DATA_CONST __got
0x0000000100008000 ( 0x4000) __DATA SEGMENT
0x0000000100008000 ( 0x18) __DATA __la_symbol_ptr
0x0000000100008018 ( 0x8) __DATA __data
0x0000000100008018 ( 0x8) _dyld_private [NameNList, MangledNameNList, NList]
0x000000010000c000 ( 0x4000) __LINKEDIT SEGMENT

so I guess it calls wrong version of malloc, or somehow goes beyond limit.
Macbook Air 13" M1 processor.
Post 18 Sep 2021, 08:04
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7937
Location: Kraków, Poland
Tomasz Grysztar
This most likely means that it was not able to get an allocation in 32-bit addressable space, because this is what it needs to function.
Post 18 Sep 2021, 08:08
View user's profile Send private message Visit poster's website Reply with quote
Melissa



Joined: 12 Apr 2012
Posts: 124
Melissa
Tomasz Grysztar wrote:
This most likely means that it was not able to get an allocation in 32-bit addressable space, because this is what it needs to function.


Worked before on earlier beta versions, should I report this to Apple?

edit:
reported, it is their problem, as it worked before
Post 18 Sep 2021, 08:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.