[Openais] Compiling corosync trunk on Solars

Wojtek Meler wmeler at wp.pl
Mon Jun 8 03:41:13 PDT 2009


Steven Dake pisze:
> Managed to get trunk to compile with Solaris 10, csw gcc4 + the 
> solaris bintools (ar/ld/etc).  The Sun Studio compiler appears too 
> defective to build the source tree.  Had to hack pkgconfig since it is 
> very old in the csw and the m4 macros for pkgconfig in the version are 
> out of date.
>
> I haven't posted all patches yet because some are hard to separate 
> out.  I receive a segfault after getting everything to link, and csw 
> gdb reboots my kvm machine.  I took a look at the core and it looks 
> related to how the ip addresses are found in the system (which is not 
> defined by Posix and done differently on each OS).
>
Coredump is caused by totemip_print returning NULL passed then to strlen 
(Solaris is sensitive for null strings).


(gdb) print *addr
$4 = {nodeid = 0, family = 0, addr = '\0' <repeats 15 times>}

that's why inet_ntop returns null

(gdb) bt
#0  totemip_print (addr=0x8442e26) at totemip.c:217
#1  0xfec55bcc in timer_function_netif_check_timeout (data=0x84aaf80) at 
totemnet.c:1356
#2  0xfec5643d in totemnet_initialize (poll_handle=595651817233186816, 
handle=0x8444c70, totem_config=0x8047234, interface_no=0, context=0x0, 
deliver_fn=0,
    iface_change_fn=0) at totemnet.c:1391
#3  0xfec59867 in totemrrp_initialize (poll_handle=8928880753731698688, 
handle=0x84a8f9c, totem_config=0x8047234, context=0x8448f68, deliver_fn=0,
    iface_change_fn=0, token_seqid_get=0, msgs_missing=0) at totemrrp.c:1479
#4  0xfec5baff in totemsrp_initialize (poll_handle=8928880753731698688, 
handle=0xfec828c8, totem_config=0x8047234, deliver_fn=0, confchg_fn=0)
    at totemsrp.c:835
#5  0xfec666e1 in totemmrp_initialize (poll_handle=8928880753731698688, 
totem_config=0x8047234, deliver_fn=0x8442e26, confchg_fn=0x8442e26)
    at totemmrp.c:139
#6  0xfec6751e in totempg_initialize (poll_handle=8928880753731698688, 
totem_config=0x8047234) at totempg.c:697
#7  0x080544bb in main (argc=3, argv=0x8070080) at main.c:861
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xfeea590c in strlen () from /lib/libc.so.1
(gdb) bt
#0  0xfeea590c in strlen () from /lib/libc.so.1
#1  0xfeefeda6 in _ndoprnt () from /lib/libc.so.1
#2  0xfef01f48 in vsprintf () from /lib/libc.so.1
#3  0xfee636ae in _logsys_log_vprintf (subsysid=134505184, 
function_name=0xfec6cd00 "timer_function_netif_check_timeout",
    file_name=0xfec6b54c "totemnet.c", file_line=1358, level=5, tag=0, 
format=0xfec6bcdc "The network interface [%s] is now up.\n", 
ap=0x8046b8c "")
    at logsys.c:1310
#4  0xfee637c3 in _logsys_log_printf (subsysid=6, 
function_name=0xfec6cd00 "timer_function_netif_check_timeout", 
file_name=0xfec6b54c "totemnet.c",
    file_line=1358, level=5, tag=0, format=0xfec6bcdc "The network 
interface [%s] is now up.\n") at logsys.c:1357
#5  0xfec55bfe in timer_function_netif_check_timeout (data=0x84aaf80) at 
totemnet.c:1356
#6  0xfec5643d in totemnet_initialize (poll_handle=493921239040, 
handle=0x8444c70, totem_config=0x8047234, interface_no=0, context=0x0, 
deliver_fn=0,
    iface_change_fn=0) at totemnet.c:1391
#7  0xfec59867 in totemrrp_initialize (poll_handle=8928880753731698688, 
handle=0x84a8f9c, totem_config=0x8047234, context=0x8448f68, deliver_fn=0,
    iface_change_fn=0, token_seqid_get=0, msgs_missing=0) at totemrrp.c:1479
#8  0xfec5baff in totemsrp_initialize (poll_handle=8928880753731698688, 
handle=0xfec828c8, totem_config=0x8047234, deliver_fn=0, confchg_fn=0)
    at totemsrp.c:835
#9  0xfec666e1 in totemmrp_initialize (poll_handle=8928880753731698688, 
totem_config=0x8047234, deliver_fn=0, confchg_fn=0) at totemmrp.c:139
#10 0xfec6751e in totempg_initialize (poll_handle=8928880753731698688, 
totem_config=0x8047234) at totempg.c:697
#11 0x080544bb in main (argc=3, argv=0x8070080) at main.c:861
 


