Ticket #412 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

Better socketpair checking for Solaris systems

Reported by: xaka Owned by: olly
Priority: normal Milestone: 1.0.17
Component: Omega Version: 1.0.16
Severity: normal Keywords:
Cc: Blocked By:
Operating System: Solaris Blocking:

Description

With current configure.ac file state HAVE_SOCKETPAIR macros still undefined because socketpair is not in default C library. Its wrong to check for this function using AC_CHECK_FUNCS macros on Solaris systems. I've attach the patch which fix this defect and as result enable CPU time and memory limits to improve software stability.

Attachments

fix-solaris-socketpair.patch Download (0.9 KB) - added by xaka 3 months ago.

Change History

Changed 3 months ago by xaka

Changed 3 months ago by richard

Thanks for the patch.

I wonder if using:

AC_SEARCH_LIBS([socketpair], [xnet], [AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define to 1 if you have the 'socketpair' function])])

instead of your case clause would work? (possibly after fixing some obvious errors - I've not tested this at all). If so, it would be nicer than hardcoding some behaviour for solaris. It's plausible that other environments will have another library that we need to look for socketpair in.

Olly's better at this sort of stuff than me, so I'll wait for him to wake up and comment on this.

Changed 3 months ago by olly

  • status changed from new to assigned
  • milestone changed from 1.0.17 to 1.1.3

Thanks for spotting this.

We shouldn't hard code an OS name check for this. A quick search suggest that there are other platforms which need an extra library for socketpair().

Richard's suggestion looks plausible. I have an account on a Solaris box, so I can test that.

Both this and the original patch will needlessly link other Omega binaries with -lxnet, but that's perhaps not worth the effort to avoid.

Marking for 1.1.3 as we'll fix it there first, then backport.

Changed 3 months ago by xaka

Thanks for review. P.S. This is not hardcoding - this is normal way of using "case" operator. If you'll look at aclocal.m4 you'll see many places where that operator uses to check operation system/platform type.

Changed 3 months ago by olly

  • milestone changed from 1.1.3 to 1.0.17

The checks on $host_os in aclocal.m4 are from libtool, which sadly is closely coupled to details of different OSes and compilers (probably by necessity, or at least practicality), and because of that sometimes needs updating for new major OS and compiler releases.

The ideal for configure tests is not to key off the OS or version numbers but to test features instead. Other platforms besides Solaris may also need -lxnet, and it's possible some versions of Solaris may not (particular future versions) so it's more robust to just check if socketpair() is found with no extra libraries and if not to retry with -lxnet, regardless of the current value of $host_os.

Richard's suggestion looks good, so I've gone with that, and committed to trunk as r13580. I tested 13582 configures and builds on Solaris with socketpair enabled.

Marking for backporting for 1.0.17.

Changed 3 months ago by olly

  • status changed from assigned to closed
  • resolution set to fixed

Backported for 1.0.17 as r13601.

Note: See TracTickets for help on using tickets.