size mismatch! assertion failure

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

size mismatch! assertion failure

Jay Foad
Hi,

On a particular source file I get:

$ clang -cc1 -w -S foo.i
clang: /home/jay/svn/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp:401:
static llvm::Constant*<unnamed>::ConstStructBuilder::BuildStruct(clang::CodeGen::CodeGenModule&,
clang::CodeGen::CodeGenFunction*, clang::InitListExpr*): Assertion
`llvm::RoundUpToAlignment(Builder.NextFieldOffsetInBytes,
Builder.getAlignment(Result)) == Builder.getSizeInBytes(Result) &&
"Size mismatch!"' failed.
0  clang           0x00000000015a0dc0
1  clang           0x00000000015a0c84
2  libpthread.so.0 0x00007f19c3a978f0
3  libc.so.6       0x00007f19c2d87a75 gsignal + 53
4  libc.so.6       0x00007f19c2d8b5c0 abort + 384
5  libc.so.6       0x00007f19c2d80941 __assert_fail + 241
6  clang           0x00000000005f1487
7  clang           0x00000000005f23a6
8  clang           0x00000000005f254b
9  clang           0x00000000005f5485
10 clang           0x00000000005f3965
11 clang           0x00000000005bd5e0
12 clang           0x00000000005bb333
13 clang           0x00000000005bb22e
14 clang           0x000000000064f1f9
15 clang           0x000000000064d68e
16 clang           0x000000000064d1b2
17 clang           0x000000000064d8ae
18 clang           0x000000000064d64d
19 clang           0x000000000064d1b2
20 clang           0x0000000000678b34
21 clang           0x0000000000679129
22 clang           0x00000000005676f5
23 clang           0x000000000056584f
24 clang           0x0000000000564b45
25 clang           0x0000000000562ec0
26 clang           0x000000000055f9ad
27 clang           0x000000000055d614
28 clang           0x00000000006a381e
29 clang           0x00000000004524ce
30 clang           0x000000000055e63c
31 clang           0x000000000045212e
32 clang           0x000000000043bd6c
33 clang           0x00000000004093ee
34 clang           0x00000000004121c4 main + 357
35 libc.so.6       0x00007f19c2d72c4d __libc_start_main + 253
36 clang           0x0000000000407d89
Stack dump:
0. Program arguments: /home/jay/clang/objdir/Debug/bin/clang -cc1 -w -S foo.i
1. <eof> parser at end of file
2. Per-file LLVM IR generation
3. foo.c:801:13: Generating code for declaration 'bar'
4. foo.c:802:2: LLVM IR generation of compound statement ('{}')
Aborted


The source file is (a) quite big and (b) proprietary, so I don't
really want to post it in its current form. What can I do to help fix
the problem? E.g. is there something like bugpoint that can reduce it
automatically, or is there anything useful I can do in the debugger
when it fails?

I'm running Ubuntu 10.4 x86_64, and I built LLVM and clang from svn
trunk as of a few hours ago.

Thanks,
Jay.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: size mismatch! assertion failure

Christopher Jefferson

On 2 Jul 2010, at 13:45, Jay Foad wrote:

> Hi,
>
> On a particular source file I get:
>
>
> The source file is (a) quite big and (b) proprietary, so I don't
> really want to post it in its current form. What can I do to help fix
> the problem? E.g. is there something like bugpoint that can reduce it
> automatically, or is there anything useful I can do in the debugger
> when it fails?

multidelta ( http://delta.tigris.org/ ) is the standard system and usually does quite well, if a little slowly. Be sure to follow the instructions on the webpage and it is fairly easy to get going.

I also have a personal hacked up extension of it which often does even better, but isn't distributable. If you were willing to give me the file, I would be happy to reduce it, and just pass the reduced version on (after letting you have a look if you like)

Chris



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: size mismatch! assertion failure

Pedro Ferreira
In reply to this post by Jay Foad
Try building clang with debug info, as the present stack dump doesn't
give a lot of info.
After that, run with gdb and when the assert fails, do a "bt" to get the
stack trace. By going back on clang's function calls, you may be able to
track the problem down to the line of code on your source (the file you
are trying to compile) that generated the error in the first place.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jay Foad
> Sent: 02 July 2010 13:45
> To: clang-dev Developers
> Subject: [cfe-dev] size mismatch! assertion failure
>
> Hi,
>
> On a particular source file I get:
>
> $ clang -cc1 -w -S foo.i
> clang:
> /home/jay/svn/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstan
> t.cpp:401:
> static
> llvm::Constant*<unnamed>::ConstStructBuilder::BuildStruct(clan
> g::CodeGen::CodeGenModule&,
> clang::CodeGen::CodeGenFunction*, clang::InitListExpr*):
> Assertion `llvm::RoundUpToAlignment(Builder.NextFieldOffsetInBytes,
> Builder.getAlignment(Result)) ==
> Builder.getSizeInBytes(Result) && "Size mismatch!"' failed.
> 0  clang           0x00000000015a0dc0
> 1  clang           0x00000000015a0c84
> 2  libpthread.so.0 0x00007f19c3a978f0
> 3  libc.so.6       0x00007f19c2d87a75 gsignal + 53
> 4  libc.so.6       0x00007f19c2d8b5c0 abort + 384
> 5  libc.so.6       0x00007f19c2d80941 __assert_fail + 241
> 6  clang           0x00000000005f1487
> 7  clang           0x00000000005f23a6
> 8  clang           0x00000000005f254b
> 9  clang           0x00000000005f5485
> 10 clang           0x00000000005f3965
> 11 clang           0x00000000005bd5e0
> 12 clang           0x00000000005bb333
> 13 clang           0x00000000005bb22e
> 14 clang           0x000000000064f1f9
> 15 clang           0x000000000064d68e
> 16 clang           0x000000000064d1b2
> 17 clang           0x000000000064d8ae
> 18 clang           0x000000000064d64d
> 19 clang           0x000000000064d1b2
> 20 clang           0x0000000000678b34
> 21 clang           0x0000000000679129
> 22 clang           0x00000000005676f5
> 23 clang           0x000000000056584f
> 24 clang           0x0000000000564b45
> 25 clang           0x0000000000562ec0
> 26 clang           0x000000000055f9ad
> 27 clang           0x000000000055d614
> 28 clang           0x00000000006a381e
> 29 clang           0x00000000004524ce
> 30 clang           0x000000000055e63c
> 31 clang           0x000000000045212e
> 32 clang           0x000000000043bd6c
> 33 clang           0x00000000004093ee
> 34 clang           0x00000000004121c4 main + 357
> 35 libc.so.6       0x00007f19c2d72c4d __libc_start_main + 253
> 36 clang           0x0000000000407d89
> Stack dump:
> 0. Program arguments:
> /home/jay/clang/objdir/Debug/bin/clang -cc1 -w -S foo.i
> 1. <eof> parser at end of file
> 2. Per-file LLVM IR generation
> 3. foo.c:801:13: Generating code for declaration 'bar'
> 4. foo.c:802:2: LLVM IR generation of compound statement ('{}')
> Aborted
>
>
> The source file is (a) quite big and (b) proprietary, so I
> don't really want to post it in its current form. What can I
> do to help fix the problem? E.g. is there something like
> bugpoint that can reduce it automatically, or is there
> anything useful I can do in the debugger when it fails?
>
> I'm running Ubuntu 10.4 x86_64, and I built LLVM and clang
> from svn trunk as of a few hours ago.
>
> Thanks,
> Jay.
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: size mismatch! assertion failure

Jay Foad
In reply to this post by Christopher Jefferson
>> The source file is (a) quite big and (b) proprietary, so I don't
>> really want to post it in its current form. What can I do to help fix
>> the problem? E.g. is there something like bugpoint that can reduce it
>> automatically, or is there anything useful I can do in the debugger
>> when it fails?
>
> multidelta ( http://delta.tigris.org/ ) is the standard system and usually does quite well, if a little slowly. Be sure to follow the instructions on the webpage and it is fairly easy to get going.

Thanks. I used delta, did some manual obfuscation, and filed a bug:

http://llvm.org/bugs/show_bug.cgi?id=7564

Thanks,
Jay.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev