dhewm / dhewm3

dhewm 3 main repository
https://dhewm3.org/
GNU General Public License v3.0
1.8k stars 346 forks source link

segfault in neo/game/Player.cpp:5027 #96

Closed kortemik closed 9 years ago

kortemik commented 10 years ago

0x00007ffff024fe02 in idPlayer::SetCurrentHeartRate (this=0x50b0be4) at /home/C933925/fi.xnet.dhewm3/neo/game/Player.cpp:5027 5027 refSound.referenceSound->ModifySound( SND_CHANNEL_HEART, &parms );

Some trickery here

kortemik commented 10 years ago

==3406== Process terminating with default action of signal 11 (SIGSEGV) ==3406== Access not within mapped region at address 0x0 ==3406== at 0x13FDEE02: idPlayer::SetCurrentHeartRate() (Player.cpp:5027) ==3406== by 0x13FE54A8: idPlayer::Think() (Player.cpp:6281) ==3406== by 0x13F74D5B: idGameLocal::RunFrame(usercmdt const) (Game_local.cpp:2269) ==3406== by 0x549612: idSessionLocal::RunGameTic() (Session.cpp:2760) ==3406== by 0x5492C8: idSessionLocal::Frame() (Session.cpp:2706) ==3406== by 0x4F4340: idCommonLocal::GUIFrame(bool, bool) (Common.cpp:2433) ==3406== by 0x53DCA5: idSessionLocal::MessageBox(msgBoxTypet, char const, char const, bool, char const, char const_, bool) (Session_menu.cpp:1347) ==3406== by 0x5407B6: Session_PromptKeyf(idCmdArgs const&) (Session.cpp:255) ==3406== by 0x4EA312: idCmdSystemLocal::ExecuteTokenizedString(idCmdArgs const&) (CmdSystem.cpp:498) ==3406== by 0x4EA3EB: idCmdSystemLocal::ExecuteCommandText(char const) (CmdSystem.cpp:520) ==3406== by 0x4EA642: idCmdSystemLocal::BufferCommandText(cmdExecutiont, char const) (CmdSystem.cpp:583) ==3406== by 0x543754: idSessionLocal::StartNewGame(char const_, bool) (Session.cpp:1166)

kortemik commented 10 years ago

if snd_heartbeat is not defined the game will crash with messages above

DanielGibson commented 10 years ago

So why isn't it?

So far you haven't written anything about your setup, like operating system, if you're just trying to run doom3 or trying to build a standalone game etc :-P If you just wanna run doom3 make sure to have it patched to 1.3.1 with the official patches, so you have pak000.pk4, pak001.pk4, ..., pak008.pk4

To fix the crash (if that is desirable): In Player.cpp line 5022, one should probably check the return value of StartSound()

kortemik commented 10 years ago

I am writing a mod and therefore don't have all the original assets in place. I know that your fork is focused on the bugs of the original game so I have not reported any due to my patching, but this one seems to be in place in both. :)

Please find the GLSL patch in https://github.com/kortemik/dhewm3/blob/master/6d8108c508a0bde5c2bea4dec58fa2ca583a16e2.patch if you are interested. It's buggy however but I am fixing it.

-Mikko

On Thu, Jun 12, 2014 at 9:31 PM, Daniel Gibson notifications@github.com wrote:

So why isn't it?

So far you haven't written anything about your setup, like operating system, if you're just trying to run doom3 or trying to build a standalone game etc :-P If you just wanna run doom3 make sure to have it patched to 1.3.1 with the official patches, so you have pak000.pk4, pak001.pk4, ..., pak008.pk4

To fix the crash (if that is desirable): In Player.cpp line 5022, one should probably check the return value of StartSound()

— Reply to this email directly or view it on GitHub https://github.com/dhewm/dhewm3/issues/96#issuecomment-45930047.

DanielGibson commented 10 years ago

For mods you usually need a full installation of the game and I think it falls back to base/ if it can't find a file in $yourmod/ If you wanna go standalone you may wanna look at https://github.com/DanielGibson/d3-base-assets - it's incomplete, though, and I can't remember that I ever ran into that heartbeat thing there.

kortemik commented 10 years ago

