btsync 1.1.69 ARM Alignment error


THJ

Recommended Posts

While version 1.1.48 workes without any problems on my ARM NAS device, 1.1.69 doesn't want to start and exists with Alignment error.

$ ./btsync
Alignment error

Here are last few lines of strace if it helps to debug the error:

getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
brk(0) = 0x349000
brk(0x36a000) = 0x36a000
gettimeofday({1376379137, 723324}, NULL) = 0
mkdir("/tmp", 0777) = -1 EEXIST (File exists)
mkdir("/tmp/btsync_dumps", 0777) = -1 EEXIST (File exists)
gettimeofday({1376379137, 727732}, NULL) = 0
futex(0x3361e8, FUTEX_WAKE, 2147483647) = 0
sigaltstack(NULL, {ss_sp=0, ss_flags=SS_DISABLE, ss_size=0}) = 0
sigaltstack({ss_sp=0x3499e0, ss_flags=0, ss_size=8192}, NULL) = 0
rt_sigaction(SIGSEGV, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGABRT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGFPE, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGILL, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGBUS, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGSEGV, {0x14af0, [ILL ABRT BUS FPE SEGV], SA_STACK|SA_SIGINFO|0x4000000}, NULL, 8) = 0
rt_sigaction(SIGABRT, {0x14af0, [ILL ABRT BUS FPE SEGV], SA_STACK|SA_SIGINFO|0x4000000}, NULL, 8) = 0
rt_sigaction(SIGFPE, {0x14af0, [ILL ABRT BUS FPE SEGV], SA_STACK|SA_SIGINFO|0x4000000}, NULL, 8) = 0
rt_sigaction(SIGILL, {0x14af0, [ILL ABRT BUS FPE SEGV], SA_STACK|SA_SIGINFO|0x4000000}, NULL, 8) = 0
rt_sigaction(SIGBUS, {0x14af0, [ILL ABRT BUS FPE SEGV], SA_STACK|SA_SIGINFO|0x4000000}, NULL, 8) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001f000
write(1, "Alignment error\n", 16Alignment error
) = 16
exit_group(1)

LDD output looks ok:

$ ldd btsync
librt.so.1 => /lib/librt.so.1 (0x4002d000)
libdl.so.2 => /lib/libdl.so.2 (0x4003c000)
libm.so.6 => /lib/libm.so.6 (0x40047000)
libpthread.so.0 => /lib/libpthread.so.0 (0x400f2000)
libc.so.6 => /lib/libc.so.6 (0x40110000)
/lib/ld-linux.so.3 (0x40000000)

Any clue what changed that is preventing the new version to start?

Thanks.

Link to comment
Share on other sites

There are some alignment on ARM that Sync is having troubles with. Basically you need to execute

echo 2 > /proc/cpu/alignment

So Sync will work.

Perfect solution.


$ echo 2 > /proc/cpu/alignment
$ ./btsync --help
BitTorrent Sync 1.1.69

Thank you.

Link to comment
Share on other sites

Hello again.

This solution seems to be only valid for application to start. But after about 10 seconds when it starts the whole NAS will freeze and I have to reboot it. This is my btsync.conf:

{
"device_name": "eTRAYz NAS",
"listening_port" : 0,
"storage_path" : "/home/epkg/share/btsync/.sync",
"pid_file" : "/home/epkg/share/btsync/.sync/btsync.pid",
"check_for_updates" : true,
"use_upnp" : true,
"download_limit" : 0,
"upload_limit" : 0,
"webui" :
{
"listen" : "0.0.0.0:7777",
"login" : "admin",
"password" : "sysadmin"
},
"shared_folders": []
}

And this is how I start the process:

/home/epkg/share/btsync/btsync --config /home/epkg/share/btsync/.sync/sync.conf

I've tried to change the value in /proc/cpu/alignment to 3, 4 or 5 and with all the NAS freezes as soon as btsync process starts.

Any other suggestion?

Link to comment
Share on other sites

The problem with alignment happens only on old ARM CPU types. The echo 2 command, force CPU to overcome alignment errors by means of emulation, so there will be significant performance degradation for the NAS.

Yes it will be fixed, but I can't give you a timeframe for the fix.

Link to comment
Share on other sites

  • 2 months later...

Even after you've executed as root "echo 2 > /proc/cpu/alignment" and run btsync?

 

Are you familiar w/ GNU/Linux systems? Invoking that command should absolutely be _not_ necessary. Ever.

 

It also shouldn't be invoked from inside the application. The application should just work out of the box.

Link to comment
Share on other sites

  • 5 months later...

Can we get an update from the developers when this alignment issue will be fixed for those of us using the affected ARM systems? I really don't like how the performance is degraded on my machine after issuing the command, and it has been a really long time since you identified the issue.

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.