[Gross] gross 1.0.2 core dumping with SJSMS 7u3 (7.3-11.01) 64-bit

Eino Tuominen eino at utu.fi
Tue Oct 27 09:56:24 EET 2009


Derek Diget wrote:
> 
> Not good...but did we get the ARG debug output....
> 
> Nope. :(
> 
> I did a strings against the "non-debug" and the "debug" grosscheck.so 
> and the non-debug does not have "/tmp/argout", but the debug version 
> does.  So I am pretty sure if it got to that point in the code it would 
> have created it.
> 
> Did the above with a truss and I see the following
> 
> 4278/1:         28.6614  0.0439 munmap(0xFFFFFFFF7AE00000, 32768)               = 0
> 4278/1:         28.6618  0.0004     Incurred fault #5, FLTACCESS  %pc = 0xFFFFFFFF77E01184
> 4278/1:               siginfo: SIGBUS BUS_ADRALN addr=0xFFFFFFFF7FFFB074

I really don't know what's happening here.

 From the Sun documentation 
(http://docs.sun.com/app/docs/doc/819-4428/bgaiv?a=view):

"""
Site-Supplied Routine Substitutions ($[...])
A substitution of the form $[image,routine,argument] is handled 
specially. The image, routine, argument part is used to find and call a 
customer-supplied routine. At runtime on UNIX, the MTA uses dlopen and 
dlsym to dynamically load and call the routine routine from the shared 
library image. The routine routine is then called as a function with the 
following argument list:


status = routine (argument, arglength, result, reslength)
The argument and result are 252-byte long character string buffers. The 
argument and result are passed as a pointer to a character string (for 
example, in C, as char*). The arglength and reslength are signed, long 
integers passed by reference. On input, argument contains the argument 
string from the mapping table template, and arglength the length of that 
string. On return, the resultant string should be placed in result and 
its length in reslength. This resultant string then replaces the 
$[image,routine,argument] in the mapping table template. The routine 
routine should return 0 if the mapping table substitution should fail 
and -1 if the mapping table substitution should succeed. If the 
substitution fails, then normally the original input string is used 
unchanged as the output string.

If you want to use processing control metacharacters such as $C, $R, or 
$L in a mapping table entry that does a site-supplied routine 
substitution, you place the processing control metacharacter to the left 
of the site-supplied routine substitution in the mapping table template; 
otherwise, the “failure” of a mapping table substitution means that the 
processing control metacharacter is not seen.

The site-supplied routine callout mechanism allows the MTA's mapping 
process to be extended in all sorts of complex ways. For example, in a 
PORT_ACCESS or ORIG_SEND_ACCESS mapping table, a call to some type of 
load monitoring service could be performed and the result used to decide 
whether or not to accept a connection or message.

The site-supplied shared library image image should be world readable.
"""

grosscheck() function definition:

int grosscheck(char *arg, long *arglen, char *res, long *reslen);

To me this looks correct.

We will install a 64 bit messaging server here to test this (not sparc 
though, but we'll see if we can reproduce this).

You could try to move debug file creation earlier in the code to see if 
the file gets created, before:

         /* arg should contain a string <ip>,<sender>,<recipient> */
         strncpy(buffer, arg, *arglen);
         buffer[*arglen] = '\0';
         requestcopy = strdup(buffer);


I suspect it's crashing here.

-- 
   Eino Tuominen



More information about the Gross mailing list