libweston program segfaults on weston_compositor_load_backend

Matt Hoosier matt.hoosier at gmail.com
Fri May 4 12:55:10 UTC 2018


On Fri, May 4, 2018 at 2:13 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Thu, 03 May 2018 23:38:55 +0100
> adlo <adloconwy at gmail.com> wrote:
>
> > On Thu, 2018-05-03 at 14:12 +0300, Pekka Paalanen wrote:
> > >
> > > what's the backtrace from gdb for that?
> > >
> >
> > Is this any help?
> >
> > #0  0x0000000000000000 in  ()
> > #1  0x00007ffff799c88c in weston_log (fmt=fmt at entry=0x7ffff79b6a7e
> > "Loading module '%s'\n") at libweston/log.c:75
> > #2  0x00007ffff79a603c in weston_load_module (name=name at entry=0x7ffff79
> > b6b24 "wayland-backend.so", entrypoint=entrypoint at entry=0x7ffff79b6aae
> > "weston_backend_init") at libweston/compositor.c:6375
> > #3  0x00007ffff79a6264 in weston_compositor_load_backend
> > (compositor=0x611090, backend=backend at entry=
> >     WESTON_BACKEND_WAYLAND, config_base=config_base at entry=0x7fffffffdc5
> > 0)
> >     at libweston/compositor.c:6485
> > #4  0x0000000000400704 in main (argc=<optimized out>, argv=<optimized
> > out>)
> >     at ../main.c:42
>
> Is that perhaps the very first call to weston_log()?
>
> You need to initialize the logging mechanism before anything can call
> weston_log(). Yeah, it's awkward, could probably be improved, but OTOH
> one would always want all log messages going to the same place, so you
> really do want to initialize the logging before any logging happens to
> avoid losing messages.
>
> The crucial call to make is weston_log_set_handler() with non-NULL
> arguments before any other libweston calls.
>

I wonder if this could be made clearer by adding an assert in weston_log()
if no handler has been installed yet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180504/69d076c5/attachment.html>


More information about the wayland-devel mailing list