Re: [Cython] [cython-users] "Stack" checker for undefined behaviour in C code

2013-11-02 Thread Lisandro Dalcin
On 1 November 2013 23:47, Lisandro Dalcin  wrote:
> On 1 November 2013 21:53, Stefan Behnel  wrote:
>>
>> Erm - interesting. I looked through the code lines above and couldn't find
>> anything that looked suspicious. I hope I used the same source version as
>> you did (latest master?). Maybe I was just blinded by macros, but what I
>> saw looked rather reasonable...
>>
>
> Oh! Sorry, I've used branch 0.19.x, I'll check master and report back
> my findings.
>

OK, this is the commit in master I've used for test:

$ git show
commit 2cf64fd4e3e1f5d570d856c2e98fdc51930f1a50
Author: Robert Bradshaw 
Date:   Fri Nov 1 09:05:24 2013 -0700

Fix executable bits.

I got three warnings, see below. I understand the ones in _tempita.c
and FlowControl.c, but not sure about the others.



---
bug: anti-dce
model: |
  %523 = icmp ne i64 %522, 0, !dbg !1146
  -->  false
  
  :
  %518 = load %struct._object** @PyExc_UnboundLocalError, align 8, !dbg !1147
  %519 = call %struct._object* (%struct._object*, i8*, ...)*
@PyErr_Format(%struct._object* %518, i8* getelementptr inbounds ([49 x
i8]* @.str101, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8]*
@.str52, i32 0, i32 0)), !dbg !1147
  br label %605, !dbg !1150
stack:
  - /home/dalcinl/Devel/cython-dev/Cython/Plex/Scanners.c:6632:0
  - /home/dalcinl/Devel/cython-dev/Cython/Plex/Scanners.c:1734:0
ncore: 1
core:
  - /home/dalcinl/Devel/cython-dev/Cython/Plex/Scanners.c:6492:0
- null pointer dereference
---
bug: anti-simplify
model: |
  %2387 = icmp ne %struct._object* %__pyx_t_4.1, null, !dbg !3029
  -->  true
stack:
  - /home/dalcinl/Devel/cython-dev/Cython/Tempita/_tempita.c:24184:0
ncore: 1
core:
  - /home/dalcinl/Devel/cython-dev/Cython/Tempita/_tempita.c:591:0
- null pointer dereference
---
bug: anti-simplify
model: |
  %7850 = icmp ne %struct._object* %78, null, !dbg !4512
  -->  true
stack:
  - /home/dalcinl/Devel/cython-dev/Cython/Compiler/FlowControl.c:16478:0
ncore: 1
core:
  - /home/dalcinl/Devel/cython-dev/Cython/Compiler/FlowControl.c:30460:0
- null pointer dereference



-- 
Lisandro Dalcin
---
CIMEC (UNL/CONICET)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1016)
Tel/Fax: +54-342-4511169
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] [cython-users] "Stack" checker for undefined behaviour in C code

2013-11-02 Thread Stefan Behnel
Lisandro Dalcin, 02.11.2013 12:09:
> On 1 November 2013 23:47, Lisandro Dalcin wrote:
>> On 1 November 2013 21:53, Stefan Behnel wrote:
>>> Erm - interesting. I looked through the code lines above and couldn't find
>>> anything that looked suspicious. I hope I used the same source version as
>>> you did (latest master?). Maybe I was just blinded by macros, but what I
>>> saw looked rather reasonable...
>>
>> Oh! Sorry, I've used branch 0.19.x, I'll check master and report back
>> my findings.
> 
> OK, this is the commit in master I've used for test:
> 
> $ git show
> commit 2cf64fd4e3e1f5d570d856c2e98fdc51930f1a50

Thanks, that makes more sense.


> I got three warnings, see below. I understand the ones in _tempita.c
> and FlowControl.c, but not sure about the others.

They all look like false positives to me, e.g. dereferencing global
pointers to Python's builtin types.

Stefan

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel