Auth SEGV on sparc64, alignment problem?

Chris Ross
Thu, 22 Feb 2018 15:21:08 -0000

Okay.  Got to the next bit pretty quickly.:

Breakpoint 4, auth_settings_read (service=0x0, pool=0x4104b020,
   output_r=0x7fdfffff6d0) at auth-settings.c:522
522		input.module = "auth";
(gdb) n
523		input.service = service;
(gdb) n
524		if (master_service_settings_read(master_service, &input,
(gdb) s

Program received signal SIGTRAP, Trace/breakpoint trap.
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
0x000000004022a380 in ?? ()
(gdb)

 So, why did it not step into master_service_settings_read ?  Trying again:

523		input.service = service;
(gdb) s
524		if (master_service_settings_read(master_service, &input,
(gdb) list
519
520		i_zero(&input);
521		input.roots = set_roots;
522		input.module = "auth";
523		input.service = service;
524		if (master_service_settings_read(master_service, &input,
525						 output_r, &error) < 0)
526			i_fatal("Error reading configuration: %s", error);
527
528		pool_ref(pool);
(gdb) p input
$1 = {roots = 0x27fbd8, config_path = 0x0, preserve_environment = false,
 preserve_user = false, preserve_home = false, never_exec = false,
 use_sysexits = false, parse_full_config = false, module = 0x16ad70
"auth",
 service = 0x0, username = 0x0, local_ip = {family = 0, u = {ip6 = {
       __u6_addr = {__u6_addr8 = '\0' <repeats 15 times>,
__u6_addr16 = {0,
           0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}, ip4 = {
       s_addr = 0}}}, remote_ip = {family = 0, u = {ip6 = {__u6_addr = {
         __u6_addr8 = '\0' <repeats 15 times>, __u6_addr16 = {0,
0, 0, 0, 0,
           0, 0, 0}, __u6_addr32 = {0, 0, 0, 0}}}, ip4 = {s_addr = 0}}},
 local_name = 0x0}
(gdb) p &input
$2 = (struct master_service_settings_input *) 0x7fdfffff5a8
(gdb) p output_r
$3 = (struct master_service_settings_output *) 0x7fdfffff6d0
(gdb) p &error
$4 = (const char **) 0x7fdfffff598
(gdb) p error
$6 = 0x10dbd0 "@\005?\204\001"
(gdb) p master_service
$5 = (struct master_service *) 0x41030000
(gdb) s

Program received signal SIGTRAP, Trace/breakpoint trap.
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
0x000000004022a380 in ?? ()
(gdb)

 Any ideas here?  I?m not sure where to look next?

     - Chris


> On Feb 22, 2018, at 10:10, Chris Ross <cross+dovecot at distal.com>
wrote:
>
> Fancy, while not fun.  :-)  But thanks, that does work.  Doing that, n?ing
over calls to strcmp, it failed:
>
> passdbs_init () at passdb.c:313
> 313		passdb_register_module(&passdb_ldap);
> (gdb)
> passdb_register_module (iface=0x280120) at passdb.c:33
> 33		old_iface = passdb_interface_find(iface->name);
> (gdb)
> passdb_interface_find (name=0x16fe60 "ldap") at passdb.c:20
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 21			struct passdb_module_interface *iface = *ifaces;
> (gdb)
> 23			if (strcmp(iface->name, name) == 0)
> (gdb) n
> 20		array_foreach(&passdb_interfaces, ifaces) {
> (gdb)
> 26		return NULL;
> (gdb)
> 27	}
> (gdb)
> passdb_register_module (iface=0x280120) at passdb.c:34
> 34		if (old_iface != NULL && old_iface->verify_plain == NULL) {
> (gdb)
> 37		} else if (old_iface != NULL) {
> (gdb)
> 41		array_append(&passdb_interfaces, &iface, 1);
> (gdb)
> 42	}
> (gdb)
> passdbs_init () at passdb.c:314
> 314		passdb_register_module(&passdb_sql);
> (gdb)
> 315		passdb_register_module(&passdb_sia);
> (gdb)
> 316		passdb_register_module(&passdb_static);
> (gdb)
> 317		passdb_register_module(&passdb_oauth2);
> (gdb)
> 318	}
> (gdb)
> main_preinit () at main.c:186
> 186		userdbs_init();
> (gdb)
> 188		password_schemes_init();
> (gdb)
> 190		services = read_global_settings();
> (gdb)
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> Cannot remove breakpoints because program is no longer writable.
> It might be running in another process.
> Further execution is probably impossible.
> 0x000000004022a380 in ?? ()
> (gdb)
> Cannot find bounds of current function
> (gdb)
>
> Next step I?ll stop before that and be more careful about n?ing things,
but.  Just passing on context while I have it.
>
> Thanks.  More later.
>
>                      - Chris
>
>> On Feb 22, 2018, at 02:25, Aki Tuomi <aki.tuomi at dovecot.fi>
wrote:
>>
>> Hi!
>>
>> Unfortunately we do not have a Sparc64 with any OS at hand. Maybe you
could
>>
>> break main
>> r
>> s
>>
>> until it breaks?
>>
>> Aki
>>
>