Comments (13)
Ah I get it now. Since mimalloc defines malloc_good_size
as an override in src/alloc-override.c
the nm
method will find it and configure assuming that malloc_good_size
is defined -- but then it is never defined in any header file (since mimalloc only defines it as an override), which leads to the compile errors.
so, at least malloc_good_size
is now in mimalloc-override.h
, but otherwise it is a config issue for Perl, not much we can do.
from mimalloc.
You might be using an old mimalloc version, I can see it from the v1.7.3 tag.
from mimalloc.
No, this is not so, even the master file does not define malloc_good_size, just like I do in /usr/include, the problem is that in my system with Musl there is no definition of these two functions, but I link the entire system with mimalloc, and mimalloc added T symbols of these two functions to the gdbm library, but the system does not provide any way to import it, since there is no definition in the header files, I defined it myself and forced it to be imported into perl, after which everything compiled
from mimalloc.
I do not get it, malloc_good_size is for macos isn't it ?
from mimalloc.
I do not get it, malloc_good_size is for macos isn't it ?
Yes, this is it, but musl in malloc.h does not have these two functions, but during static linking with mimalloc these two symbols appear in so, malloc_size is defined, but malloc_good_size is not
from mimalloc.
Fair enough I can reproduce it with master on my alpine instance.
from mimalloc.
malloc_good_size
is overridden in src/override.c
-- I think you just mean that malloc_good_size
is not defined in het include/mimalloc_override.h
right? I'll add a definition there as well :-)
from mimalloc.
@daanx when I compile perl5, same goes with malloc_good_size
av.c: In function 'Perl_av_extend_guts':
perl.h:5332:47: warning: implicit declaration of function 'malloc_size' [-Wimplicit-function-declaration]
5332 | # define Perl_safesysmalloc_size(where) malloc_size(where)
| ^~~~~~~~~~~
av.c:137:22: note: in expansion of macro 'Perl_safesysmalloc_size'
137 | newmax = Perl_safesysmalloc_size((void*)*allocp) /
| ^~~~~~~~~~~~~~~~~~~~~~~
cc -c -DPERL_CORE -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -O2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -Wno-use-after-free run.c
cc -c -DPERL_CORE -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -O2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -Wno-use-after-free pp_hot.c
cc -c -DPERL_CORE -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -O2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -Wno-use-after-free sv.c
In file included from perl.h:4530,
from sv.c:32:
sv.c: In function 'Perl_sv_usepvn_flags':
perl.h:5332:47: warning: implicit declaration of function 'malloc_size' [-Wimplicit-function-declaration]
5332 | # define Perl_safesysmalloc_size(where) malloc_size(where)
| ^~~~~~~~~~~
sv.h:1541:50: note: in definition of macro 'SvLEN_set'
1541 | (((XPV*) SvANY(sv))->xpv_len = (val)); } STMT_END
| ^~~
sv.c:5215:19: note: in expansion of macro 'Perl_safesysmalloc_size'
5215 | SvLEN_set(sv, Perl_safesysmalloc_size(ptr));
from mimalloc.
@devnexen this is on Alpine with musl right? As I understand, musl does not define malloc_size
or malloc_good_size
in a header file. So, we need to include the mimalloc_override.h
somehow to give a definition. In a way this is a Perl5 config bug? Or maybe I mistunderstand the problem?
from mimalloc.
yes alpine linux. is mimalloc-override.h designed to be a public header ? if yes then it might solve the issue.
from mimalloc.
Yes, mimalloc-override.h
(and mimalloc-new-delete.h
and mimalloc.h
) is designed as a public header. It is meant for overriding statically by macros if one controls all sources. Including it for Perl5 would define malloc_good_size
as mi_malloc_good_size
and thus provide a definition. (but not sure how perl5 would include this header and if that would make sense -- if linking with mimalloc we may just as well directly define Perl_safesysmalloc_size
as mi_malloc_size
etc.)
from mimalloc.
What seems to work for me. I went through patiently all the questions of the Configure script and it does ask if we want to use nm to check symbols. default is yes. if I say no then it builds.
from mimalloc.
Ah I get it now. Since mimalloc defines
malloc_good_size
as an override insrc/alloc-override.c
thenm
method will find it and configure assuming thatmalloc_good_size
is defined -- but then it is never defined in any header file (since mimalloc only defines it as an override), which leads to the compile errors.so, at least
malloc_good_size
is now inmimalloc-override.h
, but otherwise it is a config issue for Perl, not much we can do.
Thank you! This change makes it possible to specify the -includemimalloc-override.h flag to the compiler and everything will work as expected, at least while this problem exists
from mimalloc.
Related Issues (20)
- `unix/prim.c` uses deprecated Apple `TARGET_` symbols HOT 1
- Patching a 32-bit image with `minject` doesn't tell you to use `minject32`. HOT 1
- Segment check range exceeds 40TB for asan builds HOT 1
- Test 'malloc-nomem1' failure on 32-bit architectures after v2.1.4 HOT 1
- 2.1.4 Failure build for ppc64le error: โ__builtin_thread_pointerโ is not supported on this target HOT 12
- 2.1.4 and error mingw/msys2 HOT 4
- 2.1.4: build fail on centos7 HOT 7
- CMake install with namespace and add corresponding alias targets HOT 2
- Rss memory usage increase in version 2.1.4 HOT 2
- Add dllhook mode HOT 1
- oversize allocation in mi_heap_malloc_zero_aligned_at HOT 6
- Concurrency bugs that cause hanging HOT 2
- Intermittent VirtualAlloc failure while the pagefile is growing HOT 1
- Tests fail on armhf and armv7 on Alpine Linux (musl libc) since mimalloc 2.1.4 & 1.8.4 HOT 4
- [suggestion] add a comment at the declaration of `mi_arena_t` for easier custom modify HOT 1
- Can't compile v2.1.6 tag on Ubuntu 22.04.LTS HOT 3
- Is it ok that `ld-linux-x86-64.so.2` `Scrt1.o` `crti.o` and `crtbeginS.o` is located before `mimalloc.o` in the linker commandline when static override malloc? HOT 1
- Inconsistent output naming of `mimalloc.dll` HOT 3
- 2.1.4: crash in mi_segment_try_purge during mi_process_done HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mimalloc.