You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working thought the infix tutorial. After prototyping the parser, I wanted to try it out, but the program segfaults. The problem only went away after I defined a pass.
Backtrace from GDB
(gdb) run
Starting program: <path>/build/<output-bin>
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data (this=0xffffffffffffffe0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/basic_string.h:195
195 { return _M_dataplus._M_p; }
(gdb) backtrace
#0 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data (this=0xffffffffffffffe0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/basic_string.h:195
#1 0x00005555556c3b99 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (this=0x7fffffffd2c0, __str=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/basic_string.h:459
#2 0x00005555556c4a8a in trieste::Driver::run (this=0x7fffffffd858, argc=1, argv=0x7fffffffdee8) at _deps/trieste-src/include/trieste/driver.h:59
#3 0x00005555556beb7b in main (argc=1, argv=0x7fffffffdee8) at <path>/src/main.cc:7
I'm guessing that the issue comes from the Drivers CLI construction here:
I think a few things assume pass count >0, or even >1.
In my opinion, a simple fix is to throw an exception if this happens (that explains the assumption, of course). More fundamentally, one could ask what an empty pass list means and implement that, but I imagine it is a more subtle change.
For instance, I remember having an issue with the fuzzer setup where it would do nothing if there was only one pass.
These are all cases that haven't got good test coverage, on account of all the Trieste users having more than 0 or 1 passes, so I'm sure that contributing a couple of tests + proposed fixes for discussion would be welcome.
I've been working thought the infix tutorial. After prototyping the parser, I wanted to try it out, but the program segfaults. The problem only went away after I defined a pass.
Backtrace from GDB
I'm guessing that the issue comes from the Drivers CLI construction here:
Trieste/include/trieste/driver.h
Lines 58 to 61 in d51038b
The code just calls
pass_names.back();
and the documentation states:I'd be happy to send a fix if the intended behavior is defined. The easiest might be to remove that argument, if no passes have been defined.
I haven't constructed a minimum reproducible example. Just removing the passes from the infix example should result in the same error.
The text was updated successfully, but these errors were encountered: