LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-05-2003, 09:17 PM   #1
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Rep: Reputation: 30
snes9express and normal users


Im having trouble running snes9express as a normal user.

snes9express is a frontend for the nes emulator snes9x.

As a normal user, I can run snes9x romname.xxx and it runs fine. When I try to run the frontend snes9express, i get:
Segmentation Fault,

Both run fine as root. So I think this is a permissions issue. The problem is, I don't know where to start.. Is there a way I can find out what files a program is trying to use?

Any help appreciated.

Thanks,

Murray
 
Old 12-05-2003, 09:24 PM   #2
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Quote:
Is there a way I can find out what files a program is trying to use?
ldd filename
 
Old 12-06-2003, 03:07 PM   #3
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Original Poster
Rep: Reputation: 30
cool..

i ran that..

here's the output:

murray@godzillax:~$ ldd /usr/local/bin/snes9express
libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x40028000)
libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x4027e000)
libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x402ea000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x40305000)
libpangoxft-1.0.so.0 => /usr/lib/libpangoxft-1.0.so.0 (0x40318000)
libpangox-1.0.so.0 => /usr/lib/libpangox-1.0.so.0 (0x40339000)
libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x40346000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x4037a000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x403af000)
libdl.so.2 => /lib/libdl.so.2 (0x403b3000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x403b6000)
libz.so.1 => /usr/lib/libz.so.1 (0x40420000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4042d000)
libm.so.6 => /lib/libm.so.6 (0x404df000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x40502000)
libc.so.6 => /lib/libc.so.6 (0x4050a000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40640000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x40707000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4070b000)
libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x4071a000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x4072c000)
libfontconfig.so.1 => /usr/X11R6/lib/libfontconfig.so.1 (0x40734000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x4075b000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x407bf000)

is the best way to fix this to go into each dir and change the rights of all of these files?

THanks again,

Murray
 
Old 12-06-2003, 08:46 PM   #4
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Original Poster
Rep: Reputation: 30
still get segmentation fault after doing:

