Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] SIGSEV upon conf reload

2004-05-28 by Cyril Guibourg

manu@... writes:

> You can add printf at the beginning and the end of command blocks in the
> conf_yacc.y file, that could help. But source debugging should work with
> the trick described above.

I've put conf_yacc.y in debug mode it didn't help.

This is very strange: the very first time conf_parse is called, I see all
state machine debug output. On reload, I go directly to the sigsev. My
understanding is that some return address in the stack is incorrect.

Right ?


Breakpoint 1 at 0x8051f7a: file conf.c, line 91.
(gdb) info address conf_parse
Symbol "conf_parse" is a function at address 0x804e90c.
(gdb) r -f /milter/greylist.conf
Starting program: /home/cyril/ports/milter-greylist/work/milter-greylist-1.2.2/milter-greylist -f /milter/greylist.conf

Breakpoint 1, conf_load () at conf.c:91
91              memcpy(&conf, &defconf, sizeof(conf));
(gdb) c
Continuing.
milter-greylist: reloading "/milter/greylist.conf"
[Switching to process 10467, thread 2]

Breakpoint 1, conf_load () at conf.c:91
91              memcpy(&conf, &defconf, sizeof(conf));
(gdb) info address conf_parse
Symbol "conf_parse" is a function at address 0x804e90c.
(gdb) info frame
Stack level 0, frame at 0xbfabadfc:
 eip = 0x8051f7a in conf_load (conf.c:91); saved eip 0x805211e
 called by frame at 0xbfabae8c
 source language c.
 Arglist at 0xbfabadfc, args: 
 Locals at 0xbfabadfc, Previous frame's sp is 0x0
 Saved registers:
  ebp at 0xbfabadfc, eip at 0xbfabae00
(gdb) info register 
eax            0x2811d65c       672257628
ecx            0x15     21
edx            0x28138018       672366616
ebx            0x2807f598       671610264
esp            0xbfabade4       0xbfabade4
ebp            0xbfabadfc       0xbfabadfc
esi            0x805f090        134606992
edi            0xbfabaf4c       -1079267508
eip            0x8051f7a        0x8051f7a
eflags         0x286    646
cs             0x1f     31
ss             0x2f     47
ds             0x2f     47
es             0x2f     47
fs             0x2f     47
gs             0x2f     47
(gdb) info threads
  6 process 10467, thread 6  0x280d7653 in _thread_kern_sched () from /usr/lib/libc_r.so.4
  5 process 10467, thread 5  0x280d7653 in _thread_kern_sched () from /usr/lib/libc_r.so.4
  4 process 10467, thread 4  0x280d7653 in _thread_kern_sched () from /usr/lib/libc_r.so.4
  3 process 10467, thread 3  0x280d7653 in _thread_kern_sched () from /usr/lib/libc_r.so.4
* 2 process 10467, thread 2  conf_load () at conf.c:91
  1 process 10467, thread 1  0x280d7653 in _thread_kern_sched () from /usr/lib/libc_r.so.4
(gdb) step
96              if ((stream = fopen(conffile, "r")) == NULL) {
(gdb) 
103             conf_in = stream;
(gdb) 
104             conf_parse();
(gdb) 

Program received signal SIGSEGV, Segmentation fault.
0x804e915 in conf_parse () at y.tab.c:751
751     }
(gdb) info address conf_parse
Symbol "conf_parse" is a function at address 0x804e90c.
(gdb) p yystate
$1 = 671610264
(gdb) l 730
725       YYFPRINTF (yyout, ")");
726     }
727     #endif /* YYDEBUG. */
728
729
730     /*-----------------------------------------------.
731     | Release the memory associated to this symbol.  |
732     `-----------------------------------------------*/
733
734     static void
(gdb) l
735     #if defined (__STDC__) || defined (__cplusplus)
736     yydestruct (int yytype, YYSTYPE yyvalue)
737     #else
738     yydestruct (yytype, yyvalue)
739         int yytype;
740         YYSTYPE yyvalue;
741     #endif
742     {
743       /* Pacify ``unused variable'' warnings.  */
744       (void) yyvalue;
(gdb) l
745
746       switch (yytype)
747         {
748           default:
749             break;
750         }
751     }
752
753     ^L
754
(gdb) info frame
Stack level 0, frame at 0xbfabaddc:
 eip = 0x804e915 in conf_parse (y.tab.c:751); saved eip 0x8052009
 called by frame at 0xbfabadfc
 source language c.
 Arglist at 0xbfabaddc, args: 
 Locals at 0xbfabaddc, Previous frame's sp is 0x0
 Saved registers:
  ebx at 0xbfa884c4, ebp at 0xbfabaddc, esi at 0xbfa884c8, edi at 0xbfa884cc, eip at 0xbfabade0
(gdb) info register
eax            0x28131d20       672341280
ecx            0x2811b874       672249972
edx            0x8      8
ebx            0x2807f598       671610264
esp            0xbfa884d0       0xbfa884d0
ebp            0xbfabaddc       0xbfabaddc
esi            0x805f090        134606992
edi            0xbfabaf4c       -1079267508
eip            0x804e915        0x804e915
eflags         0x10282  66178
cs             0x1f     31
ss             0x2f     47
ds             0x2f     47
es             0x2f     47
fs             0x2f     47
gs             0x2f     47

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.