Subject: Re: sa_register() in chroot: regression since newlock2 merge
To: None <current-users@netbsd.org>
From: haad <haaaad@gmail.com>
List: current-users
Date: 04/26/2007 19:04:05
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jukka Salmi wrote:
> Hi,
> 
> since newlock2 was merged to HEAD building the OpenLDAP client package
> (and probably others) from pkgsrc in a netbsd-3 chroot environment on
> a -current NetBSD system fails because the configure script can't
> "locate usable POSIX Threads". The relevant configure code snippet of
> the failing test program is attached.
> 
> $ gcc -g -O2 -lpthread -o conftest2 conftest2.c
> $ ktrace ./conftest2
> Bad system call (core dumped)

yes binary compatibility between netbsd-3 and HEAD was broken after newlock2
branch merge.

> # gdb ./conftest2 conftest2.core 
> GNU gdb 5.3nb1
> [...]
> Core was generated by `conftest2'.
> Program terminated with signal 12, Bad system call.
> [...]
> #0  0xbbb3559f in sa_register () from /usr/lib/libc.so.12
> [...]
> (gdb) bt
> #0  0xbbb3559f in sa_register () from /usr/lib/libc.so.12
> #1  0xbbbe26d4 in pthread__sa_start () from /usr/lib/libpthread.so.0
> #2  0xbbbe5c20 in pthread_init () from /usr/lib/libpthread.so.0
> #3  0xbbbe6159 in pthread_create () from /usr/lib/libpthread.so.0
> #4  0x0804880f in main (argc=1, argv=0xbfbfeae4) at conftest2.c:31
> #5  0x080485f6 in ___start ()
> (gdb) quit
> 
> # kdump | tail
>   4890 conftest2 CALL  mprotect(0xbb201000,0x1000,0)
>   4890 conftest2 RET   mprotect 0
>   4890 conftest2 CALL  getcontext(0xbfbfe390)
>   4890 conftest2 RET   getcontext 0
>   4890 conftest2 CALL  __sysctl(0xbfbfe568,2,0xbfbfe560,0xbfbfe564,0,0)
>   4890 conftest2 RET   __sysctl 0
>   4890 conftest2 CALL  sa_register
>   4890 conftest2 RET   sa_register -1 errno 78 Function not implemented
>   4890 conftest2 PSIG  SIGSYS SIG_DFL
>   4890 conftest2 NAMI  "conftest2.core"
> 
> 
> Is it possible to get this working again, as it did with prae-newlock2
> kernels? Some compatibility option maybe?

yes if you write some patches :) which implement backward compatible M:N posix
thread library.

Regards
- ---------------------------------------------------------------
Adam Hamsik
ICQ 249727910
jabber haad@jabber.org
- ---------------------------------------------------------------
There are 10 kinds of people in the world. Those who understand
binary numbers, and those who don't.
				
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGMNuE9Wt2FT7y228RAsavAKCFmFgVGsqx8LYkr4VbQyHIgKOA2wCghJSx
rzD0r4rkHPRluafw0urYcVI=
=blG2
-----END PGP SIGNATURE-----