[OPEN-ILS-DEV] PATCH: opensrf-c crashing

Scott McKellar mck9 at swbell.net
Sun Apr 29 15:41:25 EDT 2007


I attach a patch to address the problem describe below by Harry
Bochner, traced ultimately to a configuration error.

In a followup, Dan Scott reported that he had encountered the same
problem.  Maybe it's appropriate to handle it a little better,
before somebody else stumbles across it.

This patch is emphatically NOT a fix.  It simply issues an error 
message and then exits, instead of crashing with a segmentation 
violation.   The application still comes to an abrupt and ungraceful 
halt, but you can identify the problem without having to analyze a 
coredump.

A real fix would involve not calling osrf_settings_host_value_object()
at all if the previous call to osrf_settings_retrieve() had failed.  
Alternatively, we could return NULL, provided that the calling
code is prepared to test for NULL.  Either fix would be more than I'm
prepared to do right now.

Note also that although I verified that the patch compiles, I have 
not tested it.  Testing would require installing and configuring 
large chunks of Evergreen, and while I may get around to that some 
day, I haven't yet.

I'm not sure if the error message should go to standard error or
to the log, so I did it both ways.  You may want to delete one of
those lines if it's not appropriate.

Scott McKellar
http://home.swbell.net/mck9/aargh/

--- Harry Bochner <Harry.Bochner at biogenidec.com> wrote:

> When I run "opensrf_all start", most things seem to start OK, but 
> opensrf-c
> core dumps:
> 
> > + /var/www/openils/bin/opensrf-c camlxlib02.biogenidec.com 
> /var/www/openils/conf//opensrf_core.xml opensrf
> > Loading OpenSRF host camlxlib02.biogenidec.com with bootstrap
> config 
> /var/www/openils/conf//opensrf_core.xml and config context opensrf
> > ./opensrf_all: line 89: 25752 Segmentation fault
> "$BINDIR/opensrf-c" 
> $(hostname -f) "$ETCDIR//opensrf_core.xml" "opensrf"
> 
> The segmentation violation comes at line 15 of osrf_settings.c,
> because the config variable is null. And that's because the earlier
> call to osrf_settings_retrieve failed to recognize the hostname; in
> osrfsys.log I find:

<snip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osrf_settings_c_1.patch
Type: text/x-patch
Size: 578 bytes
Desc: 2395065013-osrf_settings_c_1.patch
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20070429/d05d6164/osrf_settings_c_1.bin


More information about the Open-ils-dev mailing list