Fill RooArgList in loop [SOLVED]

I am using the RooFit package to fit multiple peaks in a spectrum. I have up to 20 peaks that I need to fit, and would like to fill a RooArgList in a loop, instead of needing to explicitly define each of the 20 individual peaks, and associated constants. The RooArgList reports that each entry into the loop occurs without an error, but when I try to combine the peaks with yields in the RooAddPdf I get a segmentation violation.

I am using Arch linux with kernel 3.10.10-1. The ROOT version is 5.99/02, and was compiled from source. I am using a compiled c code to interface with ROOT and RooFit. Please find attached a short code that will reproduce the problem. Thanks for any help!

Here is the stack trace:

There was a crash.
This is the entire stack trace of all threads:

#0 0x00007f2629874dac in waitpid () from /usr/lib/libc.so.6
#1 0x00007f262980051b in do_system () from /usr/lib/libc.so.6
#2 0x00007f262da899d9 in TUnixSystem::StackTrace() () from /home/programs/sources/root/lib/libCore.so.5.99
#3 0x00007f262da8b5ec in TUnixSystem::DispatchSignals(ESignals) () from /home/programs/sources/root/lib/libCore.so.5.99
#4
#5 0x00007f262dd62820 in typeinfo for TNamed () from /home/programs/sources/root/lib/libCore.so.5.99
#6 0x00007f262a719519 in RooAbsArg::addServer(RooAbsArg&, bool, bool) () from /home/programs/sources/root/lib/libRooFitCore.so.5.99
#7 0x00007f262a6492b3 in RooListProxy::add(RooAbsArg const&, bool, bool, bool) () from /home/programs/sources/root/lib/libRooFitCore.so.5.99
#8 0x00007f262a72a222 in RooAddPdf::RooAddPdf(char const*, char const*, RooArgList const&, RooArgList const&, bool) () from /home/programs/sources/root/lib/libRooFitCore.so.5.99
#9 0x00000000004043bf in fitting () at src/fitting.cpp:83
#10 0x0000000000403874 in main (argc=1, argv=0x7fffb63c81f8) at src/fitting.cpp:28

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#5 0x00007f262dd62820 in typeinfo for TNamed () from /home/programs/sources/root/lib/libCore.so.5.99
#6 0x00007f262a719519 in RooAbsArg::addServer(RooAbsArg&, bool, bool) () from /home/programs/sources/root/lib/libRooFitCore.so.5.99
#7 0x00007f262a6492b3 in RooListProxy::add(RooAbsArg const&, bool, bool, bool) () from /home/programs/sources/root/lib/libRooFitCore.so.5.99
#8 0x00007f262a72a222 in RooAddPdf::RooAddPdf(char const*, char const*, RooArgList const&, RooArgList const&, bool) () from /home/programs/sources/root/lib/libRooFitCore.so.5.99
#9 0x00000000004043bf in fitting () at src/fitting.cpp:83
#10 0x0000000000403874 in main (argc=1, argv=0x7fffb63c81f8) at src/fitting.cpp:28

fitting.cpp (2.54 KB)