Package: ltt-control
Version: 2.4.1-1
Usertags: goto-cc

During a rebuild of all Debian packages in a clean sid chroot (using cowbuilder
and pbuilder) the build failed with the following error. Please note that we
use our research compiler tool-chain (using tools from the cbmc package), which
permits extended reporting on type inconsistencies at link time.

[...]
  CCLD     liblttng-ctl.la

error: conflicting types for variable "cds_lfht_mm_mmap"
old definition in module rculfhash file rculfhash.h line 119
struct cds_lfht_mm_type {
  struct cds_lfht * (*)(unsigned long int min_nr_alloc_buckets, unsigned long 
int max_nr_buckets) alloc_cds_lfht;
  void (*)(struct cds_lfht *ht, unsigned long int order) alloc_bucket_table;
  void (*)(struct cds_lfht *ht, unsigned long int order) free_bucket_table;
  struct cds_lfht_node * (*)(struct cds_lfht *ht, unsigned long int index) 
bucket_at;
}
new definition in module rculfhash-mm-mmap file rculfhash-mm-mmap.c line 155
struct cds_lfht_mm_type {
  struct cds_lfht * (*)(unsigned long int min_nr_alloc_buckets, unsigned long 
int max_nr_buckets) alloc_cds_lfht;
  void (*)(struct cds_lfht *ht, unsigned long int order) alloc_bucket_table;
  void (*)(struct cds_lfht *ht, unsigned long int order) free_bucket_table;
  struct cds_lfht_node * (*)(struct cds_lfht *ht, unsigned long int index) 
bucket_at;
}

reason for conflict at cds_lfht->flavor in types listed below (struct/struct):
composite type component counts differ (12/10)
struct rcu_flavor_struct {
  void (*)(void) read_lock;
  void (*)(void) read_unlock;
  signed int (*)(void) read_ongoing;
  void (*)(void) read_quiescent_state;
  void (*)(struct rcu_head *head, void (*func)(struct rcu_head 
*update_call_rcu$$func$$head)) update_call_rcu;
  void (*)(void) update_synchronize_rcu;
  void (*)(void (*fct)(void *p), void *p) update_defer_rcu;
  void (*)(void) thread_offline;
  void (*)(void) thread_online;
  void (*)(void) register_thread;
  void (*)(void) unregister_thread;
  void (*)(void) barrier;
}
struct rcu_flavor_struct {
  void (*)(void) read_lock;
  void (*)(void) read_unlock;
  void (*)(void) read_quiescent_state;
  void (*)(struct rcu_head *head, void (*func)(struct rcu_head 
*update_call_rcu$$func$$head)) update_call_rcu;
  void (*)(void) update_synchronize_rcu;
  void (*)(void (*fct)(void *p), void *p) update_defer_rcu;
  void (*)(void) thread_offline;
  void (*)(void) thread_online;
  void (*)(void) register_thread;
  void (*)(void) unregister_thread;
}
Makefile:484: recipe for target 'liblttng-ctl.la' failed
make[5]: *** [liblttng-ctl.la] Error 64
make[5]: Leaving directory 
'/srv/jenkins-slave/workspace/sid-goto-cc-ltt-control/ltt-control-2.4.1/src/lib/lttng-ctl'
Makefile:551: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1

Reviewing the code this seems dangerous: rculfhash-mm-mmap. appears to own the
memory and defines functions to manipulate it:

http://sources.debian.net/src/ltt-control/2.4.1-1/src/common/hashtable/rculfhash-mm-mmap.c?hl=155#L155

Yet a pointer controlled by rculfhash.c eventually picks up that address:

http://sources.debian.net/src/ltt-control/2.4.1-1/src/common/hashtable/rculfhash.c?hl=1490#L1490

Given that the differences between the two struct types lie both in the middle
(read_ongoing) and at the end (barrier), field accesses will not be properly
aligned, or, really, the wrong functions may be called.

Best,
Michael

Attachment: pgp0uy_K0z8e0.pgp
Description: PGP signature

Reply via email to