Monday, February 28, 2011

glibc-git and audio_setup

$ glibc
git pull

Starting, for example, mplayer [..] with audio device being busy, results in:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7de7be1 in do_lookup_x () from /lib/
(gdb) bt
#0  0x00007ffff7de7be1 in do_lookup_x () from /lib/
#1  0x00007ffff7de84d2 in _dl_lookup_symbol_x () from /lib/
#2  0x00007fffefb0d035 in ?? () from /lib/
#3  0x00007ffff6151014 in ?? () from /lib/
#4  0x00007ffff7dec736 in _dl_catch_error () from /lib/
#5  0x00007ffff615149c in ?? () from /lib/
#6  0x00007ffff615106a in dlsym () from /lib/
#7  0x00007ffff638c533 in ?? () from /usr/lib/
#8  0x00007ffff638c61d in snd_dlsym () from /usr/lib/
#9  0x00007ffff6387a04 in ?? () from /usr/lib/
#10 0x00007ffff6385cc1 in ?? () from /usr/lib/
#11 0x00007ffff6385d24 in ?? () from /usr/lib/
#12 0x00007ffff6386ed1 in snd_config_expand () from /usr/lib/
#13 0x00007ffff63877df in snd_config_search_definition () from /usr/lib/
#14 0x00007ffff63a306a in ?? () from /usr/lib/
#15 0x00000000004e9843 in ?? ()
#16 0x00000000004e474f in init_best_audio_out ()
#17 0x00000000004d8b6b in reinit_audio_chain ()
#18 0x00000000004da811 in main ()

(even with -ao alsa).