Yea well there are quite many pitfalls to crawl through. For example, on my Fedora20 with ati drivers there is no keyboard movement available, only mouse works, same binaries on nvidia drivers work fine on another Fedora20 installation :D

On Thu, Jun 12, 2014 at 10:02 PM, Daniel Gibson notifications@github.com wrote:

For mods you usually need a full installation of the game and I think it falls back to base/ if it can't find a file in $yourmod/ If you wanna go standalone you may wanna look at https://github.com/DanielGibson/d3-base-assets - it's incomplete, though, and I can't remember that I ever ran into that heartbeat thing there.

— Reply to this email directly or view it on GitHub https://github.com/dhewm/dhewm3/issues/96#issuecomment-45934175.

DanielGibson commented 10 years ago

I heavily doubt that this has anything to do with the GPU driver, it doesn't handle input. Must be something else.. different libSDL binaries? Different window manager? ... (I never had problems with the binary ati drivers and dhewm3)

kortemik commented 10 years ago

Yes might be window manager which i suspected first, it's KDE on the failing system, but I tried with DWM which I use on the nvidia one and still the problem persists. I tried to run with original files with a new user, it worked after re-installing ati drivers but after reboot not so it might be as well it or selinux or something else.

On Fri, Jun 13, 2014 at 12:39 AM, Daniel Gibson notifications@github.com wrote:

I heavily doubt that this has anything to do with the GPU driver, it doesn't handle input. Must be something else.. different libSDL binaries? Different window manager? ... (I never had problems with the binary ati drivers and dhewm3)

— Reply to this email directly or view it on GitHub https://github.com/dhewm/dhewm3/issues/96#issuecomment-45951628.

kortemik commented 10 years ago

Hey,

I think it's problem with SDL2 build. I got it compiled for windows and the same thing happens, keyboard input is not working with the console first at all for any other key than open console and enter. After a while it accepts input but the character does not move at all.

It might be due to my patching but could you please test if it works in your version?

I am using provided libraries except for SDL2 which is from Fedora 20 mingw64.

Test platform is Windows 8.1 and compiled for x86_64

-Mikko

On Fri, Jun 13, 2014 at 12:02 PM, Mikko Kortelainen < mikko.kortelainen@fail-safe.net> wrote:

Yes might be window manager which i suspected first, it's KDE on the failing system, but I tried with DWM which I use on the nvidia one and still the problem persists. I tried to run with original files with a new user, it worked after re-installing ati drivers but after reboot not so it might be as well it or selinux or something else.

On Fri, Jun 13, 2014 at 12:39 AM, Daniel Gibson notifications@github.com wrote:

I heavily doubt that this has anything to do with the GPU driver, it doesn't handle input. Must be something else.. different libSDL binaries? Different window manager? ... (I never had problems with the binary ati drivers and dhewm3)

— Reply to this email directly or view it on GitHub https://github.com/dhewm/dhewm3/issues/96#issuecomment-45951628.

kortemik commented 10 years ago

It gives

Warning unknown event 770

When window gains or loses focus.

After gaining and losing focus once the keyboard input works for console but not for character movement. I would suspect that it is therefore related to SDL handling of focus.

-Mikko

On Sat, Jun 14, 2014 at 11:34 PM, Mikko Kortelainen < mikko.kortelainen@fail-safe.net> wrote:

Hey,

I think it's problem with SDL2 build. I got it compiled for windows and the same thing happens, keyboard input is not working with the console first at all for any other key than open console and enter. After a while it accepts input but the character does not move at all.

It might be due to my patching but could you please test if it works in your version?

I am using provided libraries except for SDL2 which is from Fedora 20 mingw64.

Test platform is Windows 8.1 and compiled for x86_64

-Mikko

On Fri, Jun 13, 2014 at 12:02 PM, Mikko Kortelainen < mikko.kortelainen@fail-safe.net> wrote:

Yes might be window manager which i suspected first, it's KDE on the failing system, but I tried with DWM which I use on the nvidia one and still the problem persists. I tried to run with original files with a new user, it worked after re-installing ati drivers but after reboot not so it might be as well it or selinux or something else.

On Fri, Jun 13, 2014 at 12:39 AM, Daniel Gibson <notifications@github.com

wrote:

