geteuid hangs in sigsuspend

From: Kai Mosebach <kai.mosebach_at_freshx.de>
Date: Mon, 14 Jul 2003 01:44:29 +0200
Hi,

when i update from 5.0-REL to 5.1-REL / 5.1-CURRENT, using a program
compiled against linuxthreads, might there be a different behaviour in
the geteuid function of libc ?

on my sapdb port the database manager called dbmcli starts fine on
5.0-REL,
on 5.1-REL/CURRENT it hangs on a sigsuspend.

When i use the FreeBSD 5.0 libs on my FreeBSD 5.1 system, the program
runs fine !

Could someone help ?

5.1-CURRENT is from 2003-July-10

Best regards Kai

----------------------------------------------------------
The program output looks like this :

[root_at_devil:/usr/sapdb/src/FreeBSD/sys/src] # dbmcli

HERE 1
HERE 3
canceladdr 0x00000000 component 'dbmcli' 
DBLANG=(null)
SERVERDB=(null)
HERE 3
<here it hangs>

----------------------------------------------------
The code looks like this :

#ifdef FREEBSD_DEBUG
    printf("HERE 3\n");	// 1st one
#endif
    
    en01assignStdFiledescriptors();

    en01CheckForDBUmask ();
    eo46PtoC ( sql01_component , component , COMPSIZ );
    DBG1 (( MF__,"canceladdr 0x%08lx component '%s' \n",
            (long) canceladdr , sql01_component ))

    sql01_dblang = getenv ( "DBLOCALE" );
    if ( sql01_dblang == NULL )
      sql01_dblang = getenv ( "DBLANG" );
    
    DBG1 (( MF__,"DBLANG=%s\n", sql01_dblang ))
    sql01_dbname = getenv ( "SERVERDB" );
    DBG1 (( MF__,"SERVERDB=%s\n", sql01_dbname ))

#ifdef FREEBSD_DEBUG
    printf("HERE 3\n"); // 2nd one
#endif

    uid = geteuid ();
    pwdp = getpwuid ( uid );

#ifdef FREEBSD_DEBUG
    printf("HERE 3\n"); // 3rd one (not appearing)
#endif

------------------------------------------

strace looks like this :

