Reminder – get on the WSHR announce list!

January 3rd, 2025

If anyone out there would like to receive emails whenever I do a radio broadcast on WSHR with a link for the most current show, shoot me a email at jonathanpullen@gmail.com and I’ll be happy to add you.

Thoughts on adulting

January 3rd, 2025

So, a long time ago, back when $PERSON still talked to me, back before my mental illness had picked it’s particular focus.. slightly before or slightly after the first really recognizable manic experience I had (I had a few before this but they always ended up with heavy duty coding sessions so I didn’t end up in any hospitals).. $PERSON asked me if I ever emptied the dishwasher. Now, from this distance, I can grok she was probably fighting with her husband-at-the-time about who empties the dishwasher. At the time I probably said something pretty noncommittal because I didn’t *own* a dishwasher and never at that point in my life had, although I had rented in houses which had one. But at that particular moment in time I was trying to live on minimum money in order to maximize the time I spent exploring music and so I was feeling pretty good to have air conditioning.

These days emptying the dishwasher is on my housemate/friend/etc’s chore list but I still do it pretty regularly – it’s one of those chores that I really almost don’t notice doing, and I can do it while I’m waiting for my coffee. I was pondering, though, today – almost writing this post in my head – how I am much, much more together than I was in my 20s as far as getting stuff done, showing up on time, etc, but I get a lot less credit for it. And I think it’s because by the time you’re in your 40s people expect you to have adulting down.

As may be. I’m still trying to be a better person every day. I really enjoyed my read of my friend Randy’s latest book about the bible, The Bible Reexamined. It fit in a lot with my beliefs, but it did re-amplify my desire to contribute to making Earth slowly more towards a utopia because it’s probably all we have or are going to have and at any case, we’re here now.

Memory leaks in perl

December 30th, 2024

So, I’ve been maintaining several very large projects in perl – I can enumerate them at a later date – and one of them in perl and XS. Interestingly, the one in perl and XS is the first to have significant memory leaks – but they’re not all from XS!

I’ve identified three types of memory leaks

#1) Scalers leaving XS without being made mortal and given a reasonable refcount. A useful tool for looking for these is Devel::Leak
#2) Circular references that are not weakened and therefore can never be reaped. A useful tool for looking for these is Devel::Cycle
#3) Scalers gaining a refcount that is not being cleared. A useful tool for looking for these is also Devel::Leak

I now need to go through all the major subsystems and make sure that they aren’t leaking one of these ways. If I find new ways to leak I will add them to this document. Comment below if you’d like a more comprehensive document on how to find these things.

Avoiding ref leaks in perl callback code

December 29th, 2024

So, one of the big problems I’m having with kt3 is memory leaks. This is probably no surprise to anyone who has done XS programming before.

I found one particularly pernicious one by using Devel::Leak.. this is in the log handler.

Originally I had this, which I’m fairly sure I got from the internet somewhere:


static void _kt_log_callback(int iLogLevel, char *log_subsystem, char *msg)
{
dTHX;
dSP;

HV *rv = newHV();
sv_2mortal((SV *)rv);

hv_store(rv, "loglevel", 8, newSViv(iLogLevel),0);
hv_store(rv, "message", 7, newSVpv(msg, strnlen(msg, KT_LOGBUFSIZE)),0);
hv_store(rv, "system", 6, newSVpv(log_subsystem, strnlen(log_subsystem,32)),0);

PUSHMARK(SP);
XPUSHs(newRV_noinc((SV *)rv));
PUTBACK;

call_pv("KittenTrader::KittenBrain::Log", G_DISCARD);
}

This worked well enough – it created a hash ref and passed it to the function – but the hash ref kept leaking.

Eventually – after much digging through the documentation – I figured out that what I needed to do on the XPUSHs was this:


XPUSHs(sv_2mortal(newRV((SV *)rv)));

If anyone is curious how I debugged.. I used this relatively simple function to invoke the callback:


my $count = Devel::Leak::NoteSV($handle);
for($i=0;$i<1000;$i++) { KittenTrader::KittenBrain::testLog(4, "THIS IS A MESSAGE"); } my $count2 = Devel::Leak::NoteSV($handle); Devel::Leak::CheckSV($handle); print "Count: $count\n"; print "Count2: $count2\n";

This gave me a count of SVs, which I could clearly see my leaking SVs in.

Then I added returns everywhere along the path until I could isolate the leaking SV to a few lines of code. In particular I could definitely see that as soon as I created the hash, I was leaking a SV, but not if I destroyed it before passing it in. I realized the problem was that the callee didn't realize that the SV was mortal - I had made the hash mortal but not the *reference* to the hash. ANd of course the hash could never be destroyed until the reference to it was.

1300 hours

December 14th, 2024

Forget checks and balances. Politics *needs* a ref.

November 29th, 2024

I was talking about Mitch’s blatant cheating to pack the supreme court and someone on Quora pointed out that the Democrats started the move down the slippery slope with Harry Reid. Well, yes, okay.

