Source: cpputest
Version: 3.8-7
Severity: normal

Dear Maintainer,

The build fails running CppUTestTests:
./CppUTestTests
............................!........!..!..!..!..!
..!..!..!..!..!.................!....!.!......!...
..!..!..!make[2]: *** [Makefile:3402: tdd] Segmentation fault

Full log is here:
https://buildd.debian.org/status/fetch.php?pkg=cpputest&arch=hppa&ver=3.8-7&stamp=1520189685&raw=0

Running under gdb:

Breakpoint 1, 0x000d7c24 in __canonicalize_funcptr_for_compare ()
(gdb) p/x $r26
$1 = 0xdeadbeef
(gdb) bt
#0  0x000d7c24 in __canonicalize_funcptr_for_compare ()
#1  0x000d637c in UtestShell::assertFunctionPointersEqual (
    this=0x17b2fc 
<TEST_UnitTestMacros_FUNCTIONPOINTERS_EQUAL_TEXTBehavesAsProperMacro_TestShell_instance>,
 expected=<error reading variable>,
    actual=<error reading variable>, text=0xee948 "Failed because it failed",
    fileName=<optimized out>, lineNumber=<optimized out>, testTerminator=...)
    at src/CppUTest/Utest.cpp:475
#2  0x00095f64 in 
TEST_UnitTestMacros_FUNCTIONPOINTERS_EQUAL_TEXTBehavesAsProperMacro_Test::testBody
 (this=<optimized out>) at tests/TestUTestMacro.cpp:734
#3  0x000d3ebc in helperDoTestBody (data=<optimized out>)
    at src/CppUTest/Utest.cpp:92
#4  0x000d75b8 in PlatformSpecificSetJmpImplementation (
    function=@0x16e6d2: 0xd3e98 <helperDoTestBody(void*)>, data=0x1891d0)
    at src/Platforms/Gcc/UtestPlatform.cpp:144
#5  0x000d4474 in Utest::run (this=0xdeadbeef) at src/CppUTest/Utest.cpp:575

(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x000d7c50 in __canonicalize_funcptr_for_compare ()
(gdb) disass $pc-16,$pc+16
Dump of assembler code from 0xd7c40 to 0xd7c60:
   0x000d7c40 <__canonicalize_funcptr_for_compare+40>:  copy r26,r3
   0x000d7c44 <__canonicalize_funcptr_for_compare+44>:  addil L%9000,dp,r1
   0x000d7c48 <__canonicalize_funcptr_for_compare+48>:  ldw 488(r1),r21
   0x000d7c4c <__canonicalize_funcptr_for_compare+52>:  depwi 0,31,2,r3
=> 0x000d7c50 <__canonicalize_funcptr_for_compare+56>:  ldw 0(r3),ret0
   0x000d7c54 <__canonicalize_funcptr_for_compare+60>:  ldo 10(ret0),r20
   0x000d7c58 <__canonicalize_funcptr_for_compare+64>:  cmpb,= r21,r20,0xd7c70 
<__canonicalize_funcptr_for_compare+88>
   0x000d7c5c <__canonicalize_funcptr_for_compare+68>:  ldil L%-3ff2000,r31
End of assembler dump.

It looks like __canonicalize_funcptr_for_compare needs to be improved to
prevent access fault on garbage pointer, but maybe there's something that
can be done in cpputest.

Regards,
Dave Anglin

-- System Information:
Debian Release: buster/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.14.23+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968), LANGUAGE=C 
(charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Reply via email to