parser segfault with sample, all;

Issue #96 resolved
Laurie Nevay created an issue

Adding

sample, all;

at the end of the main file causes a segfaul in the parser in the develop branch currently.

parser> include filename is: /Users/nevay/physics/reps/bdsim-lhc-model/input/4TeV/b1/test/testfile_options.gmad parser> reading file /Users/nevay/physics/reps/bdsim-lhc-model/input/4TeV/b1/test/testfile_options.gmad parser> Setting value ngenerate 100 parser> Setting value beampipeRadius 0.03 parser> Setting value physicsList standard parser> Setting value outerDiameter 0.5 parser> Setting value beampipeThickness 0.003

Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 0x00007fff86fc2457 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign () (gdb) bt #0 0x00007fff86fc2457 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign () #1 0x000000010034c820 in yyparse () at string:1337 #2 0x0000000100311d01 in GMAD::gmad_parser (f=0x7fff787aa928) at /Users/nevay/physics/reps/bdsim/parser/gmad.cc:104 #3 0x000000010031461d in GMAD::gmad_parser (name=<value temporarily unavailable, due to optimizations>) at /Users/nevay/physics/reps/bdsim/parser/gmad.cc:147 #4 0x0000000100013f00 in main (argc=3, argv=0x7fff5fbff240) at /Users/nevay/physics/reps/bdsim/bdsim.cc:82 (gdb)

Attached is a sample lattice. In the main file testlattice.gmad if you comment out the last line using the sample, all; syntax, the parser doesn't segfault.

Well, it's a bad access rather than a segfault but you get the idea.

Comments (2)

  1. Jochem Snuverink

    Thanks for testing this out. I hadn't realised I needed to create the memory, a bit remarkable that it worked in my small tests actually.

  2. Log in to comment