It occurs to me that one thing politics needs very badly is a truly nonpartisan body that exists only to make sure that both sides (or all sides, if we could leave this two party stranglehold behind) follow the rules. Someone who can give a black card to Mitch – or to Pelosi – or to anyone who tries to tilt the playing field.

I’m not sure how this would work – it’s clear the people don’t care about fair play at all or they would never have elected Trump (of course, we don’t know that they did – one reason I wish we did have blockchain as one path of our voting process is we could test vote aggregation for honesty, something we cannot do now)

Sheer covers Darkening OF The Light (Concrete Blonde)

September 20th, 2024

This may get another coat of paint and/or mix job at some point, but for now, here it is

Sheer-DarkeningOfTheLight.mp3

More ranting about the for-sale nature of American elections and justice

August 31st, 2024

So, we all know that things like Citizens United should never have been allowed to happen, and we’ve all seen how America has slowly turned into something that works for the billionares far better than for the rest of us.

However, one thing that strikes me as extra cynical is that over and over I get political ads which imply that the way one wins elections is money, that if we spend less than our opponent the election is lost. These same emails always ask me to “chip in” – even though often teh candidate asking me for money is nowhere near my district and sometimes when I dig into them they have absolutely zero chance of winning.

I really hate the phrase “chip in” at this point. I know it’s intended to be emotionally manipulative, to make me feel like I am not doing my part if I don’t send money to everyone.

Two party systems and wind turbines

July 17th, 2024

So, one of the big problems we have in America with having a two party system is that it seems like what happens is one of tha parties aligns with the desires of the rural areas and the other party aligns with the desires of the urban areas.

As you all know, I’ve long been a proponent of ending the two party system (although not in favor of replacing it with fascism AT ALL) in favor of a multiparty system like you see in Europe. I think a big vehicle to help this happen and to help our representitive government better represent us is ranked choice voting.

Anyway, back to my original point. I saw a bunch of posts on facebook about wind energy and someone said it was bad for livestock. I assumed this was just going to be the usual lies from the right but no, in fact, there does seem to be some truth to this. Apparently there’s something called ‘turbine hoof’ – the constant vibrations through the ground disturb the cartilage and damage the livestock.

So, right now, the GOP is trying to literally end democracy in America. At CPAC they’ve announced their intention to end it, Project 2025 and Agenda 47 make it clear that their intentions are to completely screw over all urban voters to give the rural religious nuts everythign they want.

However, the way we’ve gotten to where somewhat less than half of the country is willing to vote for someone who is literally tearing down the bedrock of our country’s basic foundational concept is that we’re not listening enough to the needs of the rural voters and addressing them enough. Me, who occasionally studies the power grid and is a big proponent of fuelless energy sources, had never heard of turbine hoof and this, friends, does not appear to be bullshit, numerous studies seem to show a measurable effect here.

Now, don’t get me wrong, I think we can fix whatever’s wrong with the way the turbines are mounted, geared, or whatever so they don’t cause whatever vibrations are doing this. But I think we better add to the list of requirements for turbines going in near livestock that they can pass a test that they are turbine-hoof safe. And in general, we need to be careful.. if we don’t want to either have to fight wars or be destroying people’s lives, we had better make sure we aren’t the tyranny of the majority powering our cities off of technologies that are hurting the livestock of our neighbors.

Trump said *what*?

July 12th, 2024

So, apparently Trump is hoping that the Supreme Court (although the Supremely Corrupt court might be a better name) ruling that presidents have immunity for official acts applies to crimes you committed in order to become president. He thinks he should get out of the felony in New York because after all presidents have immunity. I don’t think we really want to go down this road – I would hope even his followers, as much as they’ve drank the flavor-aid and lost the ability to think rationally, woudl recognize that we don’t want to say that anyone who wins election has immunity for anything they had to do to win.

Honestly I’m going to have to write a whole rant about 1) How America is America the enslaved, one of the least free nations in the world and 2) how the supreme court granting presidential immunity is right in line with their tendency to say cops can murder anyone they want, steal anyone’s money they want, and that’s just fine. We are lucky there are as few bad cops as there are or things would be truly unlivable around here, because the criminal justice system is incredibly corrupt and seems to have lost sight with what the founders originally wanted for our country.

But even beyond that I have come to suspect that people will rationalize *anything* that “Their side” does. Not everyone, mind you, but enough folks to make for a major problem. Trump shouldn’t be able to be elected dogcatcher and neither should any other republican, but instead the GOP voters are about to vote themselves into a nightmare fascist dictatorship. And I suspect taht while right now they love it, they’re loving owning the libs, this is so fun.. when their friends get taken to the concentration camps, they may not love it so much any more.

One huge problem I think we face is the output side of every child left behind. The kids aren’t educated enough to realize what’s happening.

Anyway, we still need ranked choice voting.