LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2020, 11:28 AM   #1
prakashkjaya
LQ Newbie
 
Registered: Feb 2020
Posts: 1

Rep: Reputation: Disabled
Segmentation Fault


HI
I am facing Segmentation Fault while installing google chrome pl some help me out
 
Old 02-23-2020, 12:12 PM   #2
vtel57
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Slackware64 - 14.2 w/ Xfce
Posts: 1,631

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Need:

- your operating system - which Linux, what version, etc.
- how did you install G. Chrome on the system? Downloaded from your distribution's repos? Or other method?
- start your Google Chrome from a Terminal and COPY/PASTE the output errors here for us.

These items would be helpful to us while trying to troubleshoot your issue.

Standing by...
 
1 members found this post helpful.
Old 02-23-2020, 12:36 PM   #3
Mike_Walsh
Member
 
Registered: Jul 2017
Location: King's Lynn, UK
Distribution: Nowt but Puppies....
Posts: 660

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
Quote:
Originally Posted by vtel57 View Post
- start your Google Chrome from a Terminal and COPY/PASTE the output errors here for us.
Agree with this. Many folks moan about how 'noisy' the Chromium-based browsers are in the terminal, but the browser runs a continuous, on-going 'debugging' session all the time it's operational. That being the case, this is the very best output we can have for helping with this kind of issue....


Mike.
 
Old 02-26-2020, 07:12 AM   #4
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by prakashkjaya View Post
HI
I am facing Segmentation Fault while installing google chrome pl some help me out
I doubt it. How would Google chrome be segfaulting while you're installing it (before it's actually installed) ?

Either you're installing it via an installer and NOT from software packages, and therefore it's installer program is segfaulting, or you already have installed it and Google Chrome itself is segfaulting.

Either way, it would indicate a problem in the code of either it's installer program (if you were NOT installing it from software packages), or and probably more likely, the code of Google Chrome itself. Either way, unless you know about programming, then it's unlikely there's anything you can do. And it's equally unlikely that anybody here is going to be able to find out exactly where the problem is in the relevant code, and then create a patch for you.

You should also lookup what a "Segmentation Fault" is, as you'll find it means that a program has attempted to access a part of memory that's not a part of that program's own address space. In other words, memory assigned to another program, and NOT to Google Chrome or it's installer program in this case.

The code below is guaranteed to segfault, as the for loop's termination criteria says, "if i is more than or equal to zero, keep running the loop". But the array it's looping through is only 5 elements in size, so once it gets far enough past that, the program below WILL violate it's address space, and therefore cause a segfault.

Of course, as useless as this program would be by itself, and with only the code below, the fix is easy. Just change the loop's condition so it only executes as long as "i" is no more than "5".

Code:
#include <stdio.h>

int main(void) {

    int array[] = { 1, 2, 3, 4, 5 };

    for( int i = 0; i >= 0; ++i) {                    
          printf("array[%i]\n", array[i]);
    }

    return 0;
}
This is what happens if you compile and run the program above:

Code:
...
array[1258303329]
array[1330859599]
array[1147094348]
array[1599296834]
array[1145981271]
array[792549199]
array[1684957527]
array[796096367]
array[1029636145]
array[1701588782]
array[1935635316]
array[1634101093]
array[7629941]
array[1701588782]
array[1935635316]
array[1634101093]
array[7629941]
array[0]
array[0]
Segmentation fault (core dumped)
 
Old 02-26-2020, 12:13 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,881
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by prakashkjaya View Post
HI
I am facing Segmentation Fault while installing google chrome pl some help me out
Welcome to LQ prakashkjaya,

I'd say a slight addition to the queries in Post #2 would be to, "COPY/PASTE all output errors here for us", regardless of whatever actions you've taken.

Based on your problem description, with no updates as yet, you've encountered this while installing google chrome.

It would be helpful for you to confirm what you were doing, explain the method you were using to perform it, and for you to show the output you're seeing.

Not just the final error report, but the details leading up to it will be helpful.
 
1 members found this post helpful.
Old 02-26-2020, 06:20 PM   #6
murugesan
Member
 
Registered: May 2003
Location: Bangalore ,Karnataka, India, Asia, Earth, Solar system, milky way galaxy, black hole
Distribution: murugesan openssl
Posts: 181

