- Debugger: Getting mixed signals
- 'Packaging Infrastructure' Contract Weekly Report #4
- Haiku monthly activity report - 06/2015
- 'Packaging Infrastructure' Contract Weekly Report #3
- 'Packaging Infrastructure' Contract Weekly Report #2
- GCI 2014 winners trip report (mentor side)
- TeX Live and LyX; Changes to the boot code
- 'Packaging Infrastructure' Contract Weekly Report #1
- Beginning of 'Packaging Infrastructure' Contract
- Haiku monthly activity report - 05/2015
Contract weekly report #52 - On to beta1!
Hi,
This week I continued work on moving Beta1 forward, fixing some important and less important bugs. To make things clear about what to expect in the upcoming weeks, I will spend more time on Beta1 tasks, but I'll also continue working on WebKit. However, my work there will focus on fixing bugs, rather than adding new features.
So, this week I continued reviewing the beta1 and R1 tickets. There were still some low hanging fruits that I solved last friday and during the weekend. I fixed the docbook toolchain we still use to build the Haiku Interface Guidelines. This was broken for a long time because it uses an old copy of libxml in the Haiku tree. What I did is merging a patch there to make it work with a current zlib, so things work again. We should probably get rid of the whole thing and require people willing to build the documentation to install docbook on their system - which is easy now, even on Haiku as I did packages for that. It would be nice to see some activity on updating the HIG again. It's getting old and we have changed our rules a bit over time to accomodate for larger and higher resolution displays, and modernize the UI a bit. We have also drifted away from BeOS in some subtle aspects. And the HIG could be made more easily browsable and styled to the Haiku theme like the user guide or API docs are. For the record an HTML version is online here: http://api.haiku-os.org/HIG/
I updated the Mesa package to fix a BeOS compatibility issue. libGL was not linked to libbe, and when running old BeOS apps you would often get an error that 'be_bold_font' could not be found. Puckipedia did all thehard work on investigating the problem during BeGeistert, all I had to do was fix and rebuild the Mesa package. It is for example possible to run Pixel on Haiku now.
I also fixed various other small issues, such as a localization problem in AboutSystem, getting the "enable on startup" checkbox in Notifications to work, improving the selection/zoom algorithm in Mandelbrot to be easier to use, fixed several drawing glitches in the MAcDecorator, fixed the build of the bluetooth stack, updated VL-Gothic fonts to the current version.
During the weekend and some evenings as well (so this isn't counted in my contract time) I helped miqlas get Homeworld running on Haiku. This appears to be a rather nice game from 1999 which is now open source. There were two problems, one was a broken libsdl_x86 package that led to the game rendering in a 32x48 pixels area in a corner of its window, and the other being a compilation flag used in Homeworld leading to structure padding problems and a crash.
Finally, I did some embedded development this week with an STM32 development board, and this led to the upload of an STM32flash package, as well as adding some scripting support to SerialConnect so it can be used in collaboration with stm32flash. Nothing really useful to the general public here.
So, that was a busy week-end. Unfortunately the week wasn't as productive, but here is a list of things I spent my contract time on this week:
- Terminal now accepts the % character as a part of URLs when using the command+click feature. This was annoying me a lot when trying to access the Trac URLs I got in my mailbox (I'm reading mails with mutt in Terminal). While I was working on Terminal, I also reviewed the way settings work there, and moved all the persistent settings to the settings window. There are still some available for quick-access in the settings menu, but they are not saved to disk anymore. the settings window also now has the standard Defaults/Revert buttons instead of the previous MS-Windows-like OK/Cancel. Finally, Terminal will now make sure its windows open inside the screen, which wouldn't work before if you had changed resolution to a lower one. I also made a small cosmetic fix to the teminal tab bar.
- The network preferences received some fixes as well. "/dev/net/" is removed from the interface names to make things less verbose, and switching betweeh the Interfaces and Services tabs now works as expected. There are still some known bugs with this preferences panel and I'll get back to it.
- I improved the PackageInstaller (this is the app to install BeOS PKG files) to handle some more relocated directories. We rewrite scripts used by PKG files on the fly to make them put things in the correct non-packaged directories. Some cases were missed previously and are now handled, so more packages should install.
- I fixed a small issue in the bfs tools where they would crash if given a path that can't be resolved to a device, for example when running "bfs_info /". No harm was done but now you get a better error message in that case.
- OpenSSH was updated to a more recent version. The main change is this fixes the script that generates ssh keys on first boot.
DiskProbe user interface was rewritten to use the Layout Kit. This fixed a bug, and introduced another UI glitch, which I'll fix later today.
And finally for the last 3 days I started work on some long-standing issues in our CD code. We have several tickets reporting that ripping audio CDs will often crash the system in many unpredictable ways. There seem to be a problem in the CDDA file system. I tried to have a look at this, but I discovered more issues than I solved.
The first audio CD I inserted immediately triggered a KDL. After enabling some tracing options in the CDDA and CD session code I found this to be because there was an invalid session description on the CD. This seems to be done on purpose as a copy protection scheme. Haiku would think there is a partition starting at sector -1 on the CD, which by itself is fine, except that trying to read sector -1 will always fail. And it did, when Haiku started to identify the content of that partition.
So, I fixed this first issue and I could finally read my CD. But the bug reports were right, after copying some CDs I could esily trigger KDLs in various apparently random places. There is probably a memory corruption problem happening here, with the CDDA code accessing memory it's not supposed to, and changing things in memory, leading to crashes in unrelated parts of the system. This means it's hard to see exactly what happened from the kernel debugger.
So, I did a quick code review of the CDDA code. I fixed issues pointed by coverity, but these were unlikely to have any harmful consequences. I also found a case where CDDA would overrun a buffer, which I fixed. But I still could trigger the panics after that, so what I fixed was not the thing causing all our problems.
While investigating problems in the kernel debugger I made use of the dis (disassemble) command. This was introduced in 2008 and allows to disassemble the code in memory to look at it in a more readable form. However it did not do any symol lookup, and would print addresses as hex values. You'd then have to use the ls (lookup symbol) command to find what's at the address. This works but gets boring very quickly. So I updated our copy of udis86 - the library we use for disassembling code - , and used the new feature in the current version to perform symbol lookup directly. Now the dis command shows the symbol directly, making the assembler code more readable and easier to correlate to the corresponding C or C++ source code. It's easier to keep track of things, at least.
Next I tried enabling the guarded heap. The guarded heap is an "extreme" debugging tool, it will allocate memory so any out of bounds access is immediately detected and triggers a panic. This is similar to the allocator used for userland in libroot_debug. However, the fact that it runs in kernel land needs a different implementation. Well, the guarded heap code has not been used for a while, so first of all I had to get it building again. I then trying booting Haiku with it, and I was greeted with an "Out of memory!" panic. The guarded heap is implemented in a way that wastes a lot of memory (it allocates a whole 4K page even for the smallest allocations (1 or even 0 bytes) and also wastes a lot of addres space (each of the allocated pages is followed by a 4K memory hole, which allows to catch the out of bounds accesses). It used to be possible to boot haiku in those conditions, but the package manager needs more kernel memory, so this doesn't work anymore. There is a way out, however: I will try this with a 64-bit system, where the address space is much bigger and shouldn't run out as fast. I hope this will boot far enough to test the CDDA code with the guarded heap. If that also fails, I will have to get CDDA running in userland_fs so I can test it in userland side with libroot_debug, without having to use the guarded heap. And even after all this, I don't know if I will be able to catch the issue, because the corruption may as well happen on stack memory, rather than on the heap. Well, running with the Guarded heap may uncover issues in other parts of the kernel code anyway, so it's always worth a try.
While testing this I also discovered more problems. Some of my audio CDs have an extra data track, with bonus materials (video clips, for example). The ISO9660 filesystem will manage to mount those, but then any attempt to access the files (just doing ls or opening the volume in Tracker) will hit KDL again. It turns out our handling of this format isn't quite right yet, and there is a mixup in the handling of sector numbers. The ISO9660 filesystem uses offsets relative to the start of the disk, but we interpret them relative to the start of the session. We don't run into problems with standard single-session discs, but in multi-session ones we try to read sectors far after the end of the disc, which of course fails.
I wanted to do more testing of mixed audio/data CDs, and I tried to read some old game CDs which had the data track first, followed by the audio ones. While we have some code to handle this, I couldn't get it to work, and only the audio tracks are visible in Haiku. I haven't researched that part deeper, yet, but it's now also on my list of things to fix for proper CD handling.
So, these investigations in the CD code didnt lead to a fix yet, and uncovered some new problems. That's still progress, but it doesn't really get our Beta1 any closer.
Plans for next week include investigating the remaining problems in MediaConverter, so it doesn't truncate the end of audio files when converting them, and maybe trying to get it playing well with the ffmpeg ogg encoder again so we can enable that in the release. This has been broken for a long while and it's even hard to tell when exactly it stopped working. But it would be great to get it fixed, still.
- PulkoMandy's blog
- Login or register to post comments

Comments
Re: Contract weekly report #52 - On to beta1!
I appreciate all the work you have put into Haiku these past months. There have been some steps forward, but also some backward steps which still makes Alpha 4.1 the better choice for day to day usage.
What is the most important thing an end user (not programmer) can do to help make Haiku better? What testing is most crucial now (hardware, old BeOS apps, new features, etc.)?
Re: Contract weekly report #52 - On to beta1!
What, as an Haiku user, is important to you? Just test that, and let us know if you hit any problem. If all your own issues are solved, then try to think about what new Haiku users would want to try when they run Haiku for the first time. This probably includes running it in a virtual machine first, then on real hardware, and then trying to install and use apps, both from BeOS and more recent ones. I'm a developer so I know my view on this is biased, as a non-developer user you know better than me. Tell me what's wrong and I'll do my best to fix it.
You say there are some steps backwards since alpha4.1, which are those? (bonus points for link to tickets on dev.haiku-os.org). This is something I'll try to avoid as much as possible.
Don't hesitate to open "enhancement" tickets even for things that aren't really bugs. If you watch the bugtracker closely you'll see there is now an R2 milestone. We can use this to store some tickets for "crazy ideas" for the future. And we can also do usability improvements in several other places (improving the documentation, and making the user interface more obvious and easy to grasp, for example). These things also deserve tickets.
Re: Contract weekly report #52 - On to beta1!
One thing that would make Haiku much easier to use in a KVM would be to synchronize the host mouse with the virt mouse.
When I run Haiku in a KVM on Debian Wheezy, I use vncviewer to access the console; it's much more stable and predictable than the standard method. When vncviewer is full screen and Haiku console resolution matches the monitor, mouse (cursor) operation is just peachy. But when console resolution is less than the monitor's, the host and guest cursors rarely align whether vncviewer is full screen or not. And if I don't get Haiku's mouse acceleration set *just right*, the cursors won't stay aligned.
I don't know if it can be fixed. I know modern versions of Winders have an option to keep the mouse synched with the host.
Re: Contract weekly report #52 - On to beta1!
Re: Contract weekly report #52 - On to beta1!
If you need audio CDs with data tracks, I can give you an ISO of a CD of mine. It has 7 tracks plus a data track, containing an SMS guide and weblinks to stay "up to date" (but the CD is from 2002 so that's not really up to date) to Belgian festivals, a screensaver with an interactive festival countdown and wallpapers. If you want the ISO, please respond, I am willing to cooperate!
Re: Contract weekly report #52 - On to beta1!
Re: Contract weekly report #52 - On to beta1!
I have just tried to rip the disc to ISO but that didn't work. And I read on the Internet that it's very hard to rip audio CDs to ISO. But it's for sale for very cheap at http://www.discogs.com/Various-Maes-Festival-2002/release/621768
Re: Contract weekly report #52 - On to beta1!
There is also cloneCD which uses a diffrent method.
http://www.slysoft.com/en/clonecd.html
Re: Contract weekly report #52 - On to beta1!
Will try that today on my parent's Windoze laptop
Re: Contract weekly report #52 - On to beta1!
Re: Contract weekly report #52 - On to beta1!
If you have a UNIX or Linux machine available, you can use the dd command "dd if=/dev/cdrom of=/tmp/cd.iso" to do a bit-for-bit copy of the CD to a file.
Re: Contract weekly report #52 - On to beta1!
That was the first solution that came in my mind to the question "how to rip a CD to ISO", but I got an input/output error.
Any other suggestions for Linux?
Re: Contract weekly report #52 - On to beta1!
Double-check the path to your CD device. It might be named something differently than /dev/cdrom.
Also, "input-output" error can occur if the output device is has become full during the operation.
Re: Contract weekly report #52 - On to beta1!
I've tried /dev/cdrom, /dev/sr0 and (with my other CD drive) /dev/sr1. The output file was just my harddisk. Even
does not work so it's not that I don't have enough disk space.
I will ask my teacher today if he can rip the CD to an ISO on his Windoze laptop or iMac.
Re: Contract weekly report #52 - On to beta1!
Re: Contract weekly report #52 - On to beta1!
I can't check the CD now because I lend ir to my teacher this weekend. But if I have it back, I will check out CloneCD
Re: Contract weekly report #52 - On to beta1!
Interessant adventures!
Read this blog once time per week makes me (and the whole community) very proud of our OS.
Thank you
Re: Contract weekly report #52 - On to beta1!
I believe virtualbox uses a tablet input instead of a mouse... that way you don't have to "grab" the mouse inside the VM....
Re: Contract weekly report #52 - On to beta1!
Duplicate results on the CD front:
Two that I tried were:
Towa Tei Sound Museum: has a data track at the end of the disc.
Quake III: Data track at the beginning, then NiN music after.
Hope that helps... I can send them to you from the USA if you need... just make sure they get back to me
Re: Contract weekly report #52 - On to beta1!
i suggest a function to mark the tabs priority softly on webpositive, and a way to group on contexts. I use at less 20 tabs on my browser all time and believe that tabs should have many ways to manage, i know you have so much work there but if you find this idea good can remember that when you get some of time.
will be cool if the webpositive get a station where it can innovate the browser technology is hard i know but i belive.
32 Bit Guarded heap
Could you change the guarded heap to only guard allocations in only a certain size range. For example most bound problems will occur arrays rather that variables or structs.
So if you only guarded allocations for 4K and larger maybe Haiku will boot then. Then you could fix any array out of bounds errors found. Then you can do the opposite and test for allocations below 4K.
Just a suggestion as I am still working at getting an understanding of the 64 bit system.
Earl Colby Pottinger