sb-alien, cl:boolean, and the C _Bool type
Bug #914612 reported by
Attila Lendvai
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
1.0.55 x86-64
(define-
...)
but on the C side:
typedef int boolean;
so, the C side is 32 bits, while the default size for the type translator is 64 bits.
this is very misleading and results in e.g.:
(setf (sb-alien:
for a user who doesn't look twice it looks completely fine, but it silently corrupts memory.
summary: |
- internal_errors_enabled is NIL in a save-lisp-and-die executable image - long after startup + the default bit size of the boolean alien-type-translator doesn't match + the C side |
description: | updated |
Changed in sbcl: | |
status: | Invalid → New |
tags: | added: alien |
To post a comment you must log in.
err, sorry, scratch that. it's due to something i call, and that used to work, but not anymore.
CL-USER> (sb-alien: extern- alien "lose_on_ corruption_ p" boolean) extern- alien "internal_ errors_ enabled" boolean) extern- alien "lose_on_ corruption_ p" boolean) t) extern- alien "internal_ errors_ enabled" boolean)
T
CL-USER> (sb-alien:
T
CL-USER> (setf (sb-alien:
T
CL-USER> (sb-alien:
NIL
i guess the way boolean type is given to extern-alien results in a wider setf than what C uses for booleans... any hints on how to do it the right way?
this is on linux x64.