projectGenerator segfaults

I recently compiled and installed of on mint 18.3 (based on ubuntu 16.04). I can successfully run the examples included with of but the project generator segfault when I try to create a project with it. The projectGenerator command works when no arguments are passed to it and it correctly displays the documentation but anytime I try to give it a path it segfaults without any other input.

Here is the output when I ran the command through valgrind :

==13086== Memcheck, a memory error detector
==13086== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==13086== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==13086== Command: projectGenerator test
==13086== 

==13086== Conditional jump or move depends on uninitialised value(s)
==13086==    at 0x96B212A: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==13086==    by 0x6A566C: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==13086==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x46E214: main (in /usr/local/bin/projectGenerator)
==13086== 
==13086== Conditional jump or move depends on uninitialised value(s)
==13086==    at 0x96B21F3: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==13086==    by 0x6A566C: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==13086==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x46E214: main (in /usr/local/bin/projectGenerator)
==13086== 
==13086== Use of uninitialised value of size 8
==13086==    at 0x96B21E9: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==13086==    by 0x6A566C: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==13086==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x46E214: main (in /usr/local/bin/projectGenerator)
==13086== 
==13086== Invalid read of size 8
==13086==    at 0x6A5679: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==13086==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x46E214: main (in /usr/local/bin/projectGenerator)
==13086==  Address 0xffffffffffffffe8 is not stack'd, malloc'd or (recently) free'd
==13086== 
==13086== 
==13086== Process terminating with default action of signal 11 (SIGSEGV)
==13086==  Access not within mapped region at address 0xFFFFFFFFFFFFFFE8
==13086==    at 0x6A5679: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==13086==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==13086==    by 0x46E214: main (in /usr/local/bin/projectGenerator)
==13086==  If you believe this happened as a result of a stack
==13086==  overflow in your program's main thread (unlikely but
==13086==  possible), you can try to increase the size of the
==13086==  main thread stack using the --main-stacksize= flag.
==13086==  The main thread stack size used in this run was 8388608.
==13086== 
==13086== HEAP SUMMARY:
==13086==     in use at exit: 329,868 bytes in 2,629 blocks
==13086==   total heap usage: 3,343 allocs, 714 frees, 404,616 bytes allocated
==13086== 
==13086== LEAK SUMMARY:
==13086==    definitely lost: 0 bytes in 0 blocks
==13086==    indirectly lost: 0 bytes in 0 blocks
==13086==      possibly lost: 1,352 bytes in 18 blocks
==13086==    still reachable: 328,516 bytes in 2,611 blocks
==13086==                       of which reachable via heuristic:
==13086==                         stdstring          : 3,884 bytes in 80 blocks
==13086==                         newarray           : 1,536 bytes in 16 blocks
==13086==         suppressed: 0 bytes in 0 blocks
==13086== Rerun with --leak-check=full to see details of leaked memory
==13086== 
==13086== For counts of detected and suppressed errors, rerun with: -v
==13086== Use --track-origins=yes to see where uninitialised values come from
==13086== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)```

Could you try the nightly build at the bottom of: https://openframeworks.cc/download/

I think this might be fixed in the latest builds.

Thanks!
Theo

I get the same result with the latest nightly build :

$ valgrind projectGenerator test
==20049== Memcheck, a memory error detector
==20049== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==20049== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==20049== Command: projectGenerator test
==20049== 

==20049== Conditional jump or move depends on uninitialised value(s)
==20049==    at 0x96B212A: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==20049==    by 0x6A694C: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==20049==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x46E444: main (in /usr/local/bin/projectGenerator)
==20049== 
==20049== Conditional jump or move depends on uninitialised value(s)
==20049==    at 0x96B21F3: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==20049==    by 0x6A694C: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==20049==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x46E444: main (in /usr/local/bin/projectGenerator)
==20049== 
==20049== Use of uninitialised value of size 8
==20049==    at 0x96B21E9: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==20049==    by 0x6A694C: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==20049==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x46E444: main (in /usr/local/bin/projectGenerator)
==20049== 
==20049== Invalid read of size 8
==20049==    at 0x6A6959: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==20049==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x46E444: main (in /usr/local/bin/projectGenerator)
==20049==  Address 0xffffffffffffffe8 is not stack'd, malloc'd or (recently) free'd
==20049== 
==20049== 
==20049== Process terminating with default action of signal 11 (SIGSEGV)
==20049==  Access not within mapped region at address 0xFFFFFFFFFFFFFFE8
==20049==    at 0x6A6959: Poco::Path::clear() (in /usr/local/bin/projectGenerator)
==20049==    by 0x516DE50: Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E108: Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x516E195: Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (in /usr/lib/libPocoFoundation.so.9)
==20049==    by 0x46E444: main (in /usr/local/bin/projectGenerator)
==20049==  If you believe this happened as a result of a stack
==20049==  overflow in your program's main thread (unlikely but
==20049==  possible), you can try to increase the size of the
==20049==  main thread stack using the --main-stacksize= flag.
==20049==  The main thread stack size used in this run was 8388608.
==20049== 
==20049== HEAP SUMMARY:
==20049==     in use at exit: 329,868 bytes in 2,629 blocks
==20049==   total heap usage: 3,343 allocs, 714 frees, 404,616 bytes allocated
==20049== 
==20049== LEAK SUMMARY:
==20049==    definitely lost: 0 bytes in 0 blocks
==20049==    indirectly lost: 0 bytes in 0 blocks
==20049==      possibly lost: 1,352 bytes in 18 blocks
==20049==    still reachable: 328,516 bytes in 2,611 blocks
==20049==                       of which reachable via heuristic:
==20049==                         stdstring          : 3,884 bytes in 80 blocks
==20049==                         newarray           : 1,536 bytes in 16 blocks
==20049==         suppressed: 0 bytes in 0 blocks
==20049== Rerun with --leak-check=full to see details of leaked memory
==20049== 
==20049== For counts of detected and suppressed errors, rerun with: -v
==20049== Use --track-origins=yes to see where uninitialised values come from
==20049== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)

Same exact problem on Ubuntu Bionic (18.04). I tried many builds, for many months. I postponed my use of OF because of that bug. I’m not helping much, but I wanted to express my solidarity. :wink:

I investigated more using valgrind on a Debug version of projectGenerator.
The problem is related to functions from boost::filesystem
A workaround is to add “return true;” at the very beginning of functions isGoodProjectPath and isGoodOFPath.
I hope the newest Ubuntu distribution (20.04LTS) will play nicer with OF.

I confirm that it works with Ubuntu 20.04LTS; its version of boost is 1.71.