> I'll post the remainder of the patches I have available tomorrow (bed 
> time now) to get a building solaris tree and we can work on getting 
> the kinks out. 
>
> If you have network experience, please have a look at  
> totemip_iface_check and see if you know of examples for executing the 
> functionality.

Unfortunately I'm not experienced in this area. I assume that corosync 
has to know what interfaces system has, to perform bind.
Having a look at
    truss ifconfig -a
I can see it does:

so_socket(PF_INET, SOCK_DGRAM, IPPROTO_IP, "", SOV_XPG4_2) = 3
ioctl(3, SIOCGLIFNUM, 0x080471FC)               = 0
ioctl(3, SIOCGLIFCONF, 0x080471E0)              = 0
close(3)                                        = 0
so_socket(PF_INET, SOCK_DGRAM, IPPROTO_IP, "", SOV_XPG4_2) = 3
ioctl(3, SIOCGLIFADDR, 0x08047208)              = 0
ioctl(3, SIOCGLIFFLAGS, 0x0806E358)             = 0
ioctl(3, SIOCGLIFFLAGS, 0x0806E358)             = 0
ioctl(1, TCGETA, 0x08046444)                    = 0
fstat64(1, 0x080463B0)                          = 0
ioctl(3, SIOCGLIFMETRIC, 0x0806E358)            = 0
ioctl(3, SIOCGLIFMTU, 0x0806E358)               = 0
ioctl(3, SIOCGLIFINDEX, 0x0806E358)             = 0
ioctl(3, SIOCGLIFZONE, 0x0806E358)              = 0
zone_lookup("")                                 = 0
ioctl(3, SIOCGLIFINDEX, 0x0806E358)             = 0
ioctl(3, SIOCGLIFSRCOF, 0x08047140)             = 0
ioctl(3, SIOCGLIFUSESRC, 0x0806E358)            = 0
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 
8232 index 1
write(1, " l o 0 :   f l a g s = 2".., 83)      = 83
close(3)                                        = 0
so_socket(PF_INET, SOCK_DGRAM, IPPROTO_IP, "", SOV_XPG4_2) = 3
so_socket(PF_INET, SOCK_DGRAM, IPPROTO_IP, "", SOV_DEFAULT) = 4
ioctl(4, SIOCGTUNPARAM, 0x0806F1E8)             Err#122 EOPNOTSUPP
close(4)                                        = 0
ioctl(3, SIOCGLIFADDR, 0x0806E358)              = 0
ioctl(3, SIOCGLIFSUBNET, 0x0806E358)            = 0
ioctl(3, SIOCGLIFNETMASK, 0x0806E358)           = 0
ioctl(3, SIOCGLIFGROUPNAME, 0x0806E358)         = 0
        inet 127.0.0.1 netmask ff000000
write(1, "\t i n e t   1 2 7 . 0 .".., 34)      = 34
close(3)                                        = 0
so_socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP, "", SOV_XPG4_2) = 3
close(3)                                        = 0
so_socket(PF_INET, SOCK_DGRAM, IPPROTO_IP, "", SOV_XPG4_2) = 3
ioctl(3, SIOCGLIFADDR, 0x08047208)              = 0
ioctl(3, SIOCGLIFFLAGS, 0x0806E358)             = 0
ioctl(3, SIOCGLIFFLAGS, 0x0806E358)             = 0
ioctl(3, SIOCGLIFMETRIC, 0x0806E358)            = 0
ioctl(3, SIOCGLIFMTU, 0x0806E358)               = 0
ioctl(3, SIOCGLIFINDEX, 0x0806E358)             = 0
ioctl(3, SIOCGLIFZONE, 0x0806E358)              = 0
zone_lookup("")                                 = 0
ioctl(3, SIOCGLIFINDEX, 0x0806E358)             = 0
ioctl(3, SIOCGLIFSRCOF, 0x08047140)             = 0
ioctl(3, SIOCGLIFUSESRC, 0x0806E358)            = 0
e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 
1500 index 2
write(1, " e 1 0 0 0 g 0 :   f l a".., 82)      = 82
close(3)                                        = 0
 

Maybe have a look at

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c#foreachinterface

> The Ipc system will need work around the security features since it 
> checks uid/gid of connecting socket.  This can be done in Solaris and 
> there may be code in the tree or one of the tags to do this now.  I'll 
> have to get a non-segfaulting system before I can address that.
>
> The solaris dl library doesn't properly execute constructors in dlopen 
> shared objects, but i've got a workaround in my test tree which is 
> somewhat unsanitary but only affects Solaris.
>
> i notice the csw says they dont take alpha/beta software.  You should 
> be aware that we are entering the final stages of release and planning 
> our rc in approximately 7-10 days.
It is great. Even if package would not be accepted we could try to 
prepare package in testing repository and wait of final release.

regards,
Wojtek



More information about the Openais mailing list