Bug 91457 - [PATCH] rdp-backend: double free error when using unhandled option
Summary: [PATCH] rdp-backend: double free error when using unhandled option
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-25 03:36 UTC by Dawid Gajownik
Modified: 2015-08-07 01:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
weston output (17.35 KB, text/plain)
2015-07-25 03:36 UTC, Dawid Gajownik
Details
free rdp_backend, not compositor (399 bytes, patch)
2015-07-25 03:37 UTC, Dawid Gajownik
Details | Splinter Review

Description Dawid Gajownik 2015-07-25 03:36:01 UTC
Created attachment 117363 [details]
weston output

Weston with rdp-backend crashes with double free error message when unknown messages is used.

Reproduction steps:
weston --backend=rdp-backend.so --rdp4-key=test  --makemecrash

[snip]

[23:58:23.132] fatal: unhandled option: --makemecrash
*** Error in `weston': double free or corruption (!prev): 0x0000000000f0a8c0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x77a8d)[0x7f44f4e60a8d]
/lib64/libc.so.6(cfree+0x5cd)[0x7f44f4e6cd2d]
weston[0x40858a]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f44f4e09700]
weston(_start+0x29)[0x4089f9]

Explanation:
src/main.c:826
        weston_compositor_destroy(ec)

src/compositor.c:weston_compositor_destroy()

        compositor->backend->destroy(compositor);
        free(compositor);

src/compositor-rdp.c:rdp_destroy(struct weston_compositor *ec)
{
        weston_compositor_shutdown(ec);

        free(ec);
}

        
weston_compositor_destroy() is the same function rdp_destroy(). ec and compositor are the same pointers. free(compositor) is the second free() that crashes weston.
Comment 1 Dawid Gajownik 2015-07-25 03:37:26 UTC
Created attachment 117364 [details] [review]
free rdp_backend, not compositor


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.