Bug 30914

Summary: pppoe-discovery Segmentation fault
Product: Sisyphus Reporter: stalker <stalker>
Component: pppAssignee: Michael Shigorin <mike>
Status: NEW --- QA Contact: qa-sisyphus
Severity: normal    
Priority: P3 CC: mike
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
Fix pppoe-discovery
none
непроверенный патч none

Description stalker 2015-04-05 21:33:15 MSK
[root@stlk tmp]# gdb pppoe-discovery
GNU gdb (GDB) 7.5.0.20121002-alt3 (ALT Linux)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-alt-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/pppoe-discovery...Reading symbols from /usr/lib/debug/usr/sbin/pppoe-discovery.debug...done.
done.
(gdb) run
Starting program: /usr/sbin/pppoe-discovery 

Program received signal SIGSEGV, Segmentation fault.
0x0000000000001726 in ?? ()
(gdb) bt
#0  0x0000000000001726 in ?? ()
#1  0x00005555555558c7 in main (argc=0, argv=0x0) at pppoe-discovery.c:641


641 строка это
conn = malloc(sizeof(PPPoEConnection));
Comment 1 Georgy A Bystrenin 2017-12-12 02:08:45 MSK
Created attachment 7309 [details]
Fix pppoe-discovery

Бага на самом деле была в файле ./pppd/plugins/rp-pppoe/Makefile.linux


$ sudo pppoe-discovery -I eth0
Access-Concentrator: DOM.RU
Got a cookie: d6 5c 9f 50 99 da 59 92 f1 0c 6b 98 7c 4b 99 e4
--------------------------------------------------
AC-Ethernet-Address: XX:XX:XX:XX:21:12
Access-Concentrator: DOM.RU
Got a cookie: f1 51 ee db 1c 09 2b a2 de 0a 9d 04 31 32 c7 af
--------------------------------------------------
AC-Ethernet-Address: XX:XX:XX:XX:XX:XX
Comment 2 Ivan A. Melnikov 2018-06-14 20:16:48 MSK
Created attachment 7589 [details]
непроверенный патч

Правильнее будет не выкидывать все CFLGAS и LDFLAGS, а просто убрать из общих LDFLAGS опцию '-shared'. Исполняемые файлы (в отличие от беблиотек) никогда не должны собираться с этой опцией.

Патч прилагаю для примера, как следует я его не проверял.