MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

jmak
MAME Fan
Reged: 06/16/12
Posts: 7
Send PM
Re: bug: chdman output depends on system qsort() implementation
06/16/12 08:33 PM


> I was just providing evidence to the original poster's claim that qsort *can* produce
> different results because it's inherently not a stable sort algorithm.
>
> In practice, due to the way that MAME uses qsort, I don't know if it actually *does*
> produce different output. Re-reading the original post, I'm not sure that he's even
> claiming that it actually *is* producing different output.

Yes, the output is different. Even the same chdman binary produces a different output when run 1) under Wine, using Wine's C library, and 2) under real Windows, using msvcrt.dll.

> I guess we need for him to come back and provide some proof.

With the patch I attached, it's possible to eg. reverse the order of the secondary sort key, which yields completely different (but also valid) compressed data. So the exact qsort() implementation really matters.

Yet another minor issue:

I also noticed that one byte near the end of the output chaosheatj.chd can have several different values. Valgrind reports usage of some uninitialized bytes when writing the index, I'll look into that later.







Entire thread
Subject Posted by Posted on
* bug: chdman output depends on system qsort() implementation jmak 06/16/12 12:55 PM
. * Re: bug: chdman output depends on system qsort() implementation R. Belmont  06/16/12 03:56 PM
. * Re: bug: chdman output depends on system qsort() implementation krick  06/16/12 04:16 PM
. * Re: bug: chdman output depends on system qsort() implementation R. Belmont  06/16/12 05:50 PM
. * Re: bug: chdman output depends on system qsort() implementation krick  06/16/12 06:28 PM
. * Re: bug: chdman output depends on system qsort() implementation R. Belmont  06/16/12 06:39 PM
. * Re: bug: chdman output depends on system qsort() implementation italieAdministrator  06/16/12 08:38 PM
. * Re: bug: chdman output depends on system qsort() implementation jmak  06/16/12 08:22 PM
. * Re: bug: chdman output depends on system qsort() implementation krick  06/17/12 07:38 PM
. * Re: bug: chdman output depends on system qsort() implementation jmak  06/17/12 07:44 PM
. * Re: bug: chdman output depends on system qsort() implementation R. Belmont  06/17/12 10:13 PM
. * Re: bug: chdman output depends on system qsort() implementation AaronGiles  06/17/12 11:37 PM
. * Re: bug: chdman output depends on system qsort() implementation krick  06/18/12 04:08 AM
. * Re: bug: chdman output depends on system qsort() implementation R. Belmont  06/16/12 10:13 PM
. * Re: bug: chdman output depends on system qsort() implementation jmak  06/17/12 06:47 PM
. * Re: bug: chdman output depends on system qsort() implementation jmak  06/17/12 06:58 PM
. * Re: bug: chdman output depends on system qsort() implementation R. Belmont  06/17/12 10:00 PM
. * Re: bug: chdman output depends on system qsort() implementation jmak  06/19/12 09:30 PM
. * Re: bug: chdman output depends on system qsort() implementation AaronGiles  06/17/12 02:09 AM
. * Re: bug: chdman output depends on system qsort() implementation TafoidAdministrator  06/16/12 09:06 PM
. * Re: bug: chdman output depends on system qsort() implementation krick  06/16/12 08:10 PM
. * Re: bug: chdman output depends on system qsort() implementation jmak  06/16/12 08:33 PM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 19 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2120