Segmentation fault when the default directory is set

Hi,
First of all thank you so much for this backup software. It works wonders with windows

I’ve also tried to use it with ubuntu clients but I’m having an issue with segmentation faults.
My clients are headless, and so I compiled by doing ./configure --enable-headless before.
I am also using client version 1.3.1, with the modification included in the commit “Fixed compile error with older wxWidget versions” (so ust edited the main.cpp) so that it would compile.

The server finds the client find, and upon initial backup attempt says that no directories have been set. I then set a default directory in the server side (in my case
/mnt/snap_root;
), with the client specific box ticked. After that the server tries to push the settings to the client, and the client segfaults. This is the log obtained from both sync attempts explained above

start_urbackup_client --no_daemon --loglevel debug
2014-03-16 16:23:00: Loaded -fileserv- plugin
2014-03-16 16:23:00: Loaded -fsimageplugin- plugin
2014-03-16 16:23:00: Loaded -cryptoplugin- plugin
2014-03-16 16:23:00: Created new database connection for urbackup/backup_client.                                                               db
2014-03-16 16:23:00: urbackupserver: Server started up sucessfully!
2014-03-16 16:23:00: FileSrv: Info: retval 0
2014-03-16 16:23:00: FileSrv: Info: retval 0
2014-03-16 16:23:00: FileSrv: Info: Window size=425984
2014-03-16 16:23:00: FileSrv: Binding udp socket...
2014-03-16 16:23:00: FileSrv: done.
2014-03-16 16:23:00: FileSrv: Servername: -linux-server.dandc.luzzato.com-
2014-03-16 16:23:00: FileSrv: Server started up sucessfully
2014-03-16 16:23:00: FileSrv: UDP Thread startet
2014-03-16 16:23:00: Started UrBackupClient Backend...
2014-03-16 16:23:01: Looking for old Sessions... 0 sessions
2014-03-16 16:23:01: Internet test mode not enabled. Waiting for local server...
2014-03-16 16:23:01: Created new database connection for urbackup/backup_client.                                                               db
2014-03-16 16:23:41: FileSrv: UDP: PING received... sending PONG. Delay=442ms
2014-03-16 16:24:12: urbackupserver: No available slots... starting new Worker
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#ADD IDENTITY
2014-03-16 16:24:12: rc=0 hasError=true state=0
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#CAPA
2014-03-16 16:24:12: rc=0 hasError=true state=0
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#1CHANNEL capa=0
2014-03-16 16:24:12: New channel: Number of Channels: 1
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#SETTINGS update_freq_incr_def=18000
update_freq_full_def=2592000
update_freq_image_full_def=5184000
update_freq_image_incr_def=604800
max_file_incr_def=100
min_file_incr_def=40
max_file_full_def=10
min_file_full_def=2
min_image_incr_def=4
max_image_incr_def=30
min_image_full_def=2
max_image_full_def=5
startup_backup_delay_def=0
backup_window_incr_file_def=1-7/0-24
backup_window_full_file_def=1-7/0-24
backup_window_incr_image_def=1-7/0-24
backup_window_full_image_def=1-7/0-24
exclude_files_def=
include_files_def=
_def=
default_dirs_def=
allow_config_paths_def=true
allow_starting_full_file_backups_def=true
allow_starting_incr_file_backups_def=true
allow_starting_full_image_backups_def=true
allow_starting_incr_image_backups_def=true
allow_pause_def=true
allow_log_view_def=true
allow_overwrite_def=true
image_letters_def=C
internet_server_def=
internet_server_port_def=55415
internet_authkey_def=7QixTnwAhQ
internet_speed_def=-1
local_speed_def=-1
_def=
internet_image_backups_def=false
internet_full_file_backups_def=false
internet_encrypt_def=true
internet_compress_def=true
internet_mode_enabled_def=false
silent_update_def=false
client_quota_def=100%
local_full_file_transfer_mode_def=hashed
internet_full_file_transfer_mode_def=hashed
local_incr_file_transfer_mode_def=hashed
internet_incr_file_transfer_mode_def=blockhash
local_image_transfer_mode_def=hashed
internet_image_transfer_mode_def=hashed
file_hash_collect_amount_def=1000
file_hash_collect_timeout_def=10000
file_hash_collect_cachesize_def=40960
end_to_end_file_backup_verification_def=false
internet_calculate_filehashes_on_client_def=false  

