Ticket #2 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

64-bit eggdrop builds crash on some systems

Reported by: pseudo Owned by: pseudo
Priority: blocker Milestone: 1.6.20
Component: Core Version: 1.6.20
Keywords: Cc:


Eggdrop crashes on *BSD/amd64 and likely on 64-bit big-endian architectures.
Crashes usually happen in modules allocating memory trough mod_malloc() but are
potentially possible in various other places.

The root of the problem is the assumption that pointers are of the same size as
ints, which is correct for a 32 bit data type model, but obviously not for
64-bit build environments. Pointers and ints are used interchangeably
everywhere in the source code, which leads to crashes when a garbled pointer is

The crash on BSD systems is unconditional due to the fact that malloc()
allocates high addresses by default (which don't fit into an int). Users of
FreeBSD can avoid a crash on startup by setting the MALLOC_OPTIONS environment

env MALLOC_OPTIONS='Dm' ./eggdrop

This will make malloc() to map lower addresses so that truncating a pointer to
int might not lose meaningful information and eggdrop will be able to run.

The bug needs to be fixed by removing any casts of pointer to int and changing
function arguments and variables to use proper data types suitable for their


eggdrop1.6-64bit.patch Download (59.2 KB) - added by pseudo 6 years ago.

Change History

comment:1 Changed 6 years ago by simple

  • Milestone changed from 1.6.21 to 1.6.20

comment:2 Changed 6 years ago by simple

  • Version set to 1.6.20 CVS

comment:3 Changed 6 years ago by pseudo

  • Owner set to pseudo
  • Status changed from new to accepted

comment:4 Changed 6 years ago by pseudo

  • Priority changed from critical to blocker

Changed 6 years ago by pseudo

comment:5 Changed 6 years ago by pseudo

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.