Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301459 - net-dialup/pptpd: kernel: pptpctrl[16774]: segfault at 0 ip b76a4340 sp bf9a7ef0 error 4 in libc-2.9.so[b762b000+159000]
Summary: net-dialup/pptpd: kernel: pptpctrl[16774]: segfault at 0 ip b76a4340 sp bf9a7...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Peter Volkov (RETIRED)
URL: http://www.gentoo.ru/node/18102
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-18 23:31 UTC by mclion
Modified: 2010-03-18 19:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch to syslog memory failture errors on strduping. (pptpd-1.3.4-add-memory-failture-error-message.patch,2.74 KB, patch)
2010-01-19 20:51 UTC, Petr Polezhaev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mclion 2010-01-18 23:31:22 UTC
Jan 17 17:33:42 mypisem kernel: pptpctrl[16774]: segfault at 0 ip b76a4340 sp bf9a7ef0 error 4 in libc-2.9.so[b762b000+159000]
Jan 17 17:33:43 mypisem kernel: pptpctrl[16786]: segfault at 0 ip b7619340 sp bfb7d280 error 4 in libc-2.9.so[b75a0000+159000]

(gdb) bt
#0  0xb767ac90 in strncpy () from /lib/libc.so.6
#1  0x0804b815 in strlcpy (
    dst=0xbfd586a4 "\364\357\004\b\270\206տi\213\004\b\020\361v\267\244\206տ\224\206տ\031\305\004\b\004st\267\364ot\267\360\206տ\364ot\267\200\314w\267       ", src=0x0, size=16) at compat.c:21
#2  0x0804a775 in main (argc=7, argv=0xbfd58774) at pptpctrl.c:140
Comment 1 mclion 2010-01-18 23:35:28 UTC
(gdb) bt
#0  0xb767ac90 in strncpy () from /lib/libc.so.6
#1  0x0804b815 in strlcpy (
    dst=0xbfd586a4 "\364\357\004\b\270\206տi\213\004\b\020\361v\267\244\206տ\224\206տ\031\305\004\b\004st\267\364ot\267\360\206տ\364ot\267\200\314w\267       ", src=0x0, size=16) at compat.c:21
#2  0x0804a775 in main (argc=7, argv=0xbfd58774) at pptpctrl.c:140
Comment 2 Petr Polezhaev 2010-01-19 20:10:47 UTC
1) This is encountered when pptpd has approx. > 100 clients, exact value differs from time to time. No more clients may connect due to this bug.
2) This segfault due to there is no local-ip arg after valid (i.e. existent and not-0) presence flag.
3) If load lowers than clients may connect again.

My resolution: most probably memory allocation failture, not a software bug: local filled from pptpd.c at lines 637, 753 and 765 - last one is only not checked and maybe null, but this will lead to segfault on strdup in pptpmanager.c:132, but it goes ok. So - strdup is returning NULL, probably.
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2010-01-19 20:17:13 UTC
Thanks for report. And guys, please, read, what is written with BIG BOLD letters :) Setting product correctly.
Comment 4 Petr Polezhaev 2010-01-19 20:51:34 UTC
Created attachment 216940 [details, diff]
Proposed patch to syslog memory failture errors on strduping.

Please test this patch, it will show, if I'm correct and your problem is memory. This should echo errors into syslog if strdup will return null, preventing pptpctrl from running.

Also: this another possible behaviour - it just always run pptpctrl, even if ip-parsing failed last time. Bug-poster should check his logs, if there is any errors about ip-parsing, maybe max-connections reached =)? This patch should notify about last possible error. So logs should provide valuable information on what is happening.

Maybe we should also break routines if parsing failed? This shouldn't be very hard...
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2010-02-01 08:01:55 UTC
mclion any progress here?
Comment 6 mclion 2010-02-01 08:05:49 UTC
(In reply to comment #5)
> mclion any progress here?

Hello. Applying this patch changes are allowed, falls tazhe error.
Comment 7 mclion 2010-02-01 08:21:47 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > mclion any progress here?
Hello. Applying this patch changes have made it, drops the same error.

Comment 8 Peter Volkov (RETIRED) gentoo-dev 2010-03-18 19:34:05 UTC
Forum thread states that the problem was in wrong configuration. That should be fixed too, but in any case without proper backtrace or steps to reproduce this problem I don't know what to do here. Closing for now.