• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xmms2 / xmms2-devel / 26
54%

Build:
DEFAULT BRANCH: master
Ran 06 Dec 2018 07:38AM UTC
Jobs 1
Files 103
Run time 2912min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
26

Pull #5

travis-ci

web-flow
OTHER: fix c++ client dangling reference

On #xmm2 Chewi reported c++/tut7 to be broken at start:

```
GLib-WARNING **: glib-2.56.2/glib/giounix.c:410
Error while getting flags for FD: Bad file descriptor (9)
```

valgrind shows the problem as read of uninitialized data:

```
$ valgrind ./tut7

==32268== Conditional jump or move depends on uninitialised value(s)
==32268==    at 0x49DC36B: xmmsc_mainloop_gmain_init (xmmsclient-glib.c:80)
==32268==    by 0x49E11BE: Xmms::GMainloop::GMainloop(xmmsc_connection_St*) (xmmsclient++-glib.cpp:11)
==32268==    by 0x10C64D: main (in /home/slyfox/dev/git/xmms2-devel/doc/tutorial/c++/tut7)
==32268==  Uninitialised value was created by a stack allocation
==32268==    at 0x49E119A: Xmms::GMainloop::GMainloop(xmmsc_connection_St*) (xmmsclient++-glib.cpp:8)
```

This happens due to use of dangling C++ reference to stack variable:

```
// somewhere in src/include/xmmsclient/xmmsclient++/mainloop.h
class MainloopInterface {
    MainloopInterface( xmmsc_connection_t* conn ) :
        running_( false ), conn_( conn ) { }
  protected:
    bool running_;
    xmmsc_connection_t*& conn_;
}
```

Note: `conn_` refers to dangling local variable of
`MainloopInterface::MainloopInterface` constructor.

The fix is to pass through pointer reference.
`MainLoop::MainLoop()` already does it.

Reported-by: James Le Cuirot
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Pull Request #5: OTHER: fix c++ client dangling reference

6686 of 12465 relevant lines covered (53.64%)

200.95 hits per line

Jobs
ID Job ID Ran Files Coverage
5 26.5 (BUILD_MODE=coverage) 06 Dec 2018 07:38AM UTC 0
53.64
Travis Job 26.5
Source Files on build 26
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #26
  • Pull Request #5
  • PR Base - master (#21)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc