Segmentation fault after migrating from 2.0.5 to 2.1.1
Hello! I'm developing my own rlm. I copied the code below from rlm_example.c: /* * Look for the 'state' attribute. */ state = pairfind(request->packet->vps, PW_STATE); if (state != NULL) { RDEBUG("Found reply to access challenge"); return RLM_MODULE_OK; } After compiling my module under fr-2.1.1 I got segmentation fault. gdb determined that error occurs in pairfind: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7ba4ac0 (LWP 9773)] 0xb7b360fa in osb_authorize (inst=0x8179e30, request=0x819c670) at rlm_osb.c:73 73 if(pairfind(request->packet->vps, PW_STATE)) I found that request->packet is NULL. Is it correct request? How should I handle requests with packet field == NULL? Thank you beforehand! P.S. All worked fine with fr-2.0.5.
Dmitry V. Krivenok wrote:
gdb determined that error occurs in pairfind:
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7ba4ac0 (LWP 9773)] 0xb7b360fa in osb_authorize (inst=0x8179e30, request=0x819c670) at rlm_osb.c:73 73 if(pairfind(request->packet->vps, PW_STATE))
I found that request->packet is NULL.
If that's NULL, then your code is wrong.
Is it correct request? How should I handle requests with packet field == NULL?
It's impossible for the field to be NULL. Maybe you didn't re-build your module with 2.1.1. The header files *have* changed. Alan DeKok.
Alan DeKok wrote:
Dmitry V. Krivenok wrote:
gdb determined that error occurs in pairfind:
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7ba4ac0 (LWP 9773)] 0xb7b360fa in osb_authorize (inst=0x8179e30, request=0x819c670) at rlm_osb.c:73 73 if(pairfind(request->packet->vps, PW_STATE))
I found that request->packet is NULL.
If that's NULL, then your code is wrong.
Is it correct request? How should I handle requests with packet field == NULL?
It's impossible for the field to be NULL.
Maybe you didn't re-build your module with 2.1.1. The header files *have* changed.
Thank you for your answer. I solved my problem. Code was correct, but compilation options I used to compile my rlm and options used by freeradius-2.1.1 were different. This resulted to segmentation fault. Now I build my rlm inside freeradius environment and all works fine.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
participants (3)
-
Alan DeKok -
Dmitry V. Krivenok -
Dmitry V. Krivenok