2014-03-16 16:24:12: Created new database connection for urbackup/backup_client.db
2014-03-16 16:24:12: rc=0 hasError=true state=0
2014-03-16 16:24:12: FileSrv: Received data...
2014-03-16 16:24:12: FileSrv: Received a Packet.
2014-03-16 16:24:12: FileSrv: Sending file urbackup/settings.cfg
2014-03-16 16:24:12: FileSrv: Mapped name: /usr/local/var/urbackup/data/settings.cfg
2014-03-16 16:24:12: FileSrv: Recv Error in RecvMessage
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#INCRINTERVALL "18000"
2014-03-16 16:24:12: rc=0 hasError=true state=0
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#VERSION 74
2014-03-16 16:24:12: rc=0 hasError=true state=0
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#PING RUNNING -0-#token=gm2YlrXvfmiKMRDYhdPm
2014-03-16 16:24:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#2START FULL BACKUP#token=gm2YlrXvfmiKMRDYhdPm
2014-03-16 16:24:12: Removing VSS log data...
2014-03-16 16:24:12: rc=0 hasError=true state=0
2014-03-16 16:24:12: rc=0 hasError=true state=0
2014-03-16 16:24:22: FileSrv: ClientThread deleted. 1024 KB Memory freed.
2014-03-16 16:24:32: FileSrv: UDP: PING received... sending PONG. Delay=398ms
2014-03-16 16:25:12: ClientService cmd: PONG
2014-03-16 16:25:22: FileSrv: UDP: PING received... sending PONG. Delay=67ms
2014-03-16 16:26:01: Internet mode is not enabled.
2014-03-16 16:26:01: Internet mode is not enabled.
2014-03-16 16:26:12: ClientService cmd: PONG
2014-03-16 16:26:12: rc=0 hasError=true state=3
2014-03-16 16:26:12: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#1CHANNEL capa=0
2014-03-16 16:26:12: New channel: Number of Channels: 1
2014-03-16 16:26:13: FileSrv: UDP: PING received... sending PONG. Delay=330ms
2014-03-16 16:26:36: FileSrv: Received data...
2014-03-16 16:26:36: FileSrv: Received a Packet.
2014-03-16 16:26:36: FileSrv: Sending file urbackup/settings.cfg
2014-03-16 16:26:36: FileSrv: Mapped name: /usr/local/var/urbackup/data/settings.cfg
2014-03-16 16:26:36: FileSrv: Recv Error in RecvMessage
2014-03-16 16:26:36: ClientService cmd: #IXDTUQPB8iDojB4lqdLSg#SETTINGS update_freq_incr_def=18000
update_freq_full_def=2592000
update_freq_image_full_def=5184000
update_freq_image_incr_def=604800
max_file_incr_def=100
min_file_incr_def=40
max_file_full_def=10
min_file_full_def=2
min_image_incr_def=4
max_image_incr_def=30
min_image_full_def=2
max_image_full_def=5
startup_backup_delay_def=0
backup_window_incr_file_def=1-7/0-24
backup_window_full_file_def=1-7/0-24
backup_window_incr_image_def=1-7/0-24
backup_window_full_image_def=1-7/0-24
exclude_files_def=
include_files_def=
computername_def=linux-server.dandc.luzzato.com
default_dirs_def=/mnt/snap_root;
allow_config_paths_def=true
allow_starting_full_file_backups_def=true
allow_starting_incr_file_backups_def=true
allow_starting_full_image_backups_def=true
allow_starting_incr_image_backups_def=true
allow_pause_def=true
allow_log_view_def=true
allow_overwrite_def=true
image_letters_def=C
internet_server_def=
internet_server_port_def=55415
internet_authkey_def=7QixTnwAhQ
internet_speed_def=-1
local_speed_def=-1
_def=
internet_image_backups_def=false
internet_full_file_backups_def=false
internet_encrypt_def=true
internet_compress_def=true
internet_mode_enabled_def=false
silent_update_def=false
client_quota_def=100%
local_full_file_transfer_mode_def=hashed
internet_full_file_transfer_mode_def=hashed
local_incr_file_transfer_mode_def=hashed
internet_incr_file_transfer_mode_def=blockhash
local_image_transfer_mode_def=hashed
internet_image_transfer_mode_def=hashed
file_hash_collect_amount_def=1000
file_hash_collect_timeout_def=10000
file_hash_collect_cachesize_def=40960
end_to_end_file_backup_verification_def=false
internet_calculate_filehashes_on_client_def=false  