chmod a+rwx /usr/lib/*so*
chmod a+rwx /usr/X11R6/lib/*so*
chmod a+rwx /lib/*so*

any suggestions?
 
Old 12-10-2003, 12:40 AM   #5
daven
LQ Newbie
 
Registered: Dec 2003
Location: Nova Scotia
Distribution: Mandrake
Posts: 4

Rep: Reputation: 0
Did snes9express run in your user account the first time you tried it, but seg-fault everytime after? If so, it might be related to the preferences file that it creates.
At a command prompt in your home directory, type: ls .s9x
If it lists a file called "prefs" in that directory, try renaming it to prefs.bak, and see if snes9express runs then. If that works, what are the contents of the file that prefs.bak file?
(if that doesn't work, but there is a "profiles" file, or a "last" file, try renaming them in the same way)

If snes9express has never run in your user account, then I believe you may have been (un)fortunate enough to have discovered a bug in snes9express. Actually, either way, it sounds like a bug. If you feel up to helping, tracing a seg-fault isn't too hard. (Whether it's easy for me to fix... that's a whole other story)

In a terminal, as your user account, go to the directory where you built snes9express (with configure and make). Then run the command: gdb snes9express
you'll then get a gdb prompt, type run
as soon as it crashes, it should give you another gdb prompt. type: bt
The output given from that command should help me find the problem.
To get out of gdb, type quit
 
Old 12-10-2003, 01:48 AM   #6
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Quote:
Originally posted by murray_linux
still get segmentation fault after doing:

chmod a+rwx /usr/lib/*so*
chmod a+rwx /usr/X11R6/lib/*so*
chmod a+rwx /lib/*so*

any suggestions?
OMG... why did you do that? Just in case you don't realize it, you've just made your system more insecure by a few notches. It'll be hell to undo what you've done

Usually in Linux, if an app segfaults it's almost always the fault of the app.
 
Old 12-10-2003, 10:38 AM   #7
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Azmeen
OMG... why did you do that? Just in case you don't realize it, you've just made your system more insecure by a few notches. It'll be hell to undo what you've done
i did it because i didn't know any better. this is a learning process.

ok so i know it's a bad thing now. can you elaborate? thank you.
 
Old 12-10-2003, 10:41 AM   #8
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Original Poster
Rep: Reputation: 30
daven thank you kindly for your reply. i will test this out later this week

Murray
 
Old 12-10-2003, 07:23 PM   #9
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Quote:
Originally posted by murray_linux
i did it because i didn't know any better. this is a learning process.

ok so i know it's a bad thing now. can you elaborate? thank you.
Sorry I wasn't more clear in my response... OK, I'll try my best to explain.

Basically, what you did was to give everybody full permissions to all of your libs. It means, that if by someone gains access to your libs they can do all kinds of nasty stuff... plant backdoors, use your comp to launch DDOS attacks, or just simply render your box useless.
 
Old 12-10-2003, 10:54 PM   #10
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Original Poster
Rep: Reputation: 30
thanks azmeen.
 
Old 12-10-2003, 11:34 PM   #11
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by daven
Did snes9express run in your user account the first time you tried it, but seg-fault everytime after?
I really don't rememeber, sorry. But the Seg fault is now happening when I run the program as root too Recompile doesn't fix it either.

Quote:
try renaming it to prefs.bak, and see if snes9express runs then. If that works, what are the contents of the file that prefs.bak file?
Same error.

Quote:
(if that doesn't work, but there is a "profiles" file, or a "last" file, try renaming them in the same way)
Renaming last to last.old in root's .s9x directory made snes9express run for both root and my user. YES!!!!! Here's what was in my "last" file:

/home/murray/bin/snes9x -ntsc -fullscreen -dfr -joymap1 1 4 2 5 6 7 0 3 /mnt/cdw
riter/ROM/SuperMetroid+%28US%29.zip
Xlib: extension "XFree86-DGA" missing on display ":0.0".
Rate: 48000, Buffer size: 2048, 16-bit: yes, Stereo: yes, Encoded: no
Found ROM file header (and ignored it).
"Super Metroid" [bad checksum] LoROM, 32Mbits, Type: ROM+RAM+BAT, Mode: 20, TV:
NTSC, S-RAM: 8KB, ROMId: ???? Company: 01 CRC32: 806D0D0B
Using Microsoft SideWinder Game Pad Pro USB version 1.0 (/dev/js0) as pad1.

Quote:
In a terminal, as your user account, go to the directory where you built snes9express (with configure and make). Then run the command: gdb snes9express
you'll then get a gdb prompt, type run
as soon as it crashes, it should give you another gdb prompt. type: bt
The output given from that command should help me find the problem.
To get out of gdb, type quit
I guess you don't need this anymore, but here's my output as root:

(gdb) bt
#0 0x0805a652 in fr_ArgList (this=0x20202020,
s=0xbffff2e0 ' ' <repeats 200 times>...) at frend.cc:104
(gdb) quit
The program is running. Exit anyway? (y or n) y

Thank you so much for your help on this. I truly appreciate it.

Last edited by murray_linux; 12-10-2003 at 11:36 PM.
 
Old 12-11-2003, 12:52 PM   #12
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Original Poster
Rep: Reputation: 30
Azmeen,

Yeah that could be bad. How would 1 go about fixing a mistake like that?

Thanks,

Murray
 
Old 12-20-2003, 03:56 PM   #13
daven
LQ Newbie
 
Registered: Dec 2003
Location: Nova Scotia
Distribution: Mandrake
Posts: 4

Rep: Reputation: 0
Thanks for the gdb debugging help Murray. It should help me track down the cause of the problem.

Regarding your other question, you should be able to restore the proper library permissions by doing this:

chmod 755 /usr/lib/*so*
chmod 755 /usr/X11R6/lib/*so*
chmod 755 /lib/*so*
 
  


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
Problems with normal users SabaumLinux Linux - Software 5 02-15-2005 01:18 AM
Normal users can't su to root? Why not? jon_k Linux - Software 12 07-09-2004 04:09 PM
Permission for normal users Vizy Linux - General 1 03-16-2004 11:39 AM
I want to allow normal users for mounting bacon22 Linux - General 9 01-29-2004 02:29 AM
SSH: PrinLastLog for normal users... pablovschby Linux - Networking 3 10-03-2003 08:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:08 PM.

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