Closed Bug 232783 Opened 21 years ago Closed 21 years ago

Segmentation fault in iconv

Categories

(Core :: Internationalization, defect)

x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla, Assigned: smontagu)

Details

(Keywords: crash)

User-Agent:       
Build Identifier: http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.6/mozilla-i686-pc-linux-gnu-1.6.tar.gz

I had Mozilla 1.6 installed and it was running fine. I wanted to install KDE and of course, 
with dependencies, I ended upgrading QT, XFree86 and a bunch of libs. Now, when I 
tried to restart mozilla, I got the following error: 
 
/usr/local/mozilla/run-mozilla.sh: line 72:  3241 Segmentation fault      "$prog" ${1
+"$@"} 
 
I tried deleting mozilla and reinstalling. The reinstaller gave me the same error at line 
54. I downloaded the tgz and untarred it to /usr/local and tried running it and I was back 
to the same error. An strace mozilla looks like 
 
[SNIP] 
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [RT_0], 8) = 0 
fork()                                  = 3184 
rt_sigprocmask(SIG_SETMASK, [RT_0], NULL, 8) = 0 
rt_sigprocmask(SIG_BLOCK, [CHLD], [RT_0], 8) = 0 
rt_sigprocmask(SIG_SETMASK, [RT_0], NULL, 8) = 0 
rt_sigprocmask(SIG_BLOCK, [CHLD], [RT_0], 8) = 0 
rt_sigaction(SIGINT, {0x806ec28, [], 0x4000000}, {SIG_DFL}, 8) = 0 
wait4(-1, /usr/local/mozilla:/usr/local/mozilla/plugins:/usr/local/lib/mre/mre-1.6:/usr/local/
mozilla:/usr/local/mozilla/plugins:/usr/local/lib/mre/mre-1.6 
running 
/usr/local/mozilla/mozilla-bin 
/usr/local/mozilla/run-mozilla.sh: line 75:  3190 Segmentation fault      "$prog" ${1
+"$@"} 
[WIFEXITED(s) && WEXITSTATUS(s) == 139], 0, NULL) = 3184 
rt_sigprocmask(SIG_BLOCK, [CHLD TTOU], [CHLD RT_0], 8) = 0 
rt_sigprocmask(SIG_SETMASK, [CHLD RT_0], NULL, 8) = 0 
rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD RT_0], 8) = 0 
rt_sigprocmask(SIG_SETMASK, [CHLD RT_0], NULL, 8) = 0 
rt_sigprocmask(SIG_SETMASK, [RT_0], NULL, 8) = 0 
--- SIGCHLD (Child exited) --- 
wait4(-1, 0xbffff288, WNOHANG, NULL)    = -1 ECHILD (No child processes) 
sigreturn()                             = ? (mask now []) 
rt_sigaction(SIGINT, {SIG_DFL}, {0x806ec28, [], 0x4000000}, 8) = 0 
rt_sigprocmask(SIG_BLOCK, NULL, [RT_0], 8) = 0 
rt_sigprocmask(SIG_BLOCK, [CHLD TTOU], [RT_0], 8) = 0 
rt_sigprocmask(SIG_SETMASK, [RT_0], NULL, 8) = 0 
rt_sigprocmask(SIG_BLOCK, [CHLD], [RT_0], 8) = 0 
rt_sigprocmask(SIG_SETMASK, [RT_0], NULL, 8) = 0 
read(255, "", 39)                       = 0 
upeek: ptrace(PTRACE_PEEKUSER, ... ): Input/output error 
 
 

Reproducible: Always
Steps to Reproduce:
1.type "mozilla" 
2. 
3. 
Actual Results:  
/usr/local/mozilla/run-mozilla.sh: line 72:  3241 Segmentation fault      "$prog" ${1
+"$@"} 

Expected Results:  
Launched browser 

Things I recall installing: (upgrading). These are all from the Slackware 9.1 packages 
KDE 3.1 
QT 2 
Perl 
XFree86 4.3 
Libc.6.so 
libart_gpl
> An strace mozilla looks like 

