Bug 27540 - [965gm bisected] X server crashes at start with intel driver, assertion in malloc
Summary: [965gm bisected] X server crashes at start with intel driver, assertion in ma...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: Daniel Vetter
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
: 27547 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-08 12:39 UTC by Calvin Walton
Modified: 2010-04-09 00:29 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
allocate with the correct size (725 bytes, patch)
2010-04-08 13:12 UTC, Daniel Vetter
no flags Details | Splinter Review

Description Calvin Walton 2010-04-08 12:39:35 UTC
After a series of XVMC changes made in the intel driver git, the driver no longer starts on my Intel 965GM (Thinkpad R61) due to the following assertion:

X: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *)
&((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd))))
&& old_size == 0) || ((unsigned long) (old_size) >= (unsigned
long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 *
(sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size &
0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted

Right after this is printed to the X log:
[   729.905] (==) intel(0): DPMS enabled
[   729.905] (==) intel(0): Intel XvMC decoder enabled
[   729.905] (II) intel(0): Set up textured video
[   729.905] (II) intel(0): Set up overlay video

I've bisected this, and it resulted in the following commit as the first bad commit: (all previous commits start fine)
79fe4caafd21f6ca262901eac4a66ce5a4eaf548 is the first bad commit
commit 79fe4caafd21f6ca262901eac4a66ce5a4eaf548
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Mar 9 16:20:33 2010 +0100

    XvMC: dynamically allocate adaptor
    
    And kill all the static structures. This way it's clearer what's
    common and what's specific. And the code is shorter too.
    
    Also clean up src/i830_hwmc.c - kill the nonstandard surface types
    for i915 and the associated code.
    
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Bisect log:
git bisect start
# bad: [bdf0ee509c26ab35e60f3ed02549efa435be032f] i965 Xv: fix chroma pitch
git bisect bad bdf0ee509c26ab35e60f3ed02549efa435be032f
# good: [440b4d207b730112169827d0b90b46596659b504] Increase version to 2.11.0
git bisect good 440b4d207b730112169827d0b90b46596659b504
# good: [00b63ecb192b7eafea9482bf5c5c5d442ce2c6fc] XvMC: directly set driver type in context creation
git bisect good 00b63ecb192b7eafea9482bf5c5c5d442ce2c6fc
# bad: [6c44ce9e127e531224bac825da7918800a3e6a1a] libXvMC i915: s/i915XvMCSurface/struct intel_xvmc_surface/
git bisect bad 6c44ce9e127e531224bac825da7918800a3e6a1a
# bad: [9eeabf876d1f70f5525bbac438414557dd2d4335] libXvMC: derive driver surfaces from struct intel_xvmc_surface
git bisect bad 9eeabf876d1f70f5525bbac438414557dd2d4335
# bad: [a0058369bbdfb49f8df5ee1e50671115927d3565] XvMC: kill intel_xvmc_command
git bisect bad a0058369bbdfb49f8df5ee1e50671115927d3565
# bad: [79fe4caafd21f6ca262901eac4a66ce5a4eaf548] XvMC: dynamically allocate adaptor
git bisect bad 79fe4caafd21f6ca262901eac4a66ce5a4eaf548
Comment 1 Nick Bowler 2010-04-08 13:00:54 UTC
I can confirm this issue on a G45.

Reverting the implicated commit (and fixing the trivial conflict) allows the server to start again.
Comment 2 Daniel Vetter 2010-04-08 13:12:45 UTC
Created attachment 34825 [details] [review]
allocate with the correct size

Does this patch help?
Comment 3 Calvin Walton 2010-04-08 13:22:08 UTC
Yes, that patch fixes the issue. X starts correctly now :)
Comment 4 Nick Bowler 2010-04-08 13:23:36 UTC
Yup, the server starts again with that patch applied.
Comment 5 Daniel Vetter 2010-04-08 13:38:23 UTC
Fix pushed. Thanks for reporting&testing.
Comment 6 Gordon Jin 2010-04-09 00:29:28 UTC
*** Bug 27547 has been marked as a duplicate of this bug. ***


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.