Dear colleagues, I found csup is crashing on my building machine on some broken repo element, but cannot quickli realize what's the source of problem Any hints? Relevant info from gdb: #0 stream_open_buf (b=0x0) at /usr/src/usr.bin/csup/../../contrib/csup/stream.c:364 364 b->in = 0; [New Thread 800e0a900 (LWP 100725/csup)] [New Thread 800e0aac0 (LWP 100686/csup)] [New Thread 800e0ac80 (LWP 100548/csup)] [New Thread 800e0ae40 (LWP 100535/csup)] [New Thread 800e641c0 (LWP 100471/csup)] [New Thread 800e64380 (LWP 100443/csup)] [New Thread 800e041c0 (LWP 100446/initial thread)] (gdb) bt #0 stream_open_buf (b=0x0) at /usr/src/usr.bin/csup/../../contrib/csup/stream.c:364 #1 0x0000000000411787 in rcsfile_getdeltatext (rf=0x80111ec00, d=0x801121880, buf_dest=0x7fffff1f9b18) at /usr/src/usr.bin/csup/../../contrib/csup/rcsfile.c:677 #2 0x0000000000411715 in rcsfile_getdeltatext (rf=0x80111ec00, d=0x801121640, buf_dest=0x7fffff1f9c10) at /usr/src/usr.bin/csup/../../contrib/csup/rcsfile.c:658 #3 0x0000000000412174 in rcsfile_write (rf=0x80111ec00, dest=0x8011099c0) at /usr/src/usr.bin/csup/../../contrib/csup/rcsfile.c:579 #4 0x0000000000417d6c in updater_rcsedit (up=0x7fffff1f9f60, fup=0x801121d00, name=0x80111c402 "ports/graphics/Makefile,v", rcsopt=Variable "rcsopt" is not available. ) at /usr/src/usr.bin/csup/../../contrib/csup/updater.c:1688 #5 0x0000000000419a59 in updater_batch (up=0x7fffff1f9f60, isfixups=0) at /usr/src/usr.bin/csup/../../contrib/csup/updater.c:773 #6 0x000000000041a1d1 in updater (arg=Variable "arg" is not available. ) at /usr/src/usr.bin/csup/../../contrib/csup/updater.c:237 #7 0x00000000004158c4 in thread_start (data=Variable "data" is not available. ) at /usr/src/usr.bin/csup/../../contrib/csup/threads.c:169 #8 0x0000000800a224d1 in pthread_getprio () from /lib/libthr.so.3 #9 0x0000000000000000 in ?? () Cannot access memory at address 0x7fffff1fa000 -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------
On Monday, September 12, 2011 2:01:16 am Dmitry Morozovsky wrote:> Dear colleagues, > > I found csup is crashing on my building machine on some broken repo element, > but cannot quickli realize what's the source of problemWhat OS version are you running? I wonder if you have this fix: ------------------------------------------------------------------------ r213300 | jhb | 2010-09-30 10:28:48 -0400 (Thu, 30 Sep 2010) | 9 lines If an RCS file is truncated, rcsfile_getdelta() will return NULL. Instead of faulting, check for NULL. However, returning an error would cause csup to just abort the entire update. Instead, break out of the loop and return ok. The attempts to update the file will trigger a MD5 failure which will cause csup to download the entire file as a fixup. Reviewed by: lulf MFC after: 1 week ------------------------------------------------------------------------ Index: rcsparse.c ==================================================================--- rcsparse.c (revision 213299) +++ rcsparse.c (revision 213300) @@ -318,6 +318,14 @@ d = rcsfile_getdelta(rf, revnum); free(revnum); + /* + * XXX: The RCS file is corrupt, but lie and say it is ok. + * If it is actually broken, then the MD5 mismatch will + * trigger a fixup. + */ + if (d == NULL) + return (0); + /* log string */ asserttoken(sp, KEYWORD); asserttoken(sp, STRING); -- John Baldwin