Segmentation Fault - Linux
#1
BiggrinHi PCSX2 Users!

I am a big PCSX2 Windows user, so I'm familiar with the normal stuff. I've been trying to get PCSX2 working on Ubuntu 10.10 for a while now, and finally decided to ask the staff about my problem.

When I try to run straight to the bios or any game, this error message pops up followed by a crash to the desktop:

Interface is initializing. Entering Pcsx2App:OhmynInit!
Applying operating system default language...
Command line parsing...
Command line parsed!
ZZogl-PG: Calling GSinit.
ZZogl-PG: GSinit finished.
ZZogl-PG: Calling GSopen.
ZZogl-PG: Creating ZZOgl window.
ZZogl-PG: Got Doublebuffered Visual!
ZZogl-PG: glX-Version 1.4
ZZogl-PG: You have Direct Rendering!
Segmentation fault

I know there are many Segmentation Fault posts out there, but none of them seemed to help me out. Thanks in advance!
Reply

Sponsored links

#2
Hello,

Sorry I only saw this post now... Which version and which plugins ? Note use CDVD null plugin with iso image.
Reply
#3
(05-30-2011, 07:34 PM)gregory Wrote: Hello,

Sorry I only saw this post now... Which version and which plugins ? Note use CDVD null plugin with iso image.
PCSX2 is crashing on me too. The output to the terminal is identical as the OP's.
I am using version 0.9.8.r0
Plugins:
GS : ZZOGL 0.3.0
PAD : OnePad 0.1.0
SPU2: SPU2-X 1.4.0
CDVD: CDVDnull Driver 0.6.0
USB : USBnull Driver 0.7.0
FW : FWnull Driver 0.7.0
DEV9: DEV9null Driver 0.5.0

Any ideas or suggestions for me?

Reply
#4
which graphic card, drivers and distribution ?
Reply
#5
I'm using Ubuntu 10.10 and ATI Radeon HD 3300 (onboard) graphics with the open source driver.
Reply
#6
Seem not an already known issue.

If you run a 32 bits Ubuntu, do you think you could manage to compile (trunk or linux-gsopen2 branch) in debug mode: see http://code.google.com/p/pcsx2/wiki/CompilationGuideForLinux

Then generate a backtrace in gdb (I really need to write a nice howto). In short
> gdb pcsx2
> run
lauch your game
when it crash
> bt
Reply
#7
I couldn't say for sure that my crash is the same as the OP's, but I guess crash logs are useful anyway.

I don't actually know much of any C++, so I can't make much sense of the debug output, but here goes

Code:
ZZogl-PG:  Using multitexturing.
ZZogl-PG:  Maximum texture size is 2048 for Tex_2d and 2048 for Tex_NV.
ZZogl-PG: Disabling MRT depth writing.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x312cb70 (LWP 4225)]
0x00000000 in ?? ()
(gdb) bt 5
#0  0x00000000 in ?? ()
#1  0x018be401 in ZZCreate (_width=800, _height=600)
    at /home/moi/pcsx2/plugins/zzogl-pg/opengl/ZZoglCreate.cpp:593
#2  0x01756445 in GSopen (pDsp=0x9dd621c, Title=0x8349984 "PCSX2",
    multithread=1) at /home/moi/pcsx2/plugins/zzogl-pg/opengl/GSmain.cpp:301
#3  0x080a762e in SysMtgsThread::OpenPlugin (this=0x9e80140)
    at /home/moi/pcsx2/pcsx2/MTGS.cpp:193
#4  0x080a7faf in SysMtgsThread::OnResumeInThread (this=0x9e80140,
    isSuspended=true) at /home/moi/pcsx2/pcsx2/MTGS.cpp:554
(More stack frames follow...)
(gdb) print g_vboBuffers
$1 = {<std::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {
    _M_impl = {<std::allocator<unsigned int>> = {<__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No data fields>}, _M_start = 0xb45bfbc0,
      _M_finish = 0xb45c03c0,
      _M_end_of_storage = 0xb45c03c0}}, <No data fields>}