you've just strace'd the startup script...
can you grab a stacktrace from gdb?
Keywords: crash
I'm sure I could but I'm not a big debugger user and don't have much experience with 
gdb. In anticipation that I can guess correctly, I did mozilla --debug then when gdb 
came up typed "run" then "backtrace". Please tell me the correct way to do this if I got 
it wrong. Here's the results of what I did anyway 
 
#0  0x403d8bf1 in sigpending () from /lib/libc.so.6 
#1  0x403d8cb9 in sigsuspend () from /lib/libc.so.6 
#2  0x400e4278 in pthread_getconcurrency () from /lib/libpthread.so.0 
#3  0x400e3ae4 in pthread_create () from /lib/libpthread.so.0 
#4  0x400c68c3 in PR_Select () from /usr/local/mozilla/libnspr4.so 
#5  0x400c6ad3 in PR_CreateThread () from /usr/local/mozilla/libnspr4.so 
#6  0x40634b1d in ?? () 
#7  0x40634c59 in ?? () 
#8  0x4074eb9a in ?? () 
#9  0x4072afff in ?? () 
#10 0x4066be67 in ?? () 
#11 0x406284de in ?? () 
#12 0x4062883e in ?? () 
#13 0x8077581 in _ZNK17nsGetServiceByCIDclERK4nsIDPPv () 
#14 0x8077314 in 
_ZN13nsCOMPtr_base18assign_from_helperERK15nsCOMPtr_helperRK4nsID () 
#15 0x407381f4 in ?? () 
#16 0x4072ad8f in ?? () 
#17 0x4066be67 in ?? () 
#18 0x406285bd in ?? () 
#19 0x4062913c in ?? () 
#20 0x40ce1c0b in ?? () 
#21 0x40ce21a4 in ?? () 
#22 0x40ce5b44 in ?? () 
#23 0x4066be67 in ?? () 
#24 0x406285bd in ?? () 
#25 0x4062913c in ?? () 
#26 0x40a076bc in ?? () 
#27 0x40864816 in ?? () 
#28 0x4066c591 in ?? () 
#29 0x4066c85f in ?? () 
#30 0x4062f5d8 in ?? () 
#31 0x4062d7f5 in ?? () 
#32 0x4062c983 in ?? () 
#33 0x406284b4 in ?? () 
#34 0x80773d1 in _ZNK21nsCreateInstanceByCIDclERK4nsIDPPv () 
#35 0x8077314 in _ZN13nsCOMPtr_ba 
#36 0x406e62ec in ?? () 
#37 0x406e6583 in ?? () 
#38 0x406f1ad1 in ?? () 
#39 0x4066be67 in ?? () 
#40 0x406285bd in ?? () 
#41 0x4062913c in ?? () 
#42 0x8077641 in _ZNK24nsGetServiceByContractIDclERK4nsIDPPv () 
#43 0x8077314 in 
_ZN13nsCOMPtr_base18assign_from_helperERK15nsCOMPtr_helperRK4nsID () 
#44 0x406c3c10 in ?? () 
#45 0x805b4be in _Z10getCountryRK9nsAStringRS_ () 
#46 0x805c34a in main () 
#47 0x403c4d06 in __libc_start_main () from /lib/libc.so.6 
se18assign_from_helperERK15nsCOMPtr_helperRK4nsID () 
 
 
#36 0x406e62ec in ?? () 
 
hrm, that doesn't really look like a crash... what did it say right before it
returned control to gdb?  If it said "segmentation fault" or "sigsegv" or
something indicating it crashed, then it should have worked.  But sometimes it
will say "SIG32", which is really not a crash.  You can do "cont" in gdb and let
it continue until it crashes for real.

Also, if you have a long stacktrace, you can put it in a file and attach it
("Create a New Attachment")
Yep, there was a SIG32. Here is the result after a "cont". Sorry for being clueless :). the 
trace isn't very long so I'll just include it here. 
 
Rich 
 
