Re: openexr
On Fri, Apr 22, 2016 at 10:25 AM, Mathieu Malaterre <malat@debian.org> wrote:
> [CC me please]
>
> I am trying to debug openexr FTBFS:
>
> https://buildd.debian.org/status/fetch.php?pkg=openexr&arch=sparc64&ver=2.2.0-10&stamp=1461249335
>
> As far as I know there are no porterbox for sparc64:
>
> https://db.debian.org/machines.cgi
>
> Anyone could try to dump a full backtrace of the crash ?
>
> thanks much
Just for reference, the bug was trivial. Minimal test case:
$ cat test.cxx
#include <vector>
#include <stdint.h>
using namespace std;
int main()
{
int dataSize = 8220;
vector<char> data(4096);
data.resize(dataSize);
{
int64_t * p = (int64_t*)&data[0];
*p = 0;
}
{
int64_t * p = (int64_t*)(&data[0]+1);
*p = 0;
}
return 0;
}
On x86 you can take advantage of the new UB sanitizer behavior from gcc:
$ g++ -fsanitize=undefined -o test test.cxx && ./test
test.cxx:18:9: runtime error: store to misaligned address
0x000000f78c31 for type 'int64_t', which requires 8 byte alignment
0x000000f78c31: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
^
Cheers
Reply to:
- References:
- openexr
- From: Mathieu Malaterre <malat@debian.org>