boostorg / boostorg/process

Missing return statements in file default_launcher.hpp cause an 'illegal instruction'

Open
#527 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
145
Forks
151
PR merge metrics
No merged PRs in 30d

Description

In `boost/process/v2/posix/default_launcher.hpp` there is a template function `invoke_on_success` defined as
```
template
inline auto invoke_on_success(Launcher & launcher, const filesystem::path &executable,
const char * const * (&cmd_line),
Init && init, derived && )
-> decltype(init.on_success(launcher, executable, cmd_line))
{
init.on_success(launcher, executable, cmd_line);
}
```
This function is supposed to have a return value, but a `return` statement is missing. This causes (on my installation, using recent versions of both g++ and clang++) an 'illegal instruction' followed by an inevitable crash.

Adding a return statement solved the problem:
```
template
inline auto invoke_on_success(Launcher & launcher, const filesystem::path &executable,
const char * const * (&cmd_line),
Init && init, derived && )
-> decltype(init.on_success(launcher, executable, cmd_line))
{
return init.on_success(launcher, executable, cmd_line);
}
```
The same problem occurs (in the same file `default_launcher.hpp`) with the routines
`invoke_on_error`, `invoke_on_fork_error` and `invoke_on_exec_error`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.