(gdb) run 
Starting program: /usr/local/mozilla/./mozilla-bin 
warning: Unable to find dynamic linker breakpoint function. 
GDB will be unable to debug shared library initializers 
and track explicitly loaded dynamic code. 
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)... 
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)... 
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)... 
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)... 
(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)... 
(no debugging symbols found)... 
Program received signal SIG32, Real-time event 32. 
0x403d8bf1 in sigpending () from /lib/libc.so.6 
(gdb) cont 
Continuing. 
 
Program received signal SIGSEGV, Segmentation fault. 
0x81735b6 in ?? () 
(gdb) backtrace 
#0  0x81735b6 in ?? () 
#1  0x403c5f24 in iconv_close () from /lib/libc.so.6 
#2  0x403c5602 in iconv () from /lib/libc.so.6 
#3  0x4061ca6e in ?? () 
#4  0x4061cfa7 in ?? () 
#5  0x40621ea9 in ?? () 
#6  0x40e7cc74 in ?? () 
#7  0x40e7b11e in ?? () 
#8  0x40e74444 in ?? () 
#9  0x40e6fc2e in ?? () 
#10 0x40e6ce38 in ?? () 
#11 0x40dfc2f1 in ?? () 
#12 0x805a8dd in _Z10getCountryRK9nsAStringRS_ () 
#13 0x805b843 in _Z10getCountryRK9nsAStringRS_ () 
#14 0x805c34a in main () 
#15 0x403c4d06 in __libc_start_main () from /lib/libc.so.6 
(gdb) 
ah. ok, that's better.  And did you do
gdb /usr/local/mozilla/mozilla-bin?
(don't)
do
mozilla -g -d gdb

that will set up the environment for mozilla and THEN invoke gdb and Mozilla.  see:
http://www.mozilla.org/unix/debugging-faq.html
Actually, I did mozilla --debug. 
 
The invocation you describe give almost exactly the same result except for the 0th line  
and a couple of others which become 
 
#0  0x81735ae in ?? () 
#1  0x403c3f24 in iconv_close () from /lib/libc.so.6 
#2  0x403c3602 in iconv () from /lib/libc.so.6 
#3  0x4061aa6e in ?? () 
#4  0x4061afa7 in ?? () 
#5  0x4061fea9 in ?? () 
#6  0x40e7ac74 in ?? () 
#7  0x40e7911e in ?? () 
#8  0x40e72444 in ?? () 
#9  0x40e6dc2e in ?? () 
#10 0x40e6ae38 in ?? () 
#11 0x40dfa2f1 in ?? () 
#12 0x805a8dd in _Z10getCountryRK9nsAStringRS_ () 
#13 0x805b843 in _Z10getCountryRK9nsAStringRS_ () 
#14 0x805c34a in main () 
#15 0x403c2d06 in __libc_start_main () from /lib/libc.so.6 
 
Though I have attempted upgrading a couple of libraries so milage may vary 
 
Rich 
You might experiment with environment variables for LC_LOCALE and/or LANG.  I
would suspect that your upgrade of libc is what is triggering the crash

==> i18n
Assignee: general → smontagu
Component: Browser-General → Internationalization
QA Contact: general → amyy
Summary: Segmentation fault on launch line 72 → Segmentation fault in iconv
I dabbled a little with LC_LOCALE and LANG but couldn't see what to do with them
or what might work. But your i18n mention gave me an idea...

I went into /usr/share and renamed the i18n directory then un=tgz'd the
glibc-2.3.2-i486-1.tgz and glibc-i18n-2.3.2-noarch-1.tgz to recreate it (not
sure what the difference 'i18n' info is between the two). This fubarred my
system with several things (including ls) not working due to not finding
pthreads. So I un tgz'd glibc-solibs-2.3.2-i486-1.tgz and an ldconfig and bingo,
system back to working condition and low-and-behold, mozilla starts up like a
happy camper.

Hope this helps. I know this likely is a lib issue not really a Mozilla problem
but when I type "mozilla" and it doesn't run, it sure looks like one.

Rich
There's no env. variable named LC_LOCALE ;-). Anyway, it looks like something
got screwed up in your glibc as you wrote (even 'ls' didn't work). I'm closing
it now as invalid. If you can reproduce it with a 'working' glibc, reopen it. 
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.