Windows cascading mode cause segfault

Bug #1302098 reported by Jing Wang
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Compiz
In Progress
High
Jing Wang
0.9.11
Triaged
High
Unassigned
compiz (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I found a critical bug in compiz, the x-window-manager.

Ubuntu version : 12.04.4 LTS
compiz version : 1:0.9.7.12-0ubuntu3

The test case is as below.
1) Set the window placement option to cascade mode.
- run "gnome-terminal" and then type "sudo gconftool-2 --type int --set /apps/compiz-1/plugins/place/screen0/options/mode 0"
OR
- run "gconf-editor"(At first, install "gconf-editor" from software center) and then go through " /apps/compiz-1/plugins/place/screen0/options/" and the set "mode"value to 0

2) Run "gnome-terminal" and then repeat opening new windows about 30 times.(using shortcut key <Ctrl+Alt+T>)
(OR run "nautilus" file manager and then repeat opening new windows about 30 times (using shortcut key <Ctrl+N>))

It is Note for you: Although you reproduce this bug, your Ubuntu will not break. System restore is very simple. Please try log out and log in again. And then try resetting as following.
run "gnome-terminal" and then type "sudo gconftool-2 --type int --set /apps/compiz-1/plugins/place/screen0/options/mode 2"
(OR - run "gconf-editor"(At first, install "gconf-editor" from software center) and then go through " /apps/compiz-1/plugins/place/screen0/options/" and the set "mode"value to 2)

Jing Wang (prepangolin)
tags: added: compiz-bug
Revision history for this message
Jing Wang (prepangolin) wrote :

When you run "dmesg", you can see segfault message.

Revision history for this message
manlonglive (manlonglive) wrote :

I found a bug in this type.
My working status is the following:

Ubuntu version : 12.04.4 LTS
compiz version : 1:0.9.7.12-0ubuntu3

I want to resolve this bug quickly now.

Regards.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed
Changed in compiz:
status: New → Confirmed
Revision history for this message
Jing Wang (prepangolin) wrote :

It's on me.

Changed in compiz:
assignee: nobody → Jing Wang (prepangolin)
status: Confirmed → Fix Committed
Revision history for this message
Jing Wang (prepangolin) wrote :

- Disable cascadeFindFirstFit
The cause of segfault, so reference to null pointer
std::sort (belowSorted.begin(), belowSorted.end(), compareTopmost);
I got the log message using compLogMessage() function.
You can got the message in console, to do this, type #compiz --replace ccp

- Fixed to cascadeFindNext function
If we go off the screen, start over with a new cascade.
I fixed to error condition: cascadeY + winHeight > workArea.bottom()
There was an logical error on calculating of window position(x,y)
e.g. 465+434 > 900 in this case: error occured(no next to cascade)

In my opinion, First, cascadeFindFirstFit function was not completed, so useless
Second, my patch is tricky, so need to improve.
Good review for this patch would be welcome!

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "cascade_mode_segfault.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Stephen M. Webb (bregma)
Changed in compiz:
importance: Undecided → Medium
Changed in compiz (Ubuntu):
importance: Undecided → Medium
Changed in compiz:
status: Fix Committed → In Progress
Revision history for this message
Jing Wang (prepangolin) wrote :

How to output the log to console?
 - after changing any code of compiz, then make install
 - It can be logged via CompLogMessage() function
 - replace the new compiled libplace.so with /usr/lib/compiz/libplace.so
 - In Terminal, type "$compiz --replace"
It will show messages

Revision history for this message
Jing Wang (prepangolin) wrote :

Updated for segfault

Stephen M. Webb (bregma)
Changed in compiz:
milestone: none → 0.9.12.1
importance: Medium → High
Stephen M. Webb (bregma)
Changed in compiz:
milestone: 0.9.12.1 → 0.9.12.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.