Segmentation fault (core dumped)

It seems to me that the linux client isn’t able to accept this settings file and crashes. Any help welcome

You should be able to compile the headless client without applying the wxWidgets compile fix.

I tried it on ubuntu 12.10 and could not immediately reproduce the problem. As you have it compiled, can you run it in gdb ?
This should give some hints https://urbackup.atlassian.net/wiki/display/US/Debugging+with+gdb+on+Linux . The run_in_gdb option is not available for the client though. You need to edit /usr/local/sbin/start_urbackup_client

Hi and thanks for your answer.
Just ran gdb, and the error is indeed an unsupported character i the settings file

here is the error output from gdb

2014-03-18 07:49:11: Created new database connection for urbackup/backup_client.db

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee7fc700 (LWP 25345)]
0x00007ffff5d9dc38 in removeChars (in=...) at ClientService.cpp:891
891             wchar_t illegalchars[] = {'*', ':', '/' , '\\'};

I suspect that I should not have entered forward slashes for my ‘Default directories to backup:’ path
/mnt/snap_root/;

I will try with back slashes instead and see what that brings

Whatever I put for default backup directory (I tried /mnt/snap_root; \mnt\snap_root; mnt\snap_root; mnt) it always segfaults at the same place.

In any case, the error points to this in ClientService.cpp

	else if(cmd.find("2LOGDATA ")==0 && ident_ok==true)
{
std::string ldata=cmd.substr(9);
size_t cpos=ldata.find(" ");
std::string created=getuntil(" ", ldata);
lasttime=Server->getTimeMS();
saveLogdata(created, getafter(" ",ldata));
tcpstack.Send(pipe, "OK");
} 

I’m not sure what that does. Is that associated with logging ?

After running bt in the debugger I get this

(gdb) bt
#0  0x00007ffff5d9dc38 in removeChars (in=...) at ClientService.cpp:891
#1  0x00007ffff5da6628 in ClientConnector::saveBackupDirs (
    this=this@entry=0x7fffd0000f40, args=...,
    server_default=server_default@entry=true) at ClientService.cpp:942
#2  0x00007ffff5da8746 in ClientConnector::updateSettings (
    this=this@entry=0x7fffd0000f40, pData=...) at ClientService.cpp:1176
#3  0x00007ffff5dc7362 in ClientConnector::CMD_UPDATE_SETTINGS (
    this=this@entry=0x7fffd0000f40, cmd=...) at ClientServiceCMD.cpp:403
#4  0x00007ffff5da2a03 in ClientConnector::ReceivePackets (this=0x7fffd0000f40)
    at ClientService.cpp:750
#5  0x00000000004272f6 in CServiceWorker::operator() (this=0x7fffdc000960)
    at ServiceWorker.cpp:193
#6  0x0000000000415189 in thread_helper_f (t=<optimised out>)
    at Server.cpp:1227
#7  0x00007ffff74a6f6e in start_thread (arg=0x7fffee7fc700)
    at pthread_create.c:311
#8  0x00007ffff71d19cd in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113  

installed a new VM of ubuntu 13.10 desktop to test on a clean install.
I had to correcte the wxwidget line again in client/main.cpp.

I didn’t run the debugger, but the error obtained from the client is the same.
Also the taskbar widget doesn’t seem to launch, but thats purely cosmetic.

Some more info. I tested the install on ubuntu 12.04 LTS on desktop version, and it worked fine there (compiled first as normal, then uninstalled, then compiled as headless, and both worked.)
Are there any dependencies which might not be correctly met with ubuntu 13.10 ?

It’s a stack overflow. I corrected it with a 1.3.2 version. Download here: http://sourceforge.net/projects/urbackup/files/Client/1.3.2/urbackup-client-1.3.2.tar.gz/download (will update homepage soon). I think it needs an alternative UI on Linux, because there may be no task bar (or there is a whitelist of apps which can show task bar icons like in Ubuntu).

Thanks, works great for headless now. The backup is running now, no issues at all.