Page 1 of 2

crash while playing Lithium

Posted: Sat Aug 11, 2018 2:43 am
by Guest

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 4:02 am
by Graf Zahl
Can you please verify that you are using the correct version of libsndfile-1.dll and not one that came with an older version of GZDoom or even from the official download site? It crashes inside that DLL with an "invalid instruction" exception and there were known problems with bad code in that DLL in the past.
It may also be some bogus sound but it's impossible to tell from the crash log.

In any case, there's nothing we can do here because the code that crashes is outside our control.

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 4:26 am
by _mental_
pmovzxdq instruction is not supported by such old CPU. It's quite strange that SSE 4.1 instruction appeared in that library though.

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 4:48 am
by Graf Zahl
That's why I was asking where the file came from. It's unlikely it is our own binary. AFAIK that was built with MSVC.

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 5:46 am
by _mental_
The given library from gzdoom-bin-3-5-0.zip contains not only this but also bunch of AVX instructions.
It seems like when I built this library, code optimized via intrinsics from libFLAC was enabled by default.
Curiously enough, it was build on my very old notebook that doesn't support AVX for sure.

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 5:51 am
by Graf Zahl
So this only happens when decoding FLAC? No wonder it wasn't noticed earlier...

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 6:10 am
by drfrag
If i remember right the usage of AVX was due to a bug in the compiler, i read something about that.
For my ports i had to use /Oi- to build without SSE2 in VS.
Then i'll need to replace libsndfile-1.dll as well for the vintage build (it runs on a P4 tough).

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 6:32 am
by Graf Zahl
Does it? Have you actually decoded some FLACs?

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 7:28 am
by drfrag
No, i guess it will crash with FLACs that's why i'll need to replace the dll (it's the same as in the modern package).

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 8:34 am
by _mental_
FLAC has some routines optimized by hand to use SSE 4.1 and AVX 2.

The thing is those optimized functions should not be called if CPU has no support for such instruction sets.
Detection of CPU features seems to be correct in FLAC source code.

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 8:37 am
by Graf Zahl
_mental_ wrote: Detection of CPU features seems to be correct in FLAC source code.
Apparently this one CPU disagrees with you. The question is, why?

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 12:19 pm
by drfrag

Re: crash while playing Lithium

Posted: Sat Aug 11, 2018 1:15 pm
by _mental_
No, it's unrelated problem.
_mental_ wrote:FLAC has some routines optimized by hand to use SSE 4.1 and AVX 2.

The thing is those optimized functions should not be called if CPU has no support for such instruction sets.
Detection of CPU features seems to be correct in FLAC source code.

Re: crash while playing Lithium

Posted: Sun Oct 14, 2018 1:20 am
by _mental_
32-bit DLL with SSE 4.1 and AVX forcibly disabled is here. It was built from the same source code as DLL supplied with in the stable versions.
As I have no AMD CPU, I cannot check if the issue is fixed or not.

Re: crash while playing Lithium

Posted: Sun Oct 14, 2018 1:22 am
by Graf Zahl
Copied to my base archive for making distributions. Of course the current 32 bit downloads should also be updated.