Re: rlm_perl without DynaLoader

2012-11-22 Thread Alan DeKok
Julius Plenz wrote:
> Hi, Alan!
> 
> * Alan DeKok  [2012-11-22 15:22]:
>>> Why is this an error case, rather than "no libs, no unloading
>>> necessary"?
>>   It's a minor bug.
> 
> Thank you for the bug fix I found at
> https://github.com/FreeRADIUS/freeradius-server/commit/bfaf23b7d930364d680e76c14c1abedb2a1fb421
> 
> However, by fixing the minor bug, you seem to have introduced a major
> one: FreeRADIUS segfaults on startup. Backtrace:
...
> Maybe you shouldn't have moved the newXS() call to *before* the
> perl_parse(inst->perl, xs_init, ...) call? Moving it after that line
> fixes the segfault.

  Ok, fixed.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl without DynaLoader

2012-11-22 Thread Julius Plenz
Hi, Alan!

* Alan DeKok  [2012-11-22 15:22]:
> > Why is this an error case, rather than "no libs, no unloading
> > necessary"?
> 
>   It's a minor bug.

Thank you for the bug fix I found at
https://github.com/FreeRADIUS/freeradius-server/commit/bfaf23b7d930364d680e76c14c1abedb2a1fb421

However, by fixing the minor bug, you seem to have introduced a major
one: FreeRADIUS segfaults on startup. Backtrace:

#0  0x7fe8bc912ffe in Perl_newXS () from /usr/lib/libperl.so.5.10
#1  0x7fe8bcc495d4 in perl_instantiate (conf=0x24451a0, instance=0x2589c98) 
at rlm_perl.c:484
#2  0x0041a413 in find_module_instance (modules=, 
instname=0x2448150 "perl", 
do_link=) at modules.c:610
#3  0x0041c273 in do_compile_modsingle (parent=0x0, component=, ci=0x2448110, 
grouptype=, modname=0x7fffa89e15d0) at modcall.c:1921
#4  0x0041a8f1 in load_component_section (cs=0x2447c50, 
components=, comp=1) at modules.c:898
#5  0x0041adbc in load_byserver (cs=0x2447ad0) at modules.c:1099
#6  0x0041b1c8 in virtual_servers_load (config=0x243f100) at 
modules.c:1230
#7  0x0041b520 in setup_modules (reload=, 
config=0x243f100) at modules.c:1558
#8  0x004194ea in read_mainconfig (reload=) at 
mainconfig.c:967
#9  0x0041e2fe in main (argc=6, argv=0x7fffa89e1ee8) at radiusd.c:270

Maybe you shouldn't have moved the newXS() call to *before* the
perl_parse(inst->perl, xs_init, ...) call? Moving it after that line
fixes the segfault.

Julius
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: rlm_perl without DynaLoader

2012-11-22 Thread Alan DeKok
Julius Plenz wrote:
> when using rlm_perl with a very simple Perl script that does *not* use
> DynaLoader to load some *.so files, upon thread exit, FreeRADIUS
> (current v2.x.x branch) throws errors:
> 
> Error: Could not get @DynaLoader::dl_librefs for unloading.

  That shouldn't be an error.  I'll go fix that.

> Why is this an error case, rather than "no libs, no unloading
> necessary"?

  It's a minor bug.

  Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


rlm_perl without DynaLoader

2012-11-22 Thread Julius Plenz
Hi,

when using rlm_perl with a very simple Perl script that does *not* use
DynaLoader to load some *.so files, upon thread exit, FreeRADIUS
(current v2.x.x branch) throws errors:

Error: Could not get @DynaLoader::dl_librefs for unloading.

The errors originate from rlm_perl_get_handles(), which is invoked via
pthread_key_create(key, rlm_destroy_perl):
https://github.com/FreeRADIUS/freeradius-server/blob/v2.x.x/src/modules/rlm_perl/rlm_perl.c#L154

Adding an (otherwise useless) 'require DynaLoader;' to the Perl script
fixes the errors.

Why is this an error case, rather than "no libs, no unloading
necessary"?

Thanks,

Julius
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html