Opened 8 years ago

Closed 8 years ago

#5078 closed defect (fixed)

Debug logging segfault

Reported by: twilde Owned by: asn
Priority: Medium Milestone:
Component: Archived/Obfsproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When obfsproxy is configured with the following in torrc:

servertransportplugin obfs2 exec /usr/local/bin/obfsproxy --managed --log-file=/var/log/tor/obfsproxy.log --log-min-severity=debug

It immediately segfaults on startup, with the following stack trace:

Core was generated by `/usr/local/bin/obfsproxy --managed --log-file=/var/log/tor/obfsproxy.log --log-'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000003ec1879b80 in strlen () from /lib64/libc.so.6
(gdb) bt
#0  0x0000003ec1879b80 in strlen () from /lib64/libc.so.6
#1  0x0000003ec1846cb9 in vfprintf () from /lib64/libc.so.6
#2  0x0000003ec18699da in vsnprintf () from /lib64/libc.so.6
#3  0x00000000004058b3 in obfs_vsnprintf (
    str=0x7fff872eb5e8 "0123456789abcdefghijklmnopqrstuvwxyz 0.0.0.0:42401 \301>", size=1, format=0x7fff872ebb08 " \337\314\020\377\377\377\377\002", args=0x0)
    at src/util.c:304
#4  0x0000000000405a0a in logv (severity=<value optimized out>, 
    format=0x40af0a "%s %s %s:%hu\n", ap=0x7fff872eba10) at src/util.c:530
#5  0x000000000040243e in print_protocol_line (
    format=0x40af0a "%s %s %s:%hu\n") at src/managed.c:152
#6  0x0000000000402570 in print_method_line (proxy=0x10cbf010)
    at src/managed.c:331
#7  open_listeners_managed (proxy=0x10cbf010) at src/managed.c:540
#8  0x0000000000402b5f in launch_server_listeners () at src/managed.c:594
#9  launch_listeners () at src/managed.c:650
#10 launch_managed_proxy () at src/managed.c:681
#11 0x0000000000402087 in obfs_main (argc=281861920, argv=0x1)
    at src/main.c:265
#12 0x0000003ec181d994 in __libc_start_main () from /lib64/libc.so.6
#13 0x0000000000401de9 in _start ()

100% reproducible in my environment. Core file available if needed.

Child Tickets

Change History (4)

comment:1 Changed 8 years ago by twilde

I should have mentioned, the following is logged prior to the segfault:

Brand new obfsproxy log:
[debug] Proxy environment:
state_loc: '/var/lib/tor/pt_state/'
conf_proto_version: '1'
transports: 'obfs2'
[debug] Proxy environment (cont):
extended_port: '127.0.0.1:4200'
or_port: '127.0.0.1:993'
bindaddrs: 'obfs2-0.0.0.0:42401'
[debug] We sent:
[debug] (null) (null)

[debug] Now listening on 0.0.0.0:42401 for protocol obfs2.
[debug] We sent:

comment:2 Changed 8 years ago by nickm

Status: newneeds_revision

Fix in branch bug5078 in my public repository. Had to add an autoconf check for va_copy, since windows does not have it iirc. Please have a quick look?

comment:3 in reply to:  2 Changed 8 years ago by twilde

Replying to nickm:

Fix in branch bug5078 in my public repository. Had to add an autoconf check for va_copy, since windows does not have it iirc. Please have a quick look?

That fix works for me, no more segfault, plenty of excess debugging logs. :)

Thanks,
Tim

comment:4 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_revisionclosed

merged; thanks!

Note: See TracTickets for help on using tickets.