relay: Setting ORPort [<IPv6>]:auto segfault or uses wrong port

Related to #32588 (closed)

With current git master (after all the s55 work), setting this in your torrc will segfault:

ORPort 127.0.0.1:9001
ORPort [::1]:auto NoListen

The given IPv6 ORPort ends up being crap, on my system: ORPort [::1]:12845150.

I've also experienced a segfault once with another configuration:

Program received signal SIGSEGV, Segmentation fault.
0x0000555555995463 in remove_duplicate_orports (ports=<optimized out>) at src/feature/relay/relay_config.c:205
205	      if (!current->explicit_addr && next->explicit_addr &&
(gdb) bt
#0  0x0000555555995463 in remove_duplicate_orports (ports=<optimized out>) at src/feature/relay/relay_config.c:205
#1  check_and_prune_server_ports (n_low_ports_out=0x7fffffffd1c0, options=0x61d000001e80, ports=0x60200000a6d0) at src/feature/relay/relay_config.c:247
#2  port_parse_ports_relay (options=options@entry=0x61d000001e80, msg=msg@entry=0x7fffffffd840, ports_out=<optimized out>, 
    have_low_ports_out=have_low_ports_out@entry=0x555555dd11a0 <have_low_ports>) at src/feature/relay/relay_config.c:385
#3  0x00005555559f3312 in parse_ports (options=options@entry=0x61d000001e80, validate_only=validate_only@entry=1, msg=msg@entry=0x7fffffffd840, 
    n_ports_out=n_ports_out@entry=0x7fffffffd3e0, world_writable_control_socket=world_writable_control_socket@entry=0x7fffffffd3f0) at src/app/config/config.c:6394
#4  0x00005555559f9f0b in options_validate_cb (old_options_=<optimized out>, options_=0x61d000001e80, msg=<optimized out>) at src/app/config/config.c:3125
#5  0x0000555555a9bbdb in config_validate_single (fmt=0x555555cf36c0 <options_format>, old_options=old_options@entry=0x0, options=options@entry=0x61d000001e80, 
    msg_out=msg_out@entry=0x7fffffffd840) at src/lib/confmgt/confmgt.c:1229
#6  0x0000555555aa0ac0 in config_validate (mgr=0x607000000410, old_options=old_options@entry=0x0, options=options@entry=0x61d000001e80, msg_out=msg_out@entry=0x7fffffffd840)
    at src/lib/confmgt/confmgt.c:1302
#7  0x00005555559f8046 in options_validate_and_set (old_options=0x0, new_options=0x61d000001e80, msg_out=0x7fffffffd840) at src/app/config/config.c:2882
#8  0x00005555559f8607 in options_init_from_string (cf_defaults=<optimized out>, cf=<optimized out>, command=command@entry=0, command_arg=command_arg@entry=0x0, 
    msg=msg@entry=0x7fffffffd840) at src/app/config/config.c:4578
#9  0x00005555559f94b0 in options_init_from_torrc (argc=argc@entry=3, argv=argv@entry=0x6030000325f0) at src/app/config/config.c:4412
#10 0x000055555573d011 in tor_init (argc=argc@entry=3, argv=0x6030000325f0) at src/app/main/main.c:612
#11 0x000055555573dd9c in tor_run_main (tor_cfg=tor_cfg@entry=0x604000000050) at src/app/main/main.c:1287
#12 0x000055555573b34c in tor_main (argc=3, argv=0x7fffffffdde8) at src/feature/api/tor_api.c:164
#13 0x0000555555734390 in main (argc=<optimized out>, argv=<optimized out>) at src/app/main/tor_main.c:32

Not sure what is happening but clearly the auto is not being handled normally and causing some ripple effects sometimes.