Discussion:
Crash on clang-cl / __fastcall
(too old to reply)
Gisle Vanem
2018-07-19 15:01:40 UTC
Permalink
Hello list, my 1st post.

I discovered that compiling and using the latest PortAudio
(from Assembla Git), causes a stack-overflow at the exit of
e.g. examples/pyex_ocean_shore.c when built using option '-Gr'.

It happens with clang-cl v6 only since MSVC-2017 won't allow
PortAudio to be built using '__fastcall'; conflict on 'bsearch()'
and 'main()' etc. which clang-cl fixes very well it seems.

Is this a known problem? The call-stack is not very helpful:

portaudio_x86!_chkstk(void)+0x29 [f:\dd\vctools\crt\vcstartup\src\misc\i386\chkstk.asm @ 99]
paex_ocean_shore!invoke_main+0x1c [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 78]
paex_ocean_shore!__scrt_common_main_seh(void)+0xf9 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 283]
KERNEL32!BaseThreadInitThunk+0x24
...

And:
eax=00a92000 ebx=00b8fd74 ecx=00000000 edx=00da0000 esi=00000000 edi=00b8fe04
eip=65a90289 esp=00b8fcfc ebp=00b8fe50 iopl=0 nv up ei pl nz na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00210206
portaudio_x86!_chkstk+0x29:
65a90289 8500 test dword ptr [eax],eax ds:002b:00a92000=00000000

The address at [eax] looks okay to me.

And to make it more difficult to trace, it doesn't happen every time.
--
--gv
Loading...