Rep: Reputation: 29
@prakashkjaya

Copied code from jsbjsb001 and compiled the same at Linux system here:
Quote:
$ /usr/bin/gcc -std=c99 -g -Wall ./segmentation-fault-4175670121.c -o ./a.out
$ # Create core file when program obtaining segmentation fault
$ /usr/bin/ls -ltr | /usr/bin/tail -2 | /usr/bin/awk '{ print $NF}'
segmentation-fault-4175670121.c
a.out
$ ulimit -c unlimited
$ ./a.out
array[1]
array[2]
..
..
array[5]
array[32767]
array[0]
..
..
array[0]
array[-382668880]
..
..
array[7632239]
array[0]
array[0]
Segmentation fault (core dumped)
$ /usr/bin/ls -ltr | /usr/bin/tail -3 | /usr/bin/awk '{ print $NF}'
segmentation-fault-4175670121.c
a.out
core.4562
$ /usr/bin/gdb -q ./a.out ./core.4562
Program terminated with signal 11, Segmentation fault.
#0 0x00000000004004dd in main () at ./segmentation-fault-4175670121.c:7
7 printf("array[%i]\n", array[i]);
(gdb) print i
$1 = 2136
(gdb) quit
The size of array you have defined having maximum 5 elements only
array[0] => first element
array[1] => second element
array[2] => third element
array[3] => fourth element
array[4] => fifth and last element
Using for loop you have written:
for( int i = 0; i >= 0; ++i)
This loop being executed from 0 till maximum number of integer.
Quote:
$ /usr/bin/grep "define INT_MAX" /usr/include/limits.h
# define INT_MAX 2147483647
since we are accessing the element of array out of index.
When that memory being accessed used by some other program, current program receive the signal segmentation fault (SIGSEGV)

Quote:
$ kill -l | /usr/bin/grep -w "11)"
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2
Hence
Replace:
Quote:
for( int i = 0; i >= 0; ++i)
{
printf("array[%i]\n", array[i]);
}
With:
Quote:
for( int i = 0; sizeof(array)/sizeof(int) > i ; ++i)
{
printf( "array[%i] %d\n", i, array[i]);
}
sizeof(array) => 20 (at Linux, HP-UX, SunOS, AIX. In turboc DOS sizeof array being 10 bytes)
sizeof(int) => 4 bytes (at Linux, HP-UX, SunOS, AIX. In turboc DOS sizeof int being 2 bytes)
Number of elements => 20/4 => 5 (0 to 4)
Quote:
$ /usr/bin/gcc -std=c99 -g -Wall ./segmentation-fault-4175670121.c -o ./a.out
$ ./a.out
array[0] 1
array[1] 2
array[2] 3
array[3] 4
array[4] 5
$
>> I am facing Segmentation Fault while installing google chrome pl some help me out
Hence if you are obtaining core file execute file command:
Quote:
$ /usr/bin/file ./core.4874
core.4874: ELF 64-bit LSB core file AMD x86-64, version 1 (SYSV), SVR4-style, from 'a.out'
Like the same obtain the value of binary which created the core file ?

Last edited by murugesan; 02-26-2020 at 06:25 PM. Reason: comment on google chrome core file
 
Old 02-27-2020, 05:52 AM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,881
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
@murugesan,

You are presuming that the OP received a core file. Perhaps they did, but they've only ever made their one post.

I'm not sure you receive a core file unless you have your system or terminal set to allow this, such as using "ulimit -c unlimited"

It's also quite possible they've solved this, or moved on to another browser and therefore have decided that their question is no longer of any purpose for them.

If they choose to update, we'll find out more.

Last edited by rtmistler; 02-27-2020 at 05:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
Segmentation Fault Error when trying to install kernel-source-2.4.2-2.i386.rpm rdaves@earthlink.net Linux - Software 1 09-13-2001 05:51 AM
# rpm --rebuilddb -- Segmentation fault russell Linux - Software 4 08-14-2001 02:39 AM
Segmentation Fault Nezar Linux - General 1 06-10-2001 03:17 PM
1513 Segmentation fault Terri Linux - Software 1 06-07-2001 12:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration