I rebuilt the lftp package with debugging symbols. It seems the "wait all" is part of what is causing the crashing.
(gdb) bt full #0 0x00007f0f8e892107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 resultvar = 0 pid = 17630 selftid = 17630 #1 0x00007f0f8e8934e8 in __GI_abort () at abort.c:89 save_stage = 2 act = {__sigaction_handler = {sa_handler = 0x7ffccf538f72, sa_sigaction = 0x7ffccf538f72}, sa_mask = {__val = {139704793817505, 5309317, 57, 4, 140723786838752, 50722992960, 7713696, 0, 0, 0, 0, 21474836480, 139704793817031, 140723786838904, 139704825872384, 139704793832680}}, sa_flags = 5309325, sa_restorer = 0x510400 <xlist<SMTask>::add_tail(xlist<SMTask>*)::__PRETTY_FUNCTION__>} sigs = {__val = {32, 0 <repeats 15 times>}} #2 0x00007f0f8e88b226 in __assert_fail_base (fmt=0x7f0f8e9c1ce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x51038d "!node->next && !node->prev", file=file@entry=0x510385 "xlist.h", line=line@entry=57, function=function@entry=0x510400 <xlist<SMTask>::add_tail(xlist<SMTask>*)::__PRETTY_FUNCTION__> "void xlist<T>::add_tail(xlist<T>*) [with T = SMTask]") at assert.c:92 str = 0x11fc000 "" total = 4096 #3 0x00007f0f8e88b2d2 in __GI___assert_fail (assertion=0x51038d "!node->next && !node->prev", file=0x510385 "xlist.h", line=57, function=0x510400 <xlist<SMTask>::add_tail(xlist<SMTask>*)::__PRETTY_FUNCTION__> "void xlist<T>::add_tail(xlist<T>*) [with T = SMTask]") at assert.c:101 No locals. #4 0x000000000046ae44 in xlist<SMTask>::add_tail (this=0x75b3a0 <SMTask::deleted_tasks>, node=0x123c260) at xlist.h:57 __PRETTY_FUNCTION__ = "void xlist<T>::add_tail(xlist<T>*) [with T = SMTask]" #5 0x000000000046acd1 in xlist<SMTask>::add_tail (this=0x75b3a0 <SMTask::deleted_tasks>, node=...) at xlist.h:60 No locals. #6 0x000000000046a17f in SMTask::DeleteLater (this=0x123c210) at SMTask.cc:128 No locals. #7 0x000000000046a1b9 in SMTask::Delete (task=0x123c210) at SMTask.cc:135 No locals. #8 0x000000000046b35b in ProcWait::DeleteAll () at ProcWait.cc:152 w = 0x123c210 #9 0x0000000000408295 in main (argc=3, argv=0x7ffccf537608) at lftp.cc:613 args = {ptr = 0x0, static null = <optimized out>} exit_code = 0 I also added a "debug 100" statement to the top of my script and logged the output for the crashing session: at http://pastebin.com/raw.php?i=iUALayQX