(gdb) print g_vboBuffers.size()
$2 = 512
(gdb) print g_vboBuffers[0]
Segmentation fault

At which point I've crashed gdb.
Reply
#8
Hum no clue... I do not get it. Except an unlikely bad allocation.

One question about the final "segmentation fault". It was gdb segfault (everything close) or a *normal* error because g_vboBuffers[0] have an invalid adress (still get console access).

Could you redo some test, try to print &g_vboBuffers[0]. Some others hint:
To print asm + source code
> ctrl-x 2
To print register value (notice $ instead of %)
> print $eax
To print the content of memory point by a register
> x/x $eax

Edit: if you have time try also this small patch. It only add a line to clear the array. Normally useless but you never know
Index: plugins/zzogl-pg/opengl/ZZoglCreate.cpp
===================================================================
--- plugins/zzogl-pg/opengl/ZZoglCreate.cpp (revision 4716)
+++ plugins/zzogl-pg/opengl/ZZoglCreate.cpp (working copy)
@@ -589,6 +589,7 @@

g_nCurVBOIndex = 0;

+ g_vboBuffers.clear();
g_vboBuffers.resize(VB_NUMBUFFERS);
glGenBuffers((GLsizei)g_vboBuffers.size(), &g_vboBuffers[0]);

Reply
#9
(06-08-2011, 08:20 PM)gregory Wrote: Hum no clue... I do not get it. Except an unlikely bad allocation.

One question about the final "segmentation fault". It was gdb segfault (everything close) or a *normal* error because g_vboBuffers[0] have an invalid adress (still get console access).
gdb closed and detached.

Quote:Could you redo some test, try to print &g_vboBuffers[0]. Some others hint:
To print asm + source code
> ctrl-x 2
To print register value (notice $ instead of %)
> print $eax
To print the content of memory point by a register
> x/x $eax

Hmm, the problem is that I'm quite rusty at x86 ASM and I never really learned C++. I tried stepping through a bit with source code+asm side by side display on, but I couldn't understand much.

I understand that in C++, &foo[0], with foo being a vector, will start by calling operator[], which returns a reference, and then the addressof operator is used.... does this help?

(note that line numbers are with the patch below applied)

http://pastebin.com/raw.php?i=kWhvcC7b

i would say that &g_vboBuffers[0] = (unsigned int *) 0xb45bf9c0

Quote:Edit: if you have time try also this small patch. It only add a line to clear the array. Normally useless but you never know

tried, didn't change anything
Reply
#10
Hum, eip = 0x0 is very bad Tongue2 It is the pointer to the next instruction... The constructor element seems to generate very bad things... It is really strange.
1/ Some idea:
--- pcsx2.snapshot-4697.orig/plugins/zzogl-pg/opengl/ZZoglCreate.cpp
+++ pcsx2.snapshot-4697/plugins/zzogl-pg/opengl/ZZoglCreate.cpp
@@ -81,7 +81,7 @@
extern FRAGMENTSHADER* ZZshLoadShadeEffect(int type, int texfilter, int fog, int testaem, int exactcolor, const clampInfo& clamp, int context, bool* pbFailed);

GLuint vboRect = 0;
-vector g_vboBuffers; // VBOs for all drawing commands
+vector g_vboBuffers; // VBOs for all drawing commands
int g_nCurVBOIndex = 0;

inline bool CreateImportantCheck();
@@ -594,7 +594,7 @@

g_nCurVBOIndex = 0;

- g_vboBuffers.resize(VB_NUMBUFFERS);
+ g_vboBuffers.resize(VB_NUMBUFFERS, 0);
glGenBuffers((GLsizei)g_vboBuffers.size(), &g_vboBuffers[0]);


2/ Could you try to install fglrx ? you are maybe the first one to uses the opensource driver

3/ to debug more precisely you can use "si" and "ni" which stand for step in asm and next in asm.
Reply




Users browsing this thread: 1 Guest(s)