Discussion:
Symbols from new jemalloc not found
(too old to reply)
Ryo ONODERA
2024-09-26 03:48:12 UTC
Permalink
Hi,

On NetBSD/amd64-current of today with new jemalloc,
linking to jemalloc always returns undefined references.
This problem causes build failures of pkgsrc/www/firefox
and misc/libreoffice at least.

Could anyone take a look at this problem?

The following is my simple test case.

$ cat test.c
int
main(void)
{
return 0;
}

$ gcc test.c -ljemalloc
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sdallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctl'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_rallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_stats_print'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctlnametomib'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_message_set'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_xallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctlbymib'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_dallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_message_get'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_conf_get'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_nallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_usable_size'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_conf_set'


Thank you.
--
Ryo ONODERA // ***@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB FD1B F404 27FA C7D1 15F3

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Rin Okuyama
2024-09-26 07:19:36 UTC
Permalink
Hi,

It seems due to our local change:

https://mail-index.netbsd.org/source-changes/2019/03/12/msg104255.html

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/bsd/jemalloc/include/jemalloc/jemalloc.h.diff?r1=1.5&r2=1.6&f=h

lost during merge for 5.3.

Thanks,
rin

P.S.
Good news is that fallout for ATF from 5.3 has been
fixed by the latest commit by christos@:

https://releng.netbsd.org/b5reports/i386/

Thanks!!
Post by Ryo ONODERA
Hi,
On NetBSD/amd64-current of today with new jemalloc,
linking to jemalloc always returns undefined references.
This problem causes build failures of pkgsrc/www/firefox
and misc/libreoffice at least.
Could anyone take a look at this problem?
The following is my simple test case.
$ cat test.c
int
main(void)
{
return 0;
}
$ gcc test.c -ljemalloc
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sdallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctl'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_rallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_stats_print'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctlnametomib'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_message_set'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_xallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctlbymib'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_dallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_message_get'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_conf_get'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_nallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_usable_size'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_conf_set'
Thank you.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ryo ONODERA
2024-09-26 11:04:15 UTC
Permalink
Hi,
Post by Rin Okuyama
Hi,
https://mail-index.netbsd.org/source-changes/2019/03/12/msg104255.html
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/bsd/jemalloc/include/jemalloc/jemalloc.h.diff?r1=1.5&r2=1.6&f=h
lost during merge for 5.3.
I have added some #defines to jemalloc.h and I have no good effect.


I have built jemalloc and jemalloc.old and __je_* are not identified as FUNC.
They are NOTYPE.

This may be problem.

$ readelf -Wa lib/jemalloc_stub.o | grep dallocx
0000000000000015 0000000c00000004 R_X86_64_PLT32 0000000000000000 __je_dallocx - 4
000000000000001a 0000000e00000004 R_X86_64_PLT32 0000000000000000 __je_sdallocx - 4
11: 0000000000000014 5 FUNC GLOBAL DEFAULT 1 dallocx
12: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __je_dallocx
13: 0000000000000019 5 FUNC GLOBAL DEFAULT 1 sdallocx
14: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __je_sdallocx
Post by Rin Okuyama
Thanks,
rin
P.S.
Good news is that fallout for ATF from 5.3 has been
https://releng.netbsd.org/b5reports/i386/
Thanks!!
Post by Ryo ONODERA
Hi,
On NetBSD/amd64-current of today with new jemalloc,
linking to jemalloc always returns undefined references.
This problem causes build failures of pkgsrc/www/firefox
and misc/libreoffice at least.
Could anyone take a look at this problem?
The following is my simple test case.
$ cat test.c
int
main(void)
{
return 0;
}
$ gcc test.c -ljemalloc
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sdallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctl'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_rallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_stats_print'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctlnametomib'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_message_set'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_xallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallctlbymib'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_dallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_message_get'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_conf_get'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_nallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_mallocx'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_usable_size'
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_malloc_conf_set'
Thank you.
--
Ryo ONODERA // ***@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB FD1B F404 27FA C7D1 15F3

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Taylor R Campbell
2024-09-26 11:28:07 UTC
Permalink
Date: Thu, 26 Sep 2024 12:48:12 +0900
On NetBSD/amd64-current of today with new jemalloc,
linking to jemalloc always returns undefined references.
This problem causes build failures of pkgsrc/www/firefox
and misc/libreoffice at least.
[...]
$ gcc test.c -ljemalloc
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sdallocx'
[...]
We should create expected-symbols files for all these libraries so
this doesn't happen again by accident.

libc may be a lot of work (probably more than libm) but once the work
is done it will be easy to keep up to date and it will be invaluable
for preventing this class of mistake in the future -- especially on
release branches.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ryo ONODERA
2024-09-26 12:24:46 UTC
Permalink
Hi,
Post by Taylor R Campbell
Date: Thu, 26 Sep 2024 12:48:12 +0900
On NetBSD/amd64-current of today with new jemalloc,
linking to jemalloc always returns undefined references.
This problem causes build failures of pkgsrc/www/firefox
and misc/libreoffice at least.
[...]
$ gcc test.c -ljemalloc
ld: /usr/lib/libjemalloc.so: undefined reference to `__je_sdallocx'
[...]
We should create expected-symbols files for all these libraries so
this doesn't happen again by accident.
libc may be a lot of work (probably more than libm) but once the work
is done it will be easy to keep up to date and it will be invaluable
for preventing this class of mistake in the future -- especially on
release branches.
On NetBSD/amd64 10, I have no undefined references.
/usr/lib/libjemalloc.so.0 on NetBSD/amd64 10 has same U symbols too.

My expectation is st_info for symbol type.
Problematic symbols are STT_NOTYPE (st_info).
It should be STT_FUNC.

However I do not know how to modify symbol type.

Thank you.
--
Ryo ONODERA // ***@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB FD1B F404 27FA C7D1 15F3

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christos Zoulas
2024-09-26 14:10:22 UTC
Permalink
Post by Rin Okuyama
Hi,
https://mail-index.netbsd.org/source-changes/2019/03/12/msg104255.html
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/bsd/jemalloc/include/jemalloc/jemalloc.h.diff?r1=1.5&r2=1.6&f=h
lost during merge for 5.3.
Should be fixed now.

christos

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ryo ONODERA
2024-09-27 12:32:02 UTC
Permalink
Post by Christos Zoulas
Post by Rin Okuyama
Hi,
https://mail-index.netbsd.org/source-changes/2019/03/12/msg104255.html
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/bsd/jemalloc/include/jemalloc/jemalloc.h.diff?r1=1.5&r2=1.6&f=h
lost during merge for 5.3.
Should be fixed now.
christos
Hi,

Thanks for your quick fix.
My test case, www/firefox and misc/libreoffice build fine for me.
--
Ryo ONODERA // ***@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB FD1B F404 27FA C7D1 15F3

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Rin Okuyama
2024-09-27 12:21:58 UTC
Permalink
Thanks! `cc test.c -ljemalloc` works for me :)

rin
Post by Christos Zoulas
Post by Rin Okuyama
Hi,
https://mail-index.netbsd.org/source-changes/2019/03/12/msg104255.html
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/bsd/jemalloc/include/
jemalloc/jemalloc.h.diff?r1=1.5&r2=1.6&f=h
lost during merge for 5.3.
Should be fixed now.
christos
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...