CONSISTENCY CHECK FAILED src/main/process.c[3156] ..... CAUGHT SIGNAL: Aborted #1338

Closed
Toutzn opened this Issue Oct 22, 2015 · 3 comments

Projects

None yet

2 participants

@Toutzn
Toutzn commented Oct 22, 2015

We wan't to add some informations to the radius packet with perl. This was working in earlier version, but now the process goes broken

(0) Received Access-Request Id 12 from 10.142.0.112:43557 to 10.142.0.60:1812 length 142
(0) User-Name = "t-mobile.de/test@test.com"
(0) NAS-Identifier = "DTITESTAAA2"
(0) Service-Type = Framed-User
(0) Framed-Protocol = PPP
(0) Calling-Station-Id = "00:00:00:00:00:04"
(0) User-Password = "password"
(0) Idle-Timeout = 0
(0) Message-Authenticator = 0x957eb34aaa201e2de317264f4c337537
(0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/M3C
(0) authorize {
(0) [preprocess] = ok
(0) files: users: Matched entry DEFAULT at line 181
(0) [files] = ok
(0) IPASS: Checking for prefix before "/"
(0) IPASS: Looking up realm "t-mobile.de" for User-Name = "t-mobile.de/test@test.com"
(0) IPASS: Found realm "t-mobile.de"
(0) IPASS: Adding Realm = "t-mobile.de"
(0) IPASS: Proxying request from user t-mobile.de/test@test.com to realm t-mobile.de
(0) IPASS: Preparing to proxy authentication request to realm "t-mobile.de"
(0) [IPASS] = updated
(0) if (noop) {
(0) if (noop) -> FALSE
(0) suffix: Request already has destination realm set. Ignoring
(0) [suffix] = noop
(0) eap: No EAP-Message, not doing EAP
(0) [eap] = noop
(0) perl_M3C: $RAD_REQUEST{'User-Name'} = &request:User-Name -> 't-mobile.de/test@test.com'
(0) perl_M3C: $RAD_REQUEST{'User-Password'} = &request:User-Password -> 'password'
(0) perl_M3C: $RAD_REQUEST{'NAS-IP-Address'} = &request:NAS-IP-Address -> '10.142.0.112'
(0) perl_M3C: $RAD_REQUEST{'Service-Type'} = &request:Service-Type -> 'Framed-User'
(0) perl_M3C: $RAD_REQUEST{'Framed-Protocol'} = &request:Framed-Protocol -> 'PPP'
(0) perl_M3C: $RAD_REQUEST{'Idle-Timeout'} = &request:Idle-Timeout -> '0'
(0) perl_M3C: $RAD_REQUEST{'Calling-Station-Id'} = &request:Calling-Station-Id -> '00:00:00:00:00:04'
(0) perl_M3C: $RAD_REQUEST{'NAS-Identifier'} = &request:NAS-Identifier -> 'DTITESTAAA2'
(0) perl_M3C: $RAD_REQUEST{'Event-Timestamp'} = &request:Event-Timestamp -> 'Oct 22 2015 13:33:48 CEST'
(0) perl_M3C: $RAD_REQUEST{'Message-Authenticator'} = &request:Message-Authenticator -> '0x957eb34aaa201e2de317264f4c337537'
(0) perl_M3C: $RAD_REQUEST{'Realm'} = &request:Realm -> 't-mobile.de'
(0) perl_M3C: $RAD_REPLY{'Framed-Protocol'} = &reply:Framed-Protocol -> 'PPP'
(0) perl_M3C: $RAD_REPLY{'Framed-Compression'} = &reply:Framed-Compression -> 'Van-Jacobson-TCP-IP'
(0) perl_M3C: $RAD_CHECK{'Proxy-To-Realm'} = &control:Proxy-To-Realm -> 't-mobile.de'
(0) perl_M3C: $RAD_CONFIG{'Proxy-To-Realm'} = &control:Proxy-To-Realm -> 't-mobile.de'
rlm_perl: rlm_perl::log_request_attributes t-mobile.de/test@test.com
rlm_perl: RAD_REQUEST: Service-Type = Framed-User
rlm_perl: RAD_REQUEST: Calling-Station-Id = 00:00:00:00:00:04
rlm_perl: RAD_REQUEST: Message-Authenticator = 0x957eb34aaa201e2de317264f4c337537
rlm_perl: RAD_REQUEST: Framed-Protocol = PPP
rlm_perl: RAD_REQUEST: Idle-Timeout = 0
rlm_perl: RAD_REQUEST: User-Name = t-mobile.de/test@test.com
rlm_perl: RAD_REQUEST: Event-Timestamp = Oct 22 2015 13:33:48 CEST
rlm_perl: RAD_REQUEST: User-Password = password
rlm_perl: RAD_REQUEST: NAS-Identifier = DTITESTAAA2
rlm_perl: RAD_REQUEST: Realm = t-mobile.de
rlm_perl: RAD_REQUEST: NAS-IP-Address = 10.142.0.112
rlm_perl: RAD_REPLY: Framed-Protocol = PPP
rlm_perl: RAD_REPLY: Framed-Compression = Van-Jacobson-TCP-IP
(0) perl_M3C: &request:Service-Type = $RAD_REQUEST{'Service-Type'} -> 'Framed-User'
(0) perl_M3C: &request:Calling-Station-Id = $RAD_REQUEST{'Calling-Station-Id'} -> '00:00:00:00:00:04'
(0) perl_M3C: &request:Message-Authenticator = $RAD_REQUEST{'Message-Authenticator'} -> '0x957eb34aaa201e2de317264f4c337537'
(0) perl_M3C: &request:Framed-Protocol = $RAD_REQUEST{'Framed-Protocol'} -> 'PPP'
(0) perl_M3C: &request:Idle-Timeout = $RAD_REQUEST{'Idle-Timeout'} -> '0'
(0) perl_M3C: &request:User-Name = $RAD_REQUEST{'User-Name'} -> 't-mobile.de/test@test.com'
(0) perl_M3C: &request:Event-Timestamp = $RAD_REQUEST{'Event-Timestamp'} -> 'Oct 22 2015 13:33:48 CEST'
(0) perl_M3C: &request:User-Password = $RAD_REQUEST{'User-Password'} -> 'password'
(0) perl_M3C: &request:NAS-Identifier = $RAD_REQUEST{'NAS-Identifier'} -> 'DTITESTAAA2'
(0) perl_M3C: &request:Realm = $RAD_REQUEST{'Realm'} -> 't-mobile.de'
(0) perl_M3C: &request:NAS-IP-Address = $RAD_REQUEST{'NAS-IP-Address'} -> '10.142.0.112'
(0) perl_M3C: &reply:Framed-Protocol = $RAD_REPLY{'Framed-Protocol'} -> 'PPP'
(0) perl_M3C: &reply:Framed-Compression = $RAD_REPLY{'Framed-Compression'} -> 'Van-Jacobson-TCP-IP'
(0) perl_M3C: &control:Proxy-To-Realm = $RAD_CHECK{'Proxy-To-Realm'} -> 't-mobile.de'
(0) [perl_M3C] = ok
(0) if (ok || updated) {
(0) if (ok || updated) -> TRUE
(0) if (ok || updated) {
(0) update control {
(0) Auth-Type := Perl
(0) } # update control = noop
(0) } # if (ok || updated) = noop
(0) } # authorize = updated
(0) # Executing section pre-proxy from file /usr/local/etc/raddb/sites-enabled/M3C
(0) pre-proxy {
(0) [files] = noop
(0) NAS-Id-ReWr_M3C: Executing: /usr/local/etc/raddb/wbs2/process_attr.pl %{NAS-Identifier}:
(0) NAS-Id-ReWr_M3C: EXPAND %{NAS-Identifier}
(0) NAS-Id-ReWr_M3C: --> DTITESTAAA2
Backtrace of last 16 frames:
/usr/local/lib/libfreeradius-radius.so(fr_fault+0x115)[0x7f52108bb3e5]
/usr/local/lib/libfreeradius-radius.so(fr_assert_cond+0x4c)[0x7f52108bbe37]
/usr/local/lib/libfreeradius-radius.so(fr_pair_list_verify+0x11c)[0x7f52108ccbc1]
/usr/local/lib/libfreeradius-server.so(+0x24a6a)[0x7f5210b1ca6a]
/usr/local/lib/libfreeradius-server.so(verify_request+0x153)[0x7f5210b1cbc7]
radiusd[0x441d98]
radiusd[0x43e5c6]
radiusd[0x43d324]
radiusd(request_receive+0x7cf)[0x43ee16]
radiusd[0x419750]
radiusd[0x445a53]
/usr/local/lib/libfreeradius-radius.so(fr_event_loop+0x5c0)[0x7f52108e2df0]
radiusd(radius_event_process+0x26)[0x447832]
radiusd(main+0xc4b)[0x431f73]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f520ec0aead]
radiusd[0x4101b9]
No panic action set
_EXIT(1) CALLED src/lib/debug.c[745]. Last error was:
(0) NAS-Id-ReWr_M3C: Program returned code (0) and output 'NAS-Port-Type = 19, WISPr-Location-Name = "INFLIGHT_PA:DE, Testsite AAA2", WISPr-Location-ID = "isocc=de,cc=49,ac=,network=M3CONNECT/DTITESTAAA2"'
(0) NAS-Id-ReWr_M3C: Program executed successfully
(0) [NAS-Id-ReWr_M3C] = ok
(0) pre_proxy_log: EXPAND /usr/local/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/pre-proxy-detail-%Y%m%d
(0) pre_proxy_log: --> /usr/local/var/log/radius/radacct/10.142.0.112/pre-proxy-detail-20151022
(0) pre_proxy_log: /usr/local/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/pre-proxy-detail-%Y%m%d expands to /usr/local/var/log/radius/radacct/10.142.0.112/pre-proxy-detail-20151022
(0) pre_proxy_log: EXPAND %t
(0) pre_proxy_log: --> Thu Oct 22 13:33:48 2015
(0) [pre_proxy_log] = ok
(0) } # pre-proxy = ok
CONSISTENCY CHECK FAILED src/main/process.c[3156]: Expected VALUE_PAIR "NAS-Port-Type" to be parented by 0x282a4d0 (RADIUS_PACKET), instead parented by 0x2828890 (REQUEST)

Talloc chunk lineage:
0x282a4d0 (RADIUS_PACKET) < 0x2828890 (REQUEST) < 0x2828660 (auth_listener_pool)
Talloc context level 0:
Talloc chunk lineage:
0x2828890 (REQUEST) < 0x2828660 (auth_listener_pool)
Talloc context level 0:
SOFT ASSERT FAILED src/lib/pair.c[2411]: 0
CAUGHT SIGNAL: Aborted

our perl script:

!/usr/bin/perl -w

use strict;
use warnings;
use DBI;

no warnings ('uninitialized', 'substr');

my $host='localhost';
my $db='db';
my $user='root';
my $pwd='password';

$SIG{'INT'}='end_signal';
$SIG{'TERM'}='end_signal';
$SIG{'HUP'}='end_signal';

my $instance="";
my $hit=0;

sub end_signal {
exit 0;
}

foreach (@ARGV) {
if(/^[\w-]+$/)
{
$instance=$_;
}
}

my $dbh = DBI->connect("DBI:mysql:".$db.":".$host,$user,$pwd);
my $query = $dbh->prepare("SELECT telefon, instance_id, location_name from sites where instance_id='".$instance."'");
$query->execute;
if (my @result=$query->fetchrow_array()) {
my $telefon=$result[0];
my $instanceid=$result[1];
my $location_name=$result[2];
$query->finish;
my $poszero = index($telefon,")")+2;
my $posdivider = index($telefon,"-")-1;
my $locationid = "isocc=de,cc=49,ac=".substr($telefon,$poszero,$posdivider-$poszero).",network=M3CONNECT/".$instanceid;
print "NAS-Port-Type = 19,\n";
print "WISPr-Location-Name = "".$location_name."",\n";
print "WISPr-Location-ID = "".$locationid.""\n";
} else {
print "NAS-Port-Type = 19\n";
}
&end_signal;

any idea? I think, we have a new bug here.

@Toutzn
Toutzn commented Oct 22, 2015

Fixed via unlang

update proxy-request {
proxy-request += /usr/bin/perl /usr/local/etc/raddb/wbs2/process_attr.pl '%{NAS-Identifier}'
}

@Toutzn Toutzn closed this Oct 22, 2015
@alandekok
Member

That's not a fix, that's a work-around.

Which version of the server are you using?

@alandekok alandekok reopened this Oct 22, 2015
@alandekok alandekok closed this in cd730bc Oct 22, 2015
@Toutzn
Toutzn commented Oct 23, 2015

I use Debian 7.9 and FreeRADIUS Version 3.0.11 (git #465e9fd)

@jpereira jpereira added a commit to jpereira/freeradius-server that referenced this issue Oct 23, 2015
@alandekok @jpereira alandekok + jpereira Use correct context. Fixes #1338 61de36d
@jpereira jpereira added a commit to jpereira/freeradius-server that referenced this issue Oct 23, 2015
@alandekok @jpereira alandekok + jpereira Use correct context. Fixes #1338 bfb75d4
@citywok citywok referenced this issue Oct 25, 2016
Closed

SOFT ASSERT FAILED when using rlm_perl #1807

1 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment