Re: [Mingw-w64-public] swscanf() crashes if __USE_MINGW_ANSI_STDIO is defined

2017-11-12 Thread David Lee
On 12 November 2017 at 15:28, David Lee  wrote:
> On 11 November 2017 at 21:47, Hannes Domani via Mingw-w64-public
>  wrote:
>> Am Samstag, 11. November 2017, 10:15:00 MEZ hat Liu Hao  
>> Folgendes geschrieben:
>>
>>> Debugging in assembly exposes indirection through a null pointer in
>>> `mingw-w64-crt/stdio/mingw_wvfscanf.c` around or after line 906:
>>>
>>> ```
>>> optimize_alloc ((flags & IS_ALLOC_USED) != 0, pstr, str_sz, (wstr -
>>> (wchar_t *) *pstr), sizeof (wchar_t));`
>>> ```
>>
>> pstr==NULL, so the *pstr part crashes.
>>
>>> The CRT libraries of those toolchains were not compiled with debug
>>> information. Further investigation might not be possible.
>>>
>>> I am not able to reproducible this problem on master. You might want to
>>> try a newer version and see if the problem still exists.
>>
>> It doesn't look fixed on master, mingw_wvfscanf.c is the same in v5.x and 
>> master.
>>
>> But as far as I can tell this was fixed in mingw_vfscanf in here:
>> https://sourceforge.net/p/mingw-w64/mailman/message/27912175/
>> https://sourceforge.net/p/mingw-w64/mingw-w64/ci/72d60c1a06490ec5937e6c620956b167bf0bf329/
>>
>> There is even the suggestion that mingw_wvfscanf.c might need a similar fix, 
>> which was never done.
>>
>
> Looks like the fix was in mingw_vfscanf.c but not in mingw_wvfscanf.c.
> optimize_alloc() looks different in each file.
>
> I'll try building a GCC with master mingw-w64, test it and see what happens.
>

Built and tested a cross compiler (i686-w64-mingw32-gcc 6.4.0) on
debian stretch with master mingw-w64. Same crash.

David Lee.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 1/2] headers: Allow setting the default __MSVCRT_VERSION__

2017-11-12 Thread Martin Storsjö

On Sat, 11 Nov 2017, Martin Storsjö wrote:


On Sat, 11 Nov 2017, Jacek Caban wrote:

I would prefer to have the same names for headers and crt configure 
arguments. Other than that, it looks good to me.


Yes, that's probably good. I originally had some thought about why I made 
them different, because what they do is subtly different, but the distinction 
isn't really meaningful.


So I guess --with-default-msvcrt= is the most sensible name for both of them 
then - I'll push it with that name soon.


Pushed, thanks to everybody for reviewing!

// Martin
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public