bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

[gtk2] moz+gtk2 crashes with --enable-ctl




16 years ago
15 years ago


(Reporter: Robin Lu, Assigned: Louie Zhao)



Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: review+)


(1 attachment)



16 years ago
1. build mozilla with --enable-default-toolkit=gtk2 --enable-ctl
2. launch the mozilla
3. type some words in the url bar
4. use shift-arrow to select the word you have typed
result: mozilla crashes

the stack is:
Program ./dist/bin/mozilla-bin (pid = 15022) received Segmentation fault
nsProfileLock::FatalSignalHandler(int, siginfo*, void*)+0x0000010C
UNKNOWN [/lib/i686/libpthread.so.0 +0x0000C516]
UNKNOWN [./dist/bin/mozilla-bin +0x00028C40]
UNKNOWN [/usr/lib/pango/1.1.0/modules/pango-basic-x.so +0x00001B7A]
UNKNOWN [/usr/lib/pango/1.1.0/modules/pango-basic-x.so +0x00001CAE]
nsULE::GetCtlData(unsigned short const*, unsigned, _PangoGlyphString*, char
nsULE::PrevCluster(unsigned short const*, unsigned, int, int*)+0x00000129
nsTextFrame::PeekOffset(nsIPresContext*, nsPeekOffsetStruct*)+0x0000091A
nsSelection::MoveCaret(unsigned, int, nsSelectionAmount)+0x00000BA1
nsSelection::CharacterMove(int, int)+0x0000003F

Module ctl uses a native pangolite. The problem seems like the confilct between
the real pango in the system with the native pangolite. My question is: since
gtk2 has already based on pango, do we still need to enable the ctl module?


16 years ago
Severity: normal → critical
Keywords: crash

Comment 1

16 years ago
> My question is: since
> gtk2 has already based on pango, do we still need to enable the ctl module?

AFAIK yes, since Mozilla CTL support sits partially in the crossplatform layout
code (e.g. mozilla/layout/), not in the device-spefific layer (e.g.
Since the CTL code should work (some day :) on all platforms we need our own
copy of pango within the tree (we can't use the native pango library since
Mozilla's Pango version is a modified&cut-down version).

Comment 2

16 years ago
then our next task is to porting ctl to gtk2?
I suggest to use pango in platform instead of pangolite in mozilla source tree
at least for moz+gtk2.

Comment 3

16 years ago
Robin Lu write:
> then our next task is to porting ctl to gtk2?
> I suggest to use pango in platform instead of pangolite in mozilla source tree
> at least for moz+gtk2.

I am not sure whether this is wise. This would mean dependicy to another library
and another set of possible Linux/GTK2-only bugs.
It's better to use a "all or nothing"-way in this case. Either all platforms
should use the normal Pango library (doing that may require another bunch of
Gnome-only libs to be compiled with Mozilla - and I doubt people are much happy
with that...) or all platforms stay with the use of the builtin PangoLite

Comment 4

16 years ago
Created attachment 109992 [details] [diff] [review]
working patch

mozilla/intl/ctl/pangolite code is directly copy from www.pango.org. when
mozilla is based on gtk2, the name of functions defined in
"mozilla/intl/ctl/pangolite" is same to pango in gtk2. But there are little
difference between them, such as parameters of functions. When invoking such
functions, mozilla will be confused since it don't know which one to use.

Following Roland's advice, in gtk2 build, mozilla still use
"mozilla/intl/ctl/pangolite", not pango in gtk2. So we must change the names of
functions of mozilla's pangolite to make it not to confict with gtk2 pango.

This patch changes the name of datatypes and functions to meet this
requirement. It works ok on linux. I will test it on solaris tomorrow.


16 years ago
Attachment #109992 - Flags: review?(prabhat.hegde)

Comment 5

16 years ago
I have tested the patch both on linux and on Solaris, it works well.

Roland and katakai, I want to confirm 1 thing since you are familiar with CTL.
During my investigation, I found the displaying of Thai language has no relation
to CTL code in mozilla(mozilla/intl/ctl/), which is only related to "selection".

If don't enable ctl, I can only select 1 Thai char each time; if enable ctl, I
can't select Thai char seperately. I can only select the whole glyph(some glyphs
include 2 Thai chars) instead. Is that the function of CTL module in mozilla?

I have made 4 buildings(gtk, gtk+ctl, gtk2, gtk2+ctl). The comparison of them
demonstrates that CTL is only related to "selection". Is my conclustion correct?

With my patch, the behavior of "selection" of Thai language in "gtk2+ctl" is
same to gtk+ctl.

Comment 6

16 years ago

CTL code also affects rendering (Thai font-encoding is standard [enabled in
intl/ctl code via nsUnicodeToTIS620.* with a hook in nsFontMetrics* for
tis620-2(thai) and sun.unicode.india-0(devanagari) font encoding] of thai and
devanagari characters. This is to enable shaping based on font encoding. 

I've r= the patch, but i don't have resource to test it at the moment. I will be
back from vacation on 01/01/03 and will look at it again then. 


Comment 7

15 years ago
Is there any public place where people can download
"sun.unicode.india-0"-encoded X11 fonts from ?

Comment 8

15 years ago
I'll try the patch but I have a problem around gmodule checking at configure,

checking LIBIDL_CFLAGS... -I/usr/include/libIDL-2.0 -I/usr/include/glib-2.0
checking LIBIDL_LIBS... -lIDL-2 -lglib-2.0  
configure: error: Cannot build ctl without gmodule support in glib.

Can anyone tell me the exact build option?

Comment 9

15 years ago
There is no special option needed for "ctl". I just use 
"./configure --enable-default-toolkit=gtk2 --enable-ctl" on Linux for my workspace.

Comment 10

15 years ago
hi Louie,

I tested the patch on RedHat8.0 and it works fine. On Solaris9 with GNOME2.0, i
have problems in building it. Problem is as Masaki mentioned earlier.
GLIB_CFLAGS is not set when --enable-default-toolkit=gtk2 is set. This breaks
gmodule checking in SUNCTL configure option. Can you look at it? I am no expert
in configure. DOn't have the same problem when --enable-default-toolkit is not set.
For Roland: Free font that supports 8 Indian language scripts
(sun.unicode.india-0) encoding is at http://www.sun.com/developers/gadc/tools/.
Any problem with the font, pl let me know.


Comment 11

15 years ago
Louie - pl correct the SUNCTL configure option for gmodule checking. Possibly
replace current checking with pkg-config checking.
Assignee: prabhat.hegde → Louie.Zhao

Comment 12

15 years ago
There is an configure bug when both --enable-default-toolkit=gtk2 --enable-ctl,
I file bug 189433 to deal with it.

Prabhat Hegde: You can delete the CTL checking code for glib in "configure"
(line 14651 - line 14685) just like mozilla1.2. This checking is for some glib
on win32, which may not support gmodule. The glib2.0 does support gmodule.

Comment 13

15 years ago
Verified that patch 109992 above works on Solaris + Gnome2.0 after building it
using workarounds. To test the Hindi portion on Linux requires additional work.
(Downloading and installing "sun.unicode.india-0" encoded fonts from

You will also require an input method that supports Hindi.
r=for the pangolite portion.

Comment 14

15 years ago
Could you please commit this patch. thanks.
Whiteboard: review+


15 years ago
Attachment #109992 - Flags: review?(prabhat.hegde) → review+


15 years ago
Blocks: 199741

Comment 16

15 years ago
*** Bug 198519 has been marked as a duplicate of this bug. ***


15 years ago
No longer blocks: 199741


15 years ago
Blocks: 199741
You need to log in before you can comment on or make changes to this bug.