I heavily doubt that this has anything to do with the GPU driver, it doesn't handle input. Must be something else.. different libSDL binaries? Different window manager? ... (I never had problems with the binary ati drivers and dhewm3)

— Reply to this email directly or view it on GitHub https://github.com/dhewm/dhewm3/issues/96#issuecomment-45951628.

kortemik commented 10 years ago

perhaps http://www.reddit.com/r/gamedev/comments/1tt92h/problem_with_sdl20_input/ On Jun 15, 2014 10:45 AM, "Mikko Kortelainen" < mikko.kortelainen@fail-safe.net> wrote:

It gives

Warning unknown event 770

When window gains or loses focus.

After gaining and losing focus once the keyboard input works for console but not for character movement. I would suspect that it is therefore related to SDL handling of focus.

-Mikko

On Sat, Jun 14, 2014 at 11:34 PM, Mikko Kortelainen < mikko.kortelainen@fail-safe.net> wrote:

Hey,

I think it's problem with SDL2 build. I got it compiled for windows and the same thing happens, keyboard input is not working with the console first at all for any other key than open console and enter. After a while it accepts input but the character does not move at all.

It might be due to my patching but could you please test if it works in your version?

I am using provided libraries except for SDL2 which is from Fedora 20 mingw64.

Test platform is Windows 8.1 and compiled for x86_64

-Mikko

On Fri, Jun 13, 2014 at 12:02 PM, Mikko Kortelainen < mikko.kortelainen@fail-safe.net> wrote:

Yes might be window manager which i suspected first, it's KDE on the failing system, but I tried with DWM which I use on the nvidia one and still the problem persists. I tried to run with original files with a new user, it worked after re-installing ati drivers but after reboot not so it might be as well it or selinux or something else.

On Fri, Jun 13, 2014 at 12:39 AM, Daniel Gibson < notifications@github.com> wrote:

I heavily doubt that this has anything to do with the GPU driver, it doesn't handle input. Must be something else.. different libSDL binaries? Different window manager? ... (I never had problems with the binary ati drivers and dhewm3)

— Reply to this email directly or view it on GitHub https://github.com/dhewm/dhewm3/issues/96#issuecomment-45951628.

kortemik commented 10 years ago

I tracked the root cause and created a new issue.

-Mikko

On Sun, Jun 15, 2014 at 1:56 PM, kordex kordex@gmail.com wrote:

perhaps http://www.reddit.com/r/gamedev/comments/1tt92h/problem_with_sdl20_input/ On Jun 15, 2014 10:45 AM, "Mikko Kortelainen" < mikko.kortelainen@fail-safe.net> wrote:

It gives

Warning unknown event 770

When window gains or loses focus.

After gaining and losing focus once the keyboard input works for console but not for character movement. I would suspect that it is therefore related to SDL handling of focus.

-Mikko

On Sat, Jun 14, 2014 at 11:34 PM, Mikko Kortelainen < mikko.kortelainen@fail-safe.net> wrote:

Hey,

I think it's problem with SDL2 build. I got it compiled for windows and the same thing happens, keyboard input is not working with the console first at all for any other key than open console and enter. After a while it accepts input but the character does not move at all.

It might be due to my patching but could you please test if it works in your version?

I am using provided libraries except for SDL2 which is from Fedora 20 mingw64.

Test platform is Windows 8.1 and compiled for x86_64

-Mikko

On Fri, Jun 13, 2014 at 12:02 PM, Mikko Kortelainen < mikko.kortelainen@fail-safe.net> wrote:

Yes might be window manager which i suspected first, it's KDE on the failing system, but I tried with DWM which I use on the nvidia one and still the problem persists. I tried to run with original files with a new user, it worked after re-installing ati drivers but after reboot not so it might be as well it or selinux or something else.

On Fri, Jun 13, 2014 at 12:39 AM, Daniel Gibson < notifications@github.com> wrote:

I heavily doubt that this has anything to do with the GPU driver, it doesn't handle input. Must be something else.. different libSDL binaries? Different window manager? ... (I never had problems with the binary ati drivers and dhewm3)

— Reply to this email directly or view it on GitHub https://github.com/dhewm/dhewm3/issues/96#issuecomment-45951628.