[root_at_devil:/usr/sapdb/src/FreeBSD/sys/src] # strace dbmcli
execve(0xbfbff108, [0xbfbff5cc], [/* 0 vars */]) = 0
mmap(0, 3392, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x281a6000
munmap(0x281a6000, 3392)                = 0
__sysctl([...], 0x281a3e68, 0xbfbff39c, NULL, 0) = 0
mmap(0, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =
0x281a6000
issetugid(0x28185000)                   = 0
access("/usr/sapdb/depend/lib/libcrypt.so.2", F_OK) = -1 ENOENT (No such
file or directory)
open("/var/run/ld-elf.so.hints", O_RDONLY) = 3
read(3, "\305q\376\377\271q\376\377.p\376\377<p\376\377Gp\376\377"...,
128) = 128
lseek(3, 128, SEEK_SET)                 = 128
read(3, "/usr/lib:/usr/local/lib:/usr/X11"..., 61) = 61
close(3)                                = 0
access("/usr/lib/libcrypt.so.2", F_OK)  = 0
open("/usr/lib/libcrypt.so.2", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=0, ...})   = 0
read(3, "\177ELF\1\1\1\t\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\16"...,
4096) = 4096
mmap(0, 102400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_NOCORE, 3, 0) =
0x281ae000
mprotect(0x281b4000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x281b4000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x281b5000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x7000) = 0x281b5000
mmap(0x281b6000, 69632, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0x281b6000
close(3)                                = 0
access("/usr/sapdb/depend/lib/liblthread.so.3", F_OK) = -1 ENOENT (No
such file or directory)
access("/usr/lib/liblthread.so.3", F_OK) = -1 ENOENT (No such file or
directory)
access("/usr/local/lib/liblthread.so.3", F_OK) = 0
open("/usr/local/lib/liblthread.so.3", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=0, ...})   = 0
read(3, "\177ELF\1\1\1\t\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0Ps\0\000"...,
4096) = 4096
mmap(0, 151552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_NOCORE, 3, 0) =
0x281c7000
mprotect(0x281df000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x281df000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x281e0000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x19000) = 0x281e0000
mmap(0x281e8000, 16384, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0x281e8000
close(3)                                = 0
access("/usr/sapdb/depend/lib/libstdc++.so.4", F_OK) = -1 ENOENT (No
such file or directory)
access("/usr/lib/libstdc++.so.4", F_OK) = 0
open("/usr/lib/libstdc++.so.4", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=0, ...})   = 0
read(3, "\177ELF\1\1\1\t\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\332\3"...,
4096) = 4096
mmap(0, 737280, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_NOCORE, 3, 0) =
0x281ec000
mprotect(0x28285000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x28285000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x28286000, 86016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x9a000) = 0x28286000
mmap(0x2829b000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0x2829b000
close(3)                                = 0
access("/usr/sapdb/depend/lib/libm.so.2", F_OK) = -1 ENOENT (No such
file or directory)
access("/usr/lib/libm.so.2", F_OK)      = 0
open("/usr/lib/libm.so.2", O_RDONLY)    = 3
fstat(3, {st_mode=0, st_size=0, ...})   = 0
read(3, "\177ELF\1\1\1\t\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`2\0\000"...,
4096) = 4096
mmap(0, 118784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_NOCORE, 3, 0) =
0x282a0000
mprotect(0x282b7000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x282b7000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x282b8000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x18000) = 0x282b8000
close(3)                                = 0
access("/usr/sapdb/depend/lib/libc.so.5", F_OK) = -1 ENOENT (No such
file or directory)
access("/usr/lib/libc.so.5", F_OK)      = 0
open("/usr/lib/libc.so.5", O_RDONLY)    = 3
fstat(3, {st_mode=0, st_size=0, ...})   = 0
read(3, "\177ELF\1\1\1\t\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\306"...,
4096) = 4096
mmap(0, 884736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_NOCORE, 3, 0) =
0x282bd000
mprotect(0x2837d000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x2837d000, 4096, PROT_READ|PROT_EXEC) = 0
mmap(0x2837e000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0xc0000) = 0x2837e000
mmap(0x28383000, 73728, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0x28383000
close(3)                                = 0
access("/usr/sapdb/depend/lib/libm.so.2", F_OK) = -1 ENOENT (No such
file or directory)
access("/usr/lib/libm.so.2", F_OK)      = 0
mmap(0, 1832, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x28395000
munmap(0x28395000, 1832)                = 0
mmap(0, 600, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x28395000
munmap(0x28395000, 600)                 = 0
mprotect(0x281c7000, 102400, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mmap(0, 4528, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x28395000
munmap(0x28395000, 4528)                = 0
mprotect(0x281c7000, 102400, PROT_READ|PROT_EXEC) = 0
mmap(0, 26976, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x28395000
munmap(0x28395000, 26976)               = 0
mmap(0, 2272, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x28395000
munmap(0x28395000, 2272)                = 0
mprotect(0x282bd000, 790528, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mmap(0, 21144, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0) = 0x28395000
munmap(0x28395000, 21144)               = 0
mprotect(0x282bd000, 790528, PROT_READ|PROT_EXEC) = 0
syscall_416(0x4, 0xbfbff4c8, 0xbfbff4a8) = 0
sigprocmask(SIG_BLOCK, NULL, [])        = 0
syscall_416(0x4, 0xbfbff4a8, 0)         = 0
getpid()                                = 43106 (ppid 43105)
syscall_416(0x1f, 0xbfbff4b4, 0)        = 0
syscall_416(0x1e, 0xbfbff4b4, 0)        = 0
sigprocmask(SIG_BLOCK, [], NULL)        = 0
__sysctl([hw.ncpu], 2,
"\225j\377\377\334j\377\377qk\377\377\354j\377\377\24k\377"..., [1024],
NULL, 0) = 0
__sysctl([114630717.192014751], 2,
"\1\0\0\0\0\0\0\0\0\0\0\0\0\0`\277\0\0\0\0\0\0\0\0\0\0\0"...,
[1768697699], NULL, 0) = 0
sigprocmask(SIG_BLOCK, ~[ILL TRAP ABRT EMT FPE BUS SEGV SYS], []) = 0
sigprocmask(SIG_SETMASK, [USR2], NULL)  = 0
readlink("/etc/malloc.conf", 0xbfbff4b0, 63) = -1 ENOENT (No such file
or directory)
issetugid(0x2837d274)                   = 0
getuid()                                = 0 (euid 0)
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =
0x28395000
break(0x81cd000)                        = 0
break(0x81ce000)                        = 0
break(0x81cf000)                        = 0
fstat(1, {st_mode=0, st_size=2336916742764261989, ...}) = 0
break(0x81d0000)                        = 0
ioctl(1, TIOCGETA, {0xfffef9cc /* B??? */ -opost isig icanon echo ...})
= 0
write(1, "HERE 1\n", 7HERE 1
)                 = 7
write(1, "HERE 3\n", 7HERE 3
)                 = 7
open("/dev/null", O_RDWR)               = 3
close(3)                                = 0
open("/dev/tty", O_WRONLY)              = 3
write(3, "d connection! \n\0kernel aborted c"..., 43canceladdr
0x00000000 component 'dbmcli' 

) = 43
close(3)                                = 0
open("/dev/tty", O_WRONLY)              = 3
write(3, "d connection! \n", 15DBLANG=(null)

)        = 15
close(3)                                = 0
open("/dev/tty", O_WRONLY)              = 3
write(3, "d connection! \n\0k", 17SERVERDB=(null)

)     = 17
close(3)                                = 0
write(1, "HERE 3\n", 7HERE 3
)                 = 7
geteuid(0x8180845)                      = 0
break(0x81d1000)                        = 0
sigprocmask(SIG_SETMASK, NULL, [TRAP EMT FPE PIPE TERM URG TTIN IO XCPU
INFO USR2]) = 0
sigsuspend([TRAP EMT FPE PIPE TERM URG TTIN IO XCPU INFO USR2]^C
<unfinished ...>
Received on Sun Jul 13 2003 - 14:44:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:15 UTC