Index ¦ Archives ¦ RSS > Category: hacking ¦ RSS

sudo segfault

Estimated read time: 1 minutes

Quoting a mail I just sent to Miller:

,,It seems I hit a bug in sudo-1.7.0 (at least I can't reproduce it with 1.6.9p17):

$ sudo chown vmiklos /etc/sudoers $ sudo false sudo: /etc/sudoers is owned by uid 1003, should be 0 Segmentation fault

According to gdb, it seem to be a nullpointer-dereference bug, and given that it is reproducible only in case the permission and/or owner is wrong, I don't think it has a security impact. But who knows. ;)''

We'll see how does he handle the problem.


less(1) tweaks

Estimated read time: 1 minutes

First, to allow latin{1,2,whatever} accents in the pager to be non-escaped:

export LESSCHARSET="iso8859"

Second, I use:

# F: quit if input is less then one page
# M: no more-like short prompt
# R: accept colors
# X: don't throw away the output after quit under x
export LESS="FMRX"

Finally to send utf8 and other exotic chars in latin2 to stdout in git (OK, this is not strictly related):

git config i18n.logOutputEncoding latin2

Done!

Old:

Author: Andr??s V??r??sk?<91>i <voroskoi@frugalware.org>

New:

Author: András Vörösk?i <voroskoi@frugalware.org>

You can choose... ;-)


Ideal Git CFLAGS for development

Estimated read time: 1 minutes

This is always an interesting area. The avarage user needs a whole day to test a oneliner patch, just because she never built the software in question, etc. The other end of the line is a regular developer, she modifies the source and she is able to test in seconds.

Regarding git, the testing part is not that hard: I usually work on builtins, so I edit the source code, then type 'make git-foo', and run ./tnumber-desc.sh from the testsuite.

The other part is that you need special compiler flags, since you are interested in extra warnings, debug symbols and such.

The default CFLAGS is defined in the Makefile, which is a tracked file, so modifying that is a no-go. You need 'make configure', then ./configure, and then you can edit config.mak.autogen.

Junio a few days ago mentioned the CFLAGS he uses.

Here comes the interesting part:

CC = ccache cc
CFLAGS = -g -O2 -Wall -Werror -fno-inline -Wold-style-definition -Wdeclaration-after-statement

-Werror so that I'm forced not to ignore warnings, -fno-inline to be able to debug inline functions, and I just stole the two others from Junio.


More lilypond adventures

Estimated read time: 1 minutes

To expand my little lilypond knowledge, I just took an old song and tried to re-create in lilypond. Mostly finished, available here.

Now time to find a working printer to see how does it look like on a real paper. :)


W3C's css validator

Estimated read time: 1 minutes

I wasted almost 8 hours with trying to get it working from CVS, no luck so far.

OK, I'm not a Java wizard, but.. most buildtime and runtime errors can be solved by scanning the list archives, but finally the Apache template engine it uses really can't initialize itself.

I started to debug it, but working with CVS is really a pain, so I want to set up a git mirror first, then hopefully I can send my results till now to the w3c css list, and ask for help.

Sigh. Java is still a pain.


Lilypond and guitar chord arpeggios

Estimated read time: 1 minutes

Of course I have no idea if this is the right name of this stuff, to make long story short, I finally found a workaround to display this beast in lilypond. Yay!

This project is really addictive, you can spend a whole day reading its documentation and you still just say "wow, this and even that is possible with this stufff". ;-)


oprofile

Estimated read time: 2 minutes

I did not have to work with a profiling tool for C so far, so here is my first experience.

The kernel has to have oprofile support (the kernel in Frugalware-current does not have it, I'll add it after 1.0pre2). You'll need a kernel vmlinux file if you want to benchmark the syscalls as well (I did not need this one).

Then there are 3 levels of starting: opcontrol --init/--deinit, --start-daemon/--shutdown and --start/--stop. The first one prepares /dev/profile, the second one starts the deamon, finally the third one start profiling. Obviously the second part does the opposite.

Once you did a --stop, you can get the results. Example output:

$ opreport -l /home/vmiklos/git/git/git /usr/lib/libz.so.1|head
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples  %        app name                 symbol name
22823    56.4898  libz.so.1.2.3            inflate_fast
6019     14.8978  libz.so.1.2.3            adler32
5975     14.7889  libz.so.1.2.3            inflate
4233     10.4772  libz.so.1.2.3            inflate_table
456       1.1287  libz.so.1.2.3            crc32
252       0.6237  git                      patch_delta
55        0.1361  git                      use_pack

which is pretty much what I expected - I did a 'git verify-pack' between --start/--stop, so the time spent with reading the compressed git object database.

TBH I miss a strace/sudo-like simple wrapper as well...


Preparing Frugalware 1.0pre2

Estimated read time: 1 minutes

From today it's "freeze" till 13th. Pootle is funny again, it forces converting the po files to UTF-8, while _not_ converting the headers, so they still say latin2 in case of Hungarian translations, grr.

A guy mailed me for help with my libwpd bindings, but it turned out he wants to use the C# part, so Fridrich just solved his problem in CVS.


Working on merge_trees_simple()

Estimated read time: 2 minutes

I just pushed out these four commits. Basically they let a libgit user use the functionality which was hardwired to git-merge-tree till now. The idea is from Dscho, so I hope the patches will be welcomed. ;-)

(I did not sent out any patches for now, since my ls-files parseopt patch isn't in yet, either.)

Ah and we talked about (in case I'll be home during the summer) if I should re-apply for git in GSoC. Basically I don't want to do it, but I'm very happy that my ex-mentor even recommends me not doing so. Here are his lines:

> About reapplying for Git... I would _love_ to have you again, since I know > you will get stuff done, and in a very nice way. > > There is always a but. > > But. Realistically, I think that you learnt so many things in the GSoC > project last year, that you do not really have all that much left which > you could learn in the Git community. You really just would be a work > horse. > > There are other projects out there who do fantastic and exciting things, > and have completely different personal (and political!) environments. > > So while the Git community member says "keep him!", the mentor in me says > "let him go!" albeit with half a sad eye. > > Therefore I am strong and point you to http://code.google.com/soc/2008; I > even met some of the guys at the mentor summit, and they are all pretty > cool.

These lines made me happy, really. :-)


Playing with lilypond

Estimated read time: 1 minutes

So lilypond is a really geek-friendly project to produce music notation from text-based files. It has its own cryptic language. I spent a half day playing with it, so I'm not an expert at all, but I achieved something. ;-)

The example song I wanted to describe is the cantina band from starwars.

To make the long story short, here is the asciidoc source, the Makefile, and the result.

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.