Which is:
 76 static int
 77 __attribute_noinline__
 78 do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
 79          unsigned long int *old_hash, const ElfW(Sym) *ref,
 80          struct sym_val *result, struct r_scope_elem *scope, size_t i,
 81          const struct r_found_version *const version, int flags,
 82          struct link_map *skip, int type_class, struct link_map *undef_map)
 83 {
 84   size_t n = scope->r_nlist;
 85   /* Make sure we read the value before proceeding.  Otherwise we
 86      might use r_list pointing to the initial scope and r_nlist being
 87      the value after a resize.  That is the only path in dl-open.c not
 88      protected by GSCOPE.  A read barrier here might be to expensive.  */
 89   __asm volatile ("" : "+r" (n), "+m" (scope->r_list));
 90   struct link_map **list = scope->r_list;
 92   do
 93     {
 94       /* These variables are used in the nested function.  */
 95       Elf_Symndx symidx;
 96       int num_versions = 0;
 97       const ElfW(Sym) *versioned_sym = NULL;
 99       const struct link_map *map = list[i]->l_real;
 101  [..]

Tuesday, February 22, 2011

btrfs and cp

Chris Mason wrote to linux-btrfs:

"[..] Looks like the latest versions of cp use fiemap to decide if a file is
sparse, which is a great way to avoid doing memcmp, but only if your
fiemap is really accurate about which ranges in the file have holes.

Our fiemap tends to return holes for delalloc bytes, and has a few other
bugs along the way.  The end result is a bunch of zeros instead of good
data when you copy the file. [..]"

patch is available here

Saturday, February 19, 2011

London Stock Exchange

"Within the first 20 seconds of the London Stock Exchange's new matching engine going live on Monday, price data vendors began displaying incorrect prices, blank prices and wrong trading volumes, according to Computerworld UK sources. Thomson Reuters, Interactive Data and Netbuilder are among the largest data vendors, providing share prices to traders, that have been displaying pricing problems on some stocks throughout the week. Even the LSE's own data vendor, ProQuote, experienced problems. Concerns are being raised that there could be mistakenly setup connections or incorrect software interfaces at some of the large data vendors. Alternatively, there may be a data caching issue at the LSE that means data going out is not properly synchronised between different systems."

via Slashdot

Jesus... guys, are you kidding?

Thursday, February 17, 2011

2.6.38-rc5 -- radeon hd 5470

As per phoronix Linux 2.6.38-rc5 Brings Radeon, Intel, EXT4 Fixes

And I finally managed to boot it:
git bisect start '--' 'drivers/gpu/drm/radeon/'
# bad: [e53b2057d8fccc3394cc38463171df948ce43aaa] Merge branch 'master' of git://
git bisect bad e53b2057d8fccc3394cc38463171df948ce43aaa
# good: [87364760de5d631390c478fcbac8db1b926e0adf] drm/radeon/kms: fix s/r issues with bios scratch regs
git bisect good 87364760de5d631390c478fcbac8db1b926e0adf
# good: [4eace7fdfa1f8ac2f0a833e12bd07eeb453ec9ef] drm/radeon/kms: 6xx/7xx big endian fixes
git bisect good 4eace7fdfa1f8ac2f0a833e12bd07eeb453ec9ef
# good: [501834349e872ed4115eea3beef65ca9eeb5528e] drm/radeon/kms: fix tracking of BLENDCNTL, COLOR_CHANNEL_MASK, and GB_Z on r300
git bisect good 501834349e872ed4115eea3beef65ca9eeb5528e
# good: [c2049b3d29f47ed3750226dc51251a3404c85876] drm/radeon/kms: improve 6xx/7xx CS error output
git bisect good c2049b3d29f47ed3750226dc51251a3404c85876
# good: [265aa6c8d8822c9074a2174e8c9f31a37fa02e50] drm/radeon/kms: fix a few more atombios endian issues
git bisect good 265aa6c8d8822c9074a2174e8c9f31a37fa02e50
# good: [a4b40d5d97f5c9ad0b7f4bf2818291ca184bb433] drm/radeon/kms: add bounds checking to avivo pll algo
git bisect good a4b40d5d97f5c9ad0b7f4bf2818291ca184bb433
# bad: [5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff] drm/radeon/kms: hopefully fix pll issues for real (v3)
git bisect bad 5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff

5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff is the first bad commit
commit 5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff
Author: Alex Deucher
Date:   Mon Feb 14 11:43:11 2011 -0500

    drm/radeon/kms: hopefully fix pll issues for real (v3)
    The problematic boards have a recommended reference divider
    to be used when spread spectrum is enabled on the laptop panel.
    Enable the use of the recommended reference divider along with
    the new pll algo.
    v2: testing options
    v3: When using the fixed reference divider with LVDS, prefer
    min m to max p and use fractional feedback dividers.
    MacbookPro issues reported by Justin Mattock

Have to revert `radeon fixes'.

Wednesday, February 9, 2011

Thursday, February 3, 2011

syslog-ng and CAP_SYSLOG. part 2

Gergely Nagy wrote:
Good news!

It looks like this will be dealt with on kernel side: for 2.6.38, CAP_SYS_ADMIN will continue working, later on, a sysctl will be set, which controls whether
we need CAP_SYSLOG or CAP_SYS_ADMIN, and that's reasonably easy to query, and adapt to.
Once the kernel folk figure this out and the patch lands in the kernel, I will prepare a syslog-ng patch that checks the sysctl setting, and acts accordingly.

Tuesday, February 1, 2011

syslog-ng CAP_SYSLOG support

I've contacted syslong-ng developers on CAP_SYSLOG capability in 2.6.38.

> During 2.6.38 development CAP_SYSLOG has been introduced to perform syslog
> operations, older CAP_SYS_ADMIN is not sufficient anymore.
> [..]

Gergely Nagy wrote:
It's a known issue, but no suitable solution (that doesn't break in
interesting ways under pressure) has been found yet.

Since CAP_SYSLOG breaks userspace, I'm hoping that this will be reverted
before the 2.6.38 release. Though, looking at recent lkml traffic, I'll
have to Cc a few more people regarding the issue.

Hope they"ll come up with the fix.

For me worked the following one. No-brainer, just to make it work.
This is obviously wrong, since brakes portability.


diff --git a/modules/affile/affile.c b/modules/affile/affile.c
index e145324..3269c1c 100644
--- a/modules/affile/affile.c
+++ b/modules/affile/affile.c
@@ -60,6 +60,7 @@ affile_open_file(gchar *name, gint flags,
       g_process_cap_modify(CAP_DAC_READ_SEARCH, TRUE);
       g_process_cap_modify(CAP_SYS_ADMIN, TRUE);
+      g_process_cap_modify(CAP_SYSLOG, TRUE);
diff --git a/syslog-ng/main.c b/syslog-ng/main.c
index 9880c1f..6904e6b 100644
--- a/syslog-ng/main.c
+++ b/syslog-ng/main.c
@@ -378,9 +378,11 @@ main(int argc, char *argv[])
   /* NOTE: polling /proc/kmsg requires cap_sys_admin, otherwise it'll always
    * indicate readability. Enabling/disabling cap_sys_admin on every poll
    * invocation seems to be too expensive. So I enable it for now. */

+  /* NOTE: Since commit 38ef4c2e437d11b5922723504b62824e96761459 syslog
+   * operations require new CAP_SYSLOG capability, not CAP_SYS_ADMIN. */
-                     "cap_dac_read_search,cap_dac_override,cap_chown,cap_fowner=p "
+                     "cap_dac_read_search,cap_dac_override,cap_chown,cap_syslog,cap_fowner=p "
   ctx = g_option_context_new("syslog-ng");