It is my wife’s birthday today!
Happy Birthday Rebecca!
It is my wife’s birthday today!
Happy Birthday Rebecca!
Whether you uninstalled Eclipse and reinstalled it or you install it the first time, you may run into an issue where you try to start Eclipse and it tells you that it can’t…. go look in the .eclipse/…./
One such cause is the dreaded ‘SWTError’ error message, buried in the log file. How to see if you’re running into this problem? Open the log file in your favorite text editor and search for ‘SWTError’. If you see something like:
Root exception: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
It is quite likely that your libswt* files aren’t being picked up by Eclipse. Use rpm, apt-get, emerge or whatever you normally use to install software to reinstall libswt3.2-gtk-java and libswt3.2-gtk-jini. That should allow you to start Eclipse or at least get past the SWT error.
I posted the following on the Democracy Player forums:
I’ve been using Democracy Player for several months now and will be writing up a review of it but I have a few questions. There didn’t seem to be much on the www.getdemocracy.com website as to the design of the application.
- DP makes use of a custom binary database instead of a text based database (XML, ini, etc) or an embedded database (SQLite, etc). Was there a specific reason for the custom database?
- Currently, the database is platform and bit (32 or 64) specific. Are there active efforts to make the database cross platform and 32bit/64bit-ness?
- I performed some scalability testing this past weekend. DP remains responsive and ‘zippy’ when the number of new videos is below 400 and the total videos is below 600. From the forum posts, this seems to be a long standing issue. I’ve identified, on my system anyways, that DP gets stuck in a couple areas:
- Database lookups do not appear to be cached well so we end up scanning it over and over
- All the videos are stored in a single directory, causing excessive disk i/o
- Unless I’m mistaken, DP makes use of the gecko engine in the Mozilla project as an embedded web browser for the video channels. With known memory leakage issues with the gecko engine, is the current design plan to stick with the gecko engine or are other engines being evaluated?
thanks
Jason L. Froebe
On Linux, have you ever tried to load a database from backups with dozens of stripes and it failed even though you increased the resources on the backup server? Well, I recently ran into it while trying to load a 1TB database from over 100 stripe files.
Backup Server: 1.72.1.17: Bitmap routine called by function AT_ISSTRIPELDED returned -1
Backup Server: 1.72.1.18: Bitmap routine called by function AT_ISSTRIPELDED returned -1
This turns out to be a new bug with the Sybase Backupserver (both 12.5x and 15.0x codelines): CR 466497. If you run into this bug, please open a case with Sybase TechSupport and have your ticket associated with this bug.
WORKAROUND: Unfortunately, you will need to backup your database(s) with 32 stripes or less.
Every once in a while, I’m going to try to highlight an individual that stands out from the rest. Earlier today I was fortunate enough to be able to sit down, virtually, with Perl developer, Nicola Worthington….
Nicola, you are well known for your multiple Perl modules in the CPAN (http://search.cpan.org/~nicolaw) registry. What led you to create and maintain these modules? Is there a story behind them?
Most of my modules have come about from personal projects that I’ve worked on. Whenever I copy and paste some code more than a couple of times, I tend to ask myself if it would be better abstracted in to a module and whether other people might find it usefu
l too.Probably the best example of that is RRD::Simple. I wanted to graph things using RRD, but found the interface quite confusing. It took me days reading the RRD manual to figure out how to use it. After that I never ever wanted to have to read that manual again. Hence RRD::Simple was born, with (what I hope is) an interface a complete Perl newbie could understand.
My first CPAN module was WWW::Dilbert. I guess that one speaks for itself. Who wants to have to go to someone else’s website to read their favorite daily comic when it could be right there on your own local homepage?
![]()
What started you on the path of a programmer/developer? Was there a pivotal point when you decided or was there no question at all?
I can’t think of one particular moment when I knew I wanted to be a programmer, although I was pretty sure I wanted to play^H^H^H^Hwork with computers ever since I left school. They were an aspect of life that I could totally control. That was comforting.
Why Perl? Why not Python or Java?
Mine is probably a similar story to many other Perl programmers. When the internet came along I started working on personal web pages. I got bored with what plain old HTML could do on its own, and wanted to add some interaction and automation with what I was doing. I downloaded *shudder* some scripts from Matts Script Archive and started hacking away when they wouldn’t do what I wanted. Had Python or Java been the language of the interweb back then, then no doubt I wouldn’t be writing in Perl today.
You can see some of my first (reworked but still rather shoddy) work from those days here: https://svn.perlgirl.org.uk/dav/gallery/
Have you faced any hurdles in the Perl or Linux communities because you are a woman?
Not that I can think of. I have professionally, but I guess that still goes with the territory. I think women are still somewhat of a novelty and distraction for the men in on-line technical communities.
Can you tell us a little about your professional work life?
My last job was auditing customers code before it was allowed on their (very large and well known international website). That was an interesting job, but once you’ve seen the same error again and again from the same programmer, it begins to wear you down a little.
At the moment I fix and automate broken things. I may not always be hired for that purpose, but I can’t stand working in any environment where there’s unnecessary manual processes where a well placed script would save hours of work. I crave routine and order, and put things right so I get it.
My last job was auditing customers’ code before it was allowed on their (very large and well known international) website.
Recently you’ve started picking up the C++ language. What do you think of it?
It’s like writing an essay with a pen after you’ve gotten used to typing. You can’t use CPAN with it.
![]()
What do you do when you’re not coding?
I’m a sucker for finding a TV series that I like (that’s finished) and then watching every episode, several per night, until I need to find the next series. My last few TV series were Stargate, West Wing and Goodnight Sweetheart. I’m currently just starting season 5 of the X Files and looking forward to the movie before starting season 6.
Oh, sleeping is always good. Can’t get enough of that!
What’s your biggest pet peeve when reading someone else’s Perl code?
That’s a difficult question. It would have to be either not using strict and warnings, or not properly checking results of system calls. Unfortunately I see both far too often during my professional life. I can almost forgive it when the author isn’t a programmer by trade,.. but when they’re an experienced programmer, regardless of what their native language is, I just despair.
What’s on your radar? Specifically, are there new projects you are, or about to, start on that you would like to share with us?
There’s nothing new coming up that I’m planning for. I do however have a long backlog of patches and improvements. My backlog is currently in a bit of a sorry state, not least the Sys::Filesystem module which I’m somewhat ashamed of for my lack of attention to maintaining it.
For those of us that use your Perl modules, how can we express our gratitude?
Tell me what you do or don’t like about my software. Suggest enhancements and report bugs (it’s nice to know that people want to use my software and want to help make it better). If you’re feeling especially generous, buy me something from my Amazon wish list.
![]()
Nicola, aka Neechi - a Perl Girl, lives in London and has written many perl modules for CPAN. Not only is she a fellow geek, she is highly intelligent and motivated. Along with her multiple linux servers at home, she can also boast having a Network Attached Storage (NAS) device - think big harddrive - that I’m very envious of.
Sorry, guys! She’s taken.
On the web page http://www.eclipse.org/mylar/start.php
Webinar: Task-Focused Programming with Mylar by Mik Kersten (56 min, Oct 2006)
5-15 min: task management demo
15-30 min: task context demo
34-40 min: technology & frameworks
The adobe link is http://adobedev.adobe.acrobat.com/p46246963
What happens is that that the web page comes up (flash) showing:
Adobe Acrobat Connect Professional: Connecting…
The status bar on the firefox is showing “Read admin.abobe.acrobat.com”.
This is occurring on Linux (Firefox 32bit), Windows XP SP2 IE 6 and 7 - latest flash player on both platforms.
I’m suspecting that either the webinar is no longer available or that the video server is unavailable for some reason.
I’ve opened a ticket with Adobe to investigate the matter.
UPDATE: The problem now only occurs with flash on the Linux platform. It works fine on MacOSX.
I’ve written a C program that creates a 20GB file using O_DIRECT and O_ASYNC correctly. The trick to write to a file using O_DIRECT is that I have to align the buffer with respect to the memory block size.
When I write a similar program using Perl, I receive the expected “System write error: Invalid argument” as the buffer is not aligned.
So, my question is: Is it possible, in Perl, to align the buffer?
use strict;
use warnings;
$|++;
use Fcntl qw(:DEFAULT O_ASYNC O_DIRECT);
my $FH;
sysopen($FH, "./test.dat", O_WRONLY | O_TRUNC | O_CREAT | O_ASYNC | O_
+DIRECT, 0666);
my $BUFFER = "0"x1048576;
my $BUFSIZE = 1048576;
for (my $i = 0; $i < 20480; $i++) {
my $written = syswrite($FH, $BUFFER, $BUFSIZE);
die "System write error: $!\\n" unless defined $written;
}
Don’t forget Mother’s Day! It’s this Sunday so get her some sock yarn.
Update: sgifford over at Perlmonks.org, gave me the answer. Just mmap() the buffer using Sys::Mmap
use strict;
use warnings;
$|++;
use Fcntl qw(:DEFAULT O_ASYNC O_DIRECT);
use Sys::Mmap;
my $FH;
sysopen($FH, "./test.dat", O_WRONLY | O_TRUNC | O_CREAT | O_ASYNC | O_DIRECT, 0666);
my $BUFSIZE = 1048576;
my $BUFFER;
mmap($BUFFER, $BUFSIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, STDOUT) or die "Couldn’t mmap\\n";
for (my $i = 0; $i < 20480; $i++) {
my $written = syswrite($FH, $BUFFER, $BUFSIZE);
die "System write error: $!\\n" unless defined $written;
}
If she knits, buy her some really good sock yarn. Believe me, she will be wildly grateful that you spent the time to buy her the ‘good stuff’!
I’m trying to create a file using O_DIRECT (direct I/O) but am running into a problem.
If I run it as a normal user (me) I get error number 22 (invalid argument):
jfroebe@jfroebe-laptop:~/build$ ./dio bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument bytes_read= 4096 write failed: Invalid argument jfroebe@jfroebe-laptop:~/build$ jfroebe@jfroebe-laptop:~/build$ ls -l test.dat -rw-r--r-- 1 jfroebe jfroebe 0 2007-05-10 15:22 test.dat
I understand that the data being written has to be aligned properly, which I believe I’m doing, but should it work when I run it as root?
jfroebe@jfroebe-laptop:~/build$ sudo ./dio Password: bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 bytes_read= 4096 bytes_written = 4096 jfroebe@jfroebe-laptop:~/build$ jfroebe@jfroebe-laptop:~/build$ ls -l test.dat -rw-r--r-- 1 jfroebe jfroebe 40960 2007-05-10 15:18 test.dat
The program in question:
#define _GNU_SOURCE
#define __USE_GNU
#include <fcntl .h>
int main(int argc, char **argv)
{
int test_fd;
int input_fd;
int bytes_read;
int bytes_written;
int nbytes;
int i;
int bufsize = getpagesize();
unsigned char buf[bufsize] __attribute__((aligned(4096))); // mem page size is 4096 bytes
input_fd = open("/dev/zero", O_RDONLY);
test_fd = open("/home/jfroebe/build/test.dat", O_CREAT|O_WRONLY|O_DIRECT, 0666);
//test_fd = open("/home/jfroebe/build/test.dat", O_CREAT|O_WRONLY|O_ASYNC, 0666);
//test_fd = open("/home/jfroebe/build/test.dat", O_CREAT|O_WRONLY|O_ASYNC|O_DIRECT, 0666);
if (test_fd < 0) {
printf("couldn’t open /home/jfroebe/build/test.dat\n");
exit(1);
}
for (i=0; i < 10; i++) {
bytes_read = read(input_fd, buf, bufsize);
bytes_written = write(test_fd, buf, bufsize);
printf("bytes_read= %d\n", bytes_read);
if (errno == 0) {
printf("bytes_written = %d\n", bytes_written);
} else {
fprintf(stderr, "write failed: %s\n", strerror(errno));
}
}
return 0;
}
UPDATE: Figured it out! I needed to allocate the memory with malloc() and do a little magic. FYI: the alignment is NOT necessary if and only if you are a superuser (root).
#define _GNU_SOURCE
#define __USE_GNU
#define BUFFER_SIZE 1048576
#include <fcntl .h>
int main(int argc, char **argv)
{
int test_fd;
int input_fd;
int bytes_read;
int bytes_written;
int nbytes;
int i;
int pagesize = getpagesize();
char *realbuff = malloc(BUFFER_SIZE + pagesize);
char *alignedbuff = ((( (int unsigned)realbuff + pagesize - 1) / pagesize) * pagesize);
input_fd = open("/dev/zero", O_RDONLY);
test_fd = open("/home/jfroebe/build/test.dat", O_CREAT|O_WRONLY|O_DIRECT, 0666);
if (test_fd < 0) {
printf("couldn’t open /home/jfroebe/build/test.dat\n");
exit(1);
}
for (i=0; i < 10; i++) {
bytes_read = read(input_fd, alignedbuff, BUFFER_SIZE);
bytes_written = write(test_fd, alignedbuff, BUFFER_SIZE);
printf("bytes_read= %d\n", bytes_read);
if (errno == 0) {
printf("bytes_written = %d\n", bytes_written);
} else {
fprintf(stderr, "write failed (err %d): %s\n", errno, strerror(errno));
}
}
return 0;
}
Say you have a query that easily fills up the transaction log of the Sybase ASE server / Microsoft SQL Server:
How would you break up the transaction so it doesn’t fill up the log? There are several ways to do it, but I’ll just cover two of them:
SELECT @rows_affected = 1
WHILE @rows_affected > 0
BEGIN
DELETE FROM rep_queues_archive WHERE sample_date < DATEADD(wk, -1, GETDATE())
SELECT @rows_affected = @@ROWCOUNT
IF @@ERROR = 0
BEGIN
COMMIT TRAN
DUMP TRAN @dbName WITH TRUNCATE ONLY
END
ELSE
ROLLBACK TRAN
END
SET rowcount 0
Of course, if you are performing incremental backups, you will want to modify the dump tran @dbName with truncate only line to read something like dump tran @dbName to “/sybdumps/mydb_tran.dmp”. Modify to suit your naming standard.
If you’re having trouble creating a device file on Linux while using direct io, you’re not alone:
1> disk init name = data01, physname = "/dbms/sybase/data/data01.dat", size = "20G", dsync = false, directio = true 2> go 03:00000:00041:2007/05/04 21:20:20.21 kernel Initializing virtual device 4, '/dbms/sybase/data/data01.dat' with dsync 'off'. 03:00000:00041:2007/05/04 21:20:20.21 kernel Virtual device 4 started using asynchronous (with O_DIRECT) i/o. 03:00000:00041:2007/05/04 21:20:20.21 kernel Initializing device /dbms/sybase/data/data01.dat from offset 0 with zeros. 00:00000:00000:2007/05/04 21:21:59.76 kernel engine 1, os pid 28232 exited 00:00000:00000:2007/05/04 21:22:09.85 kernel Process 28232 exited with status 0 00:00000:00000:2007/05/04 21:22:09.85 kernel Engine exited from scheduler, lastkpid b000b 00:00000:00000:2007/05/04 21:22:09.85 kernel Engine exited with signal 9 00:00000:00000:2007/05/04 21:22:09.94 kernel engine 3, os pid 28234 exited 00:00000:00000:2007/05/04 21:22:09.94 kernel Process 28234 exited with status 0 00:00000:00000:2007/05/04 21:22:09.94 kernel Task with kpid 260026 running on failed engine 00:00000:00000:2007/05/04 21:22:09.94 kernel Engine exited with signal 9 02:00000:00000:2007/05/04 21:22:15.50 kernel kesetown: engine 1 not online 02:00000:00000:2007/05/04 21:22:15.50 kernel kesetown: engine 3 not online 02:00000:00020:2007/05/04 21:22:17.63 server Restarted process 'HK GC'. 00:00000:00000:2007/05/04 21:22:17.63 kernel kpenginedied: killed kpid 655370 which was affinitied to engine 3 00:00000:00000:2007/05/04 21:22:17.63 kernel kpenginedied: killed kpid 1703962 which was affinitied to engine 3 00:00000:00000:2007/05/04 21:22:17.63 kernel kpenginedied: killed kpid 1769499 which was affinitied to engine 3 00:00000:00000:2007/05/04 21:22:17.63 kernel kpenginedied: killed kpid 1835036 which was affinitied to engine 3 00:00000:00000:2007/05/04 21:22:17.63 kernel kpenginedied: killed kpid 2031647 which was affinitied to engine 3 00:00000:00000:2007/05/04 21:22:17.63 kernel kpenginedied: killed kpid 2162721 which was affinitied to engine 3
The odd thing is that 17GB device files work fine but 17.5 GB and larger device files fail on the disk init. Even stranger, the device is created (for device file sizes 17.5GB < -> 20GB - any larger and the device isn’t available on restart) but you need to restart ASE for it to be available.
Workaround:
Create device file without direct i/o and then use sp_deviceattr to add the direct i/o flag. Note you will still need to restart for ASE to open the device files with direct i/o.
I have an open case with Sybase so we will have a CR (bug) filed shortly.
I’m running into this on Red Hat Enterprise Linux AS release 4 (Nahant Update 5). I haven’t attempted this on any of the other distros.
UPDATE: This appears to be specific to RHEL 4 release 4 update 5. Sybase is having trouble reproducing it but I can reproduce it on two machines. Go figure. I’ll provide more updates as we make progress.
UPDATE: I created a C program that creates a 20GB file using O_DIRECT & O_ASYNC with no problems. I’m suspecting that ASE is doing something funky with the kernel threads that might be causing this problem.
If you’re getting error messages similar to:
01:00000:00000:2007/05/04 19:09:10.28 kernel os_attach_region: shmat(425984): Invalid argument 01:00000:00000:2007/05/04 19:09:10.28 kernel kbattach: couldn't attach to Kernel region 01:00000:00000:2007/05/04 19:09:10.28 kernel kestartup: couldn't attach to shared memory: -ONLINE:1,0,0xf500c2b8, 0x413ea000, 0x76c00000, 0x1159 00:00000:00000:2007/05/04 19:09:10.28 kernel engine 1, os pid 27586 exited 00:00000:00000:2007/05/04 19:09:10.28 kernel Process 27586 exited with status 1 00:00000:00000:2007/05/04 19:09:10.28 kernel Task with kpid 0 running on failed engine 01:00000:00000:2007/05/04 19:09:10.29 kernel os_attach_region: shmat(425984): Invalid argument 01:00000:00000:2007/05/04 19:09:10.29 kernel kbattach: couldn't attach to Kernel region 01:00000:00000:2007/05/04 19:09:10.29 kernel kestartup: couldn't attach to shared memory: -ONLINE:1,0,0xf500c2b8, 0x413ea000, 0x76c00000, 0x1159 00:00000:00000:2007/05/04 19:09:10.29 kernel engine 1, os pid 27587 exited 00:00000:00000:2007/05/04 19:09:10.29 kernel Process 27587 exited with status 1 00:00000:00000:2007/05/04 19:09:10.29 kernel Task with kpid 0 running on failed engine 00:00000:00009:2007/05/04 19:09:10.29 kernel A listener with protocol tcp, host dba-prodsupport1, port 5000, engine 1 already exists. 01:00000:00000:2007/05/04 19:09:10.30 kernel os_attach_region: shmat(425984): Invalid argument 01:00000:00000:2007/05/04 19:09:10.30 kernel kbattach: couldn't attach to Kernel region 01:00000:00000:2007/05/04 19:09:10.30 kernel kestartup: couldn't attach to shared memory: -ONLINE:1,0,0xf500c2b8, 0x413ea000, 0x76c00000, 0x1159 00:00000:00000:2007/05/04 19:09:10.30 kernel engine 1, os pid 27588 exited 00:00000:00000:2007/05/04 19:09:10.30 kernel Process 27588 exited with status 1 .... 00:00000:00010:2007/05/04 19:09:13.04 kernel kesetown: engine 1 not online 00:00000:00010:2007/05/04 19:09:13.04 kernel upsetaffinity: can't affinity to engine 1 for kpid 851981 00:00000:00010:2007/05/04 19:09:13.04 kernel upsetaffinity: can't affinity to engine 1 for kpid 85198
You will need to modify your /etc/sysctl.conf (make it live with sysctl -p) and disable exec-shield:
kernel.exec-shield=0 kernel.exec-shield-randomize=0
Some kernels don’t have the kernel.exec-shield* options but have no fear, we have another option:
kernel.randomize_va_space=0
Did you ever receive the error 17283 “Procedure ’sp_extendsegment’, Line 182 ‘tempdev1′ is reserved exclusively as a log device.” error? You can get the 17283 error when there is a device fragment that contains only the log segment. Part of the problem is when you extend the log segment onto a device, it will usually drop all other segments so it becomes ‘log only’.
device_fragments size usage created free kbytes ------------------------------ ------------- -------------------- ------------------- ---------------- master 8.0 MB data and log Dec 16 2004 4:09AM 3376 tempdev1 1024.0 MB data and log Dec 16 2004 7:02AM 1044480 tempdev1 256.0 MB data and log Mar 9 2005 10:49AM 261120 tempdev1 256.0 MB log only Mar 9 2005 10:54AM not applicable tempdev1 488.0 MB data and log Mar 9 2005 12:10PM 497760 tempdev1 256.0 MB data and log Mar 11 2005 2:03PM 261120 tempdev1 244.0 MB data and log Mar 11 2005 3:09PM 248880 tempdev1 200.0 MB data and log Jun 1 2005 12:33PM 204000 tempdev1 200.0 MB data and log Jul 8 2005 2:55PM 203808 tempdev1 200.0 MB data and log Jul 21 2005 2:54PM 204000 tempdev1 1000.0 MB data and log Feb 6 2006 1:11PM 1020000
So, how to fix this? Well, Sybase doesn’t provide any way to do so without modifying the system tables.
That’s it! It’s fixed and running with the segmaps without having to restart ASE. Wasn’t that easy?
From my wife
=================
Strawberries
So yesterday I’m at the grocery store. I purchased (among other things), two quarts of strawberries. They smelled so good that I opened a package in the car on the way home.By the time I got home, there was 1/2 a quart left. Total. I ate an entire quart and a half of strawberries between the grocery store and the apartment.
You guessed it.
According the doctor, I’m between four and a half, and five weeks.
Munchkin should arrive sometime around December 16th. A Hanukah baby.
=================
It’s been rather insane the past few weeks. I’ve been trying to think of a good way to write this up but haven’t been able to come up with anything as good as my wife’s post ![]()
Recent Comments