Showing posts with label rongtudju. Show all posts
Showing posts with label rongtudju. Show all posts

Thursday, September 17, 2026

Retrobar pour Windaube 11

Avec les écrans toujours plus larges et les fenêtre toujours plus hautes, vous ne croyez pas qu'on va finir par avoir des ennuis ? A priori, chez M$, ça ne les choque pas. La barre des tâches de W11 est une horreur à utiliser même après avoir défait tous les pré-réglages foireux, mais ça non plus, ça ne les gêne pas. C'est que pour W10, j'avais pris l'habitude de la mettre en mode vertical, moi. Bon, ok, même ça, c'était mal codé, mais au moins c'était là.

Heureusement, il y a l'open source et pour le coup, il y a retrobar. Alors oui, ça pique peut-être un peu aux yeux, en particulier avec le thème "Windows 98 / Windows NT" que j'ai fini par choisir, mais le mode vertical marche comme une fleur et j'ai pu trouver le coin du code où on définit la largeur minimale et forcer quelque-chose de plus proche de ce que j'utilisais habituellement.

Au moins, j'ai l'heure en permanence dans le coin inférieur droit sans devoir gérer une barre qui apparaît et disparaît à tout bout de champ.

Les fenêtres que j'avais "épinglées sur la barre des tâche" dans W10 se retrouvent dans M:\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar, prêtes à être customisées si je veux. 

(ah oui, je me suis fait un subst pour que mon répertoire utilisateur apparaisse comme M: ... il faut juste se souvenir que les autres utilisateurs ne voient pas ce disque virtuel, y compris le compte admin)

Et oui, j'aurais pu/du vous en parler depuis Mai 2025. Scsi.
 

 

edit: passer 1 jour à relancer des recherches Internet sur "comment faire pour qu'il n'y ait pas de boîte `cmd.exe` qui traine pour mon raccourci", tomber sur start /MIN ma_commande qui ne marche pas parce que la boîte de dialogue du raccourci ne connaît pas l'emplacement de "start" ... et finalement remarquer le Run: Normal Window [v] juste sous "Shortcut key:" .. qu'il suffisait de passer sur "Minimized" T_T

Tuesday, August 04, 2026

A bit of CI/CD ?

I'm not considering to add some for these projects at this point, despite I now have a few things on codeberg and codeberg sure comes with some CI/CD option, maybe they'll look like the one of gitlab which I've had to deal with today.

Most of gitlab's CI options are tweaked through variables within the .gitlab-ci.yml file of your repository. Most of those variables are free to configure yourself but some directly affect the “Getting source from Git repository” step, especially GIT_SUBMODULE_STRATEGY, GIT_STRATEGY (where you can tell whether you want a full clone or a mere fetch of the branch you're using in your job).

And unfortunately, it's one of those case where git turns out to be complicated, with many trivial things (do you have a "main" branch here?) requiring long commands (git show-ref --quiet main ... you thought that would have been one of the 8+ modes of "git branch" command ? too bad :P) that you may have to post-process. For instance, you can pick only a few commits at the top of some branch, you need not to crawl back to that initial commit.


  mkdir mere_window
  cd mere_window
  git init                   # a new place to toy with commits
  git fetch ~/myFavoriteRepo --depth 10
  git checkout FETCH_HEAD    # so we're somewhere on the history
  whereami 80

See ? 1) not all commits are there, although I asked 'whereami' (alias wh) to show me at least 20 of them, and 2) at the bottom of it, there's one tagged with (grafted). If you had branches merged lately, you might have more. Such grafts still have the same ID as the original commit, but they contain much more things if you show them: the whole content you're missing since repository started is condensed in such grafts. They'll delegate that extra weight to a deeper commit if you decide to fetch again with a higher depth, and turn back to their original size.

But back to gitlab. Its default setting seems to be to fetch with a depth of 20, performing what appears to be dubbed "a shallow fetch". You can spot that with "Fetching changes with git depth set to 20...". Mostly sufficient but if the CI/CD is introduced late in the life of the repository, and if you've been working on long branches for a while, it might not know about the main branch at all. That turned to be a problem for some packaging steps, but hopefully, we have GIT_DEPTH that can tweak things, and setting it to "0" is the way to tell gitlab to drop the --depth argument altogether. There at least, you should have some value of "main", even if it isn't the latest (just the latest known to your branch, I presume).

Gitlab may also play trick on you by keeping the things you already fetched when you start some old test again, just to find that the branch is now listed. You know it does when the job step will mention it "Reinitialized existing Git repository in your_path".

One more trap to avoid: git branch does not list *all* branches. Only those you created locally by checking something out. You'll need an extra -a to also show the remote branches (or -r to see only them).

Wednesday, June 03, 2026

autocrlf

I have a git folder that is accessed both by a windows host and a linux guest from a VM (as a shared folder). Everything was fine until some git package upgrade started warning about "in the working copy of 'project.txt', LF will be replaced by CRLF the next time Git touches it" (or the equivalent from the Linux guest).

I'd like to avoid cloning the repository twice and I already have something that makes these file LF-only on the master repository. I set autocrlf = false in .git/config, but that does not seem to help.

The manpages of git are heavy, freaky and intimidating to say the least. But I guess if I had rtfm'd them, I'd have eventually encountered the git config --show-origin --get-all core.autocrlf command, which conveniently reports all the files where the given configuration item. I'd have figured out that while I had my local configuration file requiring "do not do auto-CRLF conversions", the system-global configuration actually had the precedence. ... ridiculus, but that's the way it is now.

git check-attr -a project.txt and git ls-file --eol project.txt could be useful to check the current state as well.

With autocrlf=false in Git/etc/gitconfig, I don't have the warnings anymore, but I still have the file that is switching between CRLF and LF depending on whether Windows host or Linux guest is checking it out. It looks like the only way to get the desired behaviour is to edit * text=auto eof=lf in .gitattributes, at the root of the repository. I want that to remain a local decision, and hopefully, my colleagues haven't committed that file yet, so that'll work.

Wednesday, May 27, 2026

What's wrong with Gimp ?

 J'avais jusque là la 3.0.6 sur la machine windows du bureau ... qui m'a déplu sur plusieurs aspects. Petit tour d'horizon avant de passer à 3.2.4

  • sauf que tout à coup, c'est la 3.2.2 qui s'ouvre !?
  • les niveaux de zoom sont devenus beaucoup plus étalés, notamment quand on zoome avec CTRL+roulette ... au point que avoir un 200% ou un 300% "propre" pour une capture d'écran de pixelstudy devenait impossible sans aller entrer la valeur à la main. 3.2.2 corrige ça en permettant de monter à 33, 50, 66.6, 100, 150, 200 avec les raccourci clavier "+" et "-"
  • changer de couche avec PG up et PG down ne permettait que de sélectionner la couche, pas de l'activer pour les opérations de dessin et de copier/coller. c'est corrigé avec 3.2.2 

Est-ce que je deviens chèvre ? Non. C'est le nouvel outil de sécurité du boulot qui fait les mises à jour dans notre dos. Sans avertissement, sans résumé d'opérations. Rien.  

Restait le panneau d'impression qui indique maintenant "pas de prévisualisation possible". Un comble pour un programme de dessin ! Un petit tour dans la base des registres pour ajouter PreferLegacyPrintDialog=(DWORD)1 sous Computer\HKEY_CURRENT_USER\Software\Microsoft\Print\UnifiedPrintDialog et on revient à quelque-chose de moche, mais utilisable.

Friday, December 12, 2025

ALT+F5

It's been decades I'm using the ALT+F5 combo to spawn a new terminal. I couldn't even tell if that was some default settings of Enlightenment, some defaults of the window manager I used before enlightenment or something that just felt natural since ALT+F4 closes a window.

But of course that doesn't work with Windows ... but maybe it could. Let's locate my `User Pinned\TaskBar` first, which appears to be in some sub-folder of Internet Explorer within the hidden AppData (and well, a good old dir /s TaskBar remains the most reliable way to find out)

After that, configuring is even easier than changing the icon. There was a "Shortcut key" field waiting for me, in the "shortcut" panel ... I'm baffled. How could I've been missing it for over 10 years if it was so easy ? Was it something introduced only in recent versions of Windows ? it was there since Windows 98 SE...

There's just one pitfall: you need to restart Explorer.exe if you want your new shortcut to take effect.

So I know win32gui (from pywin32) can script some actions to some Windows the way eesh used to do. Can I bind some key to "uniconify the music player" ?
def callback(hwnd, any):
     global found
     if win32gui.GetWindowText(hwnd) == any:
         found = hwnd
     if any in win32gui.GetWindowText(hwnd):
         print("%s - %s" % (str(hwnd), win32gui.GetWindowText(hwnd)))
         
w.EnumWindows(callback, "VLC")
can find me some stuff (thanks the doc) once found, I can use ShowWindow to switch between win32con.SW_RESTORE and win32con.SW_SHOWMINIMIZED (thanks the rubber duck, I guess)
  • Window class is useless. It just tells me VLC is coded in QT :P
  • the "select media" key I want to use does not seem to be usable as a shortcut ... can I use powertoys key remapping to deal with that ?
  • it turns out these are 'AppKeys' in Windows vocabulary, and there are registry keys to define what happens when you hit them (surprisingly, this was all empty on my machine)
  • "Run: minimized" on the link to the python script avoids flashing black command window

Saturday, November 01, 2025

Out of Memory

There's something going disturbingly wrong with my debian setup ... I thought it was mainly an issue with firefox, where the whole system froze and became completely unresponsive when youtube's scripts push the browser out of memory bounds. But it just happened as I tried to convert a too complex picture into a stack of svg path with inkscape while still having gimp opened with the bitmap edits and consuming about 3G of RAM to host them.

Usually, I can then access a text terminal and launch the top tool to kill the process that went crazy, but with that debian 12, it seems like it couldn't even keep that in memory ... too often, I end up having no other option but forcing the system to shut down, losing whatever state I had on the machine.

A message on stack exchange describes quite accurately what is possibly going wrong: the system has been assigning so much memory to data that it started stealing pages of executable code from processes ... and unfortunately, those processes call these pages back, forcing the swapper to find something else to kill, again and again. the "Out Of Memory" behaviour of the system does not kick in, or not before things have been running wild for over 10 or 20 minutes.

I've found some blog page presenting "Early OOM", an alternative that would kill memory-hoggers process in advance. Got it installed ... Got to check whether it helps ... Still have to write a wrapper to firefox launcher that would ulimit its consumption of virtual memory (did check it is effective).

(Maybe having a look at https://fedoraproject.org/wiki/Changes/EnableSystemdOomd could be useful, although it is for fedora installs) 

Spotting systemd_oomd running on my ubuntu (virtual) machine ...  

Tuesday, March 18, 2025

procmon.exe

 A rogue DLL
Is failing to load
Who you gonna call ?
DependsWalker !

It's not in your path
nor in Windows Kit
Who you gonna call ?
Depends Walker !

Well, it used to be in Visual Studio ... then in Windows Kit ... now it is a mere .zip to be downloaded on some random dependencywalker.com site, waiting to be hacked away or sold to any advertiser ... It's useless with Windows 10 anyway: it doesn't understand new requests in the new internal API and throws tons of fake dependencies at you.

Oh, sure, there is a github fork in another language made by some nice guy trying to replicate the feature. It will require some specific .net version to build and no, I'm not going to mess up with my dotnet setup after upgrading python to please the antivirus broke my builds.

So what's left ? The "modules" window of Visual Studio is of course useless. Setting breakpoints on LoadLibrary* is a nice way to spend your time watching hex numbers, but it doesn't help either. Rubber duck suggested procmon.exe, which looks a lot like the long-searched-for strace for Windows, and at least comes from a known package hosted by a legit webmaster

O yum. O apt and your super cow powers. O pacman. How much I'm missing you ...

Wednesday, February 12, 2025

$VSWHERE

Okay, that's truly worth another "rongtudju" entry. I have to build with Visual Studio from times to times at the office, but I also work remotely from times to times. Of course, it's been ages since I installed sshd from mingw packages, and I'd rather call the build system from a ssh console when I'm remote than having GPUs trying to squeeze console activity into H.264 and show it on my screen. And it has been working happily for a good amount of years.

Then something bad happened, and as soon as the build system will try to invoke any of visual studio core programs, I would get error messages about

'cl' is not recognized as an internal or external command, operable program or batch file.

One key element of our build system is SCons, which I'm not fan of, but at least I can enter that and hack around now. Especially, I can see that no matter whether I set the $PATH environrment variable on the command line to include c:\program files\microsoft visual studio\...\bin\Hostx64\x64, the env['ENV']['PATH'] that scons will use to invoke the compiler will be empty.

If I decide to hack the 'CC' variable directly in Tools/msvc.py, I can make it compile stuff, eventually. But I had to dir /s stddef.h and others to get all those include path right. And it will stab me in the back as soon as I'll try to build a driver instead. Not to mention that of course, it doesn't help for other tools like lib.exe or link.exe ... 

A bit more rubber-duck-talking led me to VSINSTALLDIR hunting (and VS_VERSION hunting) in more python files, trying to find what is the normal way for SCons to decide which visual studio to use.

I know about the vcvarsall.bat script that "native developer console", but I doubt it would be used in a mingw-bash-scons-whatever-cl.exe setup, or at least not directly. And then, only then, I noticed the warning that the build tools had been trying to show me from the very beginning:

scons: warning: MSVC version '14.3' was not found.
  Visual Studio C/C++ compilers may not be set correctly.
  Installed versions are: ['14.0']

That was coming from Tool/MSCommon/vc.py, in a file that is mentioning $VSWHERE every now and then. Some more rubber-ducking and more dir /s revealed c:\program files x86\Microsoft Visual Studio\Installer\vswhere.exe ... and if I somehow force it into env['VSWHERE'], I no longer need to hack env['CC'] and env['AR'] to get a working build. Higgs! I even get the whole sub-project built just fine ^_^

Of course, the VPN dropped all my connections again a few minutes afterwards ... just enough to see whether I can get that running two times in a row, I guess...

Notes from the future:

  • you may end up on a setup where your build script and your newly-installed Visual Studio do not agree where vcvarsall.bat should be. Copying it in another place will fail, as it is full of relative paths. But a trampoline calling "%~dp0\Auxiliary\build\vcvarsall.bat" %* does work
  • you can set VSCMD_DEBUG=1 to see a bit more what is going wrong when you're loading vcvarsall
  • only remotely related, but mind that you can end up with dotnet.exe installed in both Program Files and Program Files (x86). They'll ignore the SDKs installed by their counterpart. Unclear whether %__DOTNET_PREFERRED_BITNESS is of any help here ^^"
  • just add export SCONS_MSCOMMON_DEBUG=- on your command line to see what vc.py is doing ... you should see it calling vswhere.exe -all -products * ... if that doesn't return some InstanceId, chances are hacking a path for env['VSWHERE'] won't be of any help. but before you give up, try defining $ProgramData;-)

Monday, November 25, 2024

Wait ... What ?_?

For long time, my Windows task bar has been disfunctional. I had to be quick-but-not-too-much if I wanted to reach those snapshots the UI shows you when you right-click on any of the docked icons. If not, the pop-up would disappear before I can enter it. Trying to access the tray icons was even worth: I'd need roughly 4 or 5 attempts to get any of those "quick-access" items.

For long time, I've been considering this must be a nasty side-effect of the sloppy focus emulation I had enabled. The fact that I have one task bar on the right edge of the screen clearly did not help. But I had noted that the horizontal task bar did not have this issue. It's on the secondary screen, hidden most of the time so that my Linux VM can shine through. So I finally search for a way to migrate the tray icons on the horizontal bar, but I couldn't follow the instructions. I clicked "lock all taskbars", but then I couldn't move them as the poster claims.

wait ...

Right click on any taskbar, then uncheck Lock all taskbars

it ... it has no checkmark here ... you mean ... it is already unchecked ? I was running the OS for years with taskbar that could follow my mouse cursor at anytime !_? And ... and yeah, of course this is why this PC has an issue with the taskbar popups ... Did you believe it ? Nah. That's not the reason. That's because the panel is *next to* the task bar rather than being *above* it. Yup. locked or unlocked doesn't change things. I can now click my icons but only on the other screen (that means, when my VM is hidden).

Unfortunately, that also means that clicking "Search" icon on screen A's task bar pops up a search box on screen B (:palmface:)


Saturday, September 14, 2024

Toga 1 - Draeger 0

C'est triste, je trouve. On savait faire le cahier-bullet parfait et on a arrêté.Il était assez robuste, on l'avait bien en main, il avait un papier qui glisse bien mais pas trop, assez épais pour qu'on ne voit pas la page précédente si on prend soin de choisir du matériel d'écriture qui convient un minimum

J'en ai eu 4 au total, dont un qui n'a pas encore été mis en service. Ils me servaient de pense-bête, d'agenda, de suivi de projet ... tout ça à la fois avec des références de page en page pour s'y retrouver correctement.

Toga had the right bullet notebook, as far as I'm concerned. Strong enough, with the right mix between paper's softness and 'swipe-ness', thick enough to avoid ghosting from the previous page but thin enough so you can fit nearly 200 pages in less than 2cm. I've used them as agenda, thougt-tracking, project management and more since 2019. And unfortunately, I'll have to find something else.

Mais celui que j'ai commencé à utiliser en 2024 ... bin, il ne "marchait" plus aussi bien. J'ai cru que c'est parce que je ne prenais plus assez le temps d'être dedans, ou parce que je n'avais pas encore mis son "illustration" de garde en couleur, ou que j'avais perdu la "recette" qui me faisait aimer son contenu. Ou parce que je tringballais beaucoup trop de feuilles volantes supplémentaires qui en avait abimé la couverture.

Et je viens de me rendre compte que c'est bêtement parce qu'il est mal fichu. Il est au précédents ce que Fantasia Mega Drive est au Roi Lion sur la même machine. Pourtant il donne bien l'impression d'être le même, avec son élastique, malgré son bandeau horizontal qui annonce "Draeger by Toga" alors que les précédents avaient un bandeau vertical "Toga". Ils ont même gardé le même papier (et la même photo sur le shop en ligne du magasin du coin >_<).

Because you can't find Toga stuff anymore. It's now "Draeger by Toga", and obviously they changed manufacturing process while pretending it's the same. When I started using my 2024-notebook, I couldn't feel the same satisfaction using it. Previous notes were harder to find, handscript felt less clear ... for some times I thought I had lost the way to use it, but then I realised the spine of the book is no longer working like the Toga notebooks did: pages are grouped in few large booklets where the former Toga book used many small booklets. And they are glued together with a stiff "tab" instead of a flexible ribbon.

Try to keep the book open on page 75 and you'll immediately see the difference: the notebook doesn't come flat on the table, the pages will flip automatically to find the next booklet... The first booklet is getting away from the spine and the booklet n°2 has to be bent so I would write on the left pages. And that was a batch produced in 2022 ... the one in the shop around the corner also messed up the ink used to print the dots, meaning that the dotted pattern will become distracting instead of supporting the writing. And I find it sad ...

C'est la technique de reliure qui ne vaut plus rien. L'épaisseur des feuillets à été doublée, ce qui veut dire que quand on se trouve sur un bord de feuillet, la résistance est d'autant plus grande. Et pour faire tenir ça, ils ont tartiné un pavé de colle qui reste rigide plutôt qu'une bande de papier/tissus avec un rien de colle. Résultat, le cahier ne se met plus à plat. Le deuxième feuillet est complètement tordu et il devient difficile d'écrire vers le centre du cahier. Et plus on va vers le centre, moins ça marche. Les précédents restaient gentiment ouverts à la page choisie, celui-ci va se refermer et retomber toujours plus ou moins au même endroit. Retrouver la page "l'année 2024", par exemple, me prend bien plus de temps qu'avec les précédents.

Voilà. Désolé. C'est un truc qui m'agace avec notre époque: à force de vouloir produire à moindre coût, on finit par produire des objets dont la fonction première n'est plus atteinte. Et ça ne s'arrange pas avec le "batch" suivant: celui qui restait au magasin commence à utiliser une autre encre pour l'impression du motif à point, si bien qu'il commence à devenir gênant pour l'écriture ou le dessin...

edit: il semble que ma fée avait acheté un exemplaire de ce batch suivant, avec une bande horizontale annonçant "draeger" uniquement, et "créé à Paris, fabriqué en Chine". Les points sont nettement plus sombres et la reliure est encore pire. En essayant de l'ouvrir, la colle a lâché dans un "scrrrrach" assez inquiétant.

I've been suggested to check "notebooktherapy", which seem to have top-quality products, but they also seem to assume you're willing to invest top-quality budget to purchase it... Not sure that will meet my one-size-fits-all use, but at least an alternative exists.

There are interesting things in Clairefontaine's collection, seemingly. Too bad https://journaling.fr/ is no longer a shop for them.

Friday, October 07, 2022

Finally doing some pthread stuff

For years and years, I've staid away from multi-threaded programming. Not that I dislike threads per se: I once made a multi-threaded micro-kernel myself after I spent countless hours studying IA32 Task State Segments. But who needs threads when you have two ARM cores, hardware interrupts for driving your sound DSPs and proper multi-layers video chip anyway ?

Even for network / system programming, I tend to prefer use pipes or socketpairs over threaded stuff. They strace better. You can actually see the flow of acknowledgements between entities. For most things, this is preferable over raw performance.

But a couple of years ago, I've been thrown in a pool where threads are already there and I need to swim with them. Parts of the pool use boost abstractions and are usually not too hard to work with because my colleagues did a great job at building robust RIAA things around those abstractions. But other parts of the pool use plain pthread + plain Windows thread/event/locks API. And as you can guess, upgrading corporate project to use C++11 threads is usually not easy (not that I know these any better, though).

One function that is used a lot in that code is pthread_cond_timedwait(). And there are a few things you must not do with that:

  • do not call it if you're not holding the mutex argument
  • a corresponding pthread_cond_signal is lost (not buffered) if no one is waiting on the condition at the moment of cond_signal

When debugging

  • you may need set non-stop on to prevent some other thread from interfering (e.g. declaring things timed out) while you're stepping through some thread-of-interest.
     

(more to come)


Tuesday, May 24, 2022

Flop ...

Aaw. un câble de portable trop tendu, et j'ai toutes les prises de mon bureau-à-NUC qui se retrouvent sans courant. j'avais justement bien besoin d'un contretemps comme ça pour me remettre à bilouter, tiens.


(et comme de bien entendu, impossible d'avoir un professionnel qui réponde à mes appels au secours :-/ )

Monday, August 30, 2021

Trouver le thread fautif

Bon, ce coup-ci, j'étais sur un autre cas de figure: le programme fautif est toujours occupé à tourner, mais un de ses threads est mort, causant une attente infinie dans un autre. Je sais demander un .dmp au Task Manager, ouvrir le .dmp en question sur la machine de dev avec les bons chemins pour les serveurs de symboles (eh oui, moi du futur: tu as oublié mais sous Windows, il n'y a pas de .elf de debugging: les symboles de debug sont d'office dans un fichier séparé) et parcourir la liste des threads en espérant y voir apparaître KERNELBASE!UnhandledExceptionFilter dans la pile d'appels correspondante. 

Ce n'est pas trop dur de repérer l'adresse du crash, mais c'est une autre histoire de connaître l'état des registres au moment du plantage.

Il devrait y avoir une extension de windbg pour gérer ça, mais le site qui la proposait a disparu dans les limbes du temps. Par contre si je parviens à deviner où elle se trouve, la structure EXCEPTION_POINTERS devrait nous fournir toutes les infos nécessaires pour continuer à debugger.

Eh bien voilà: cette structure est produite dans le stack frame (les variables locales, NdT) de ntdll!_C_specific_handler (encadré en rouge dans la capture ci-contre) et référencée dans le stack frame de UnhandledExceptionFilter. J'ai utilisé les adresses renseignées par la colone 'Child-SP' et retracé ça à la main dans Gimp, hein. Ici, un seul candidat: 0x16bee7c0.

Reste à s'assurer que c'est bien la bonne adresse. Je peux utiliser la commande windbg dt 0x16bee7c0 EXCEPTION_POINTERS pour le coup: si je suis dans le bon, elle me donnera deux pointeurs valides

En cliquant sur le 'exception record', on devrait avoir un code valide (type 0xc000000*) et une adresse qui correspond à notre fonction fautive (aussi renseignée comme adresse de retour pour KiUserExceptionDispatch, soit ici à l'intérieur de MoveSmall).

Thursday, August 26, 2021

Trouver un core dump ...

bin oui, parce que coder, c'est aussi chercher pourquoi un programme s'est planté. Linux est assez sympa sur ce coup-là avec son ulimit -c unlimited qui permet d'autoriser la production de 'core dumps' dans le répertoire courant pour un shell donné sans que tout le système ne se mette à saturer le disque dur en cas de dysfonctionnement. Après, on ouvre le dump dans un débuggeur et en avant pour l'autopsie.

Mais là, pas'd'bol, je suis sous Windows. Le boulot, vous comprenez. Le frangin de Jigé me proposait de faire clic-droit-debug dans le gestionnaire de tâches (onglet 'détails' de préférence, apparemment) et hop youpi, visual studio prendrait en marche le programme fautif. ça m'arrangerait assez bien vu qu'il est appelé depuis du python au bout d'une séquence de 3 ou 4 programmes histoire que la caméra à l'autre bout du fil soit dans les bonnes dispositions pour les tests. 

Mais re-pas'd'bol, quand je fais ça, j'ai juste droit à "not responding" sur Visual Studio puis les deux programmes qui s'arrêtent avec pas plus d'infos. ça marchait mieux avec "create dump file", mais ce n'est pas ce qu'il me faut aujourd'hui.

Pour le coup, je vais devoir refaire appel à devenv /debug dans une console VSpéciale et croiser les doigts pour être dans les bonnes conditions pour reproduire le crash. 

  • c'est apparemment normal d'être accueilli dans un Visual Studio qui fait semblant de ne pas savoir ce que vous voulez. Debug>Start Debugging devrait nous mettre en route
  • ça devrait aussi être normal que la fenêtre qui s'ouvre quand le programme est démarré (après tous les téléchargements de symboles depuis les servers MS) se ferme automatiquement en cas d'arrêt du programme. On va mettre un p'tit breakpoint sur exit pour calmer un peu tout ça;
  • ne pas oublier le .exe à la fin du nom du programme. Faute de quoi, VS ne le trouvera pas et proposera juste un bouton 'Attach...' au lieu du bouton 'Start' !
  • bon, par contre j'ai beau torturer ma ligne de commande, pas moyen de reproduire le crash dans cet environnement-là. Il va falloir trouver autre chose.

Et le plus agaçant, c'est que je sais que Windows peut le faire. Sur tant d'autres machines, il m'a saoûlé avec ses boîtes de dialogues ok/cancel/debug... ça pourrait être parce que Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug est vide, mais non: il me fait l'effet d'avoir bien tout ce qu'il faut là où il faut.

Ahmaisattends ... le programme de test mélange une bibliothèque C++ et du code compilé avec GHC, et le runtime haskell a un flag supplémentaire +RTS --generate-crash-dumps -RTS. On peut toujours essayer d'utiliser ça pendant notre debugging VS... Ah ? ... Bingo ?

On transfère bien son .pdb sur la machine de test ... Et voilà: j'ai un nom de fonction et un numéro de ligne. La méditation va pouvoir commencer.

Ah oui, il y a aussi le Windows Error Reporting (WER) system, et ses fichiers "planqués" dans C:\ProgramData\Microsoft\Windows. C'est ce qui ressemble le plus à mon ulimit. il faut créer la clé HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps et y définir "DumpType"=dword:00000002 (et plus si affinités. Attention, ça change le répertoire utiliser pour les dumps :-P)

Il y aura aussi procdump -e à tester, tiens.

Wednesday, June 16, 2021

Please Deflate your UI

 The last one to do it are Firefox people (dropping "compact" layout), but let's make it clear: using pixels of our screens (especially vertically) is becoming increasly difficult as touch screen get prevalent. I've been trying to avoid Adobe Acrobat Reader DC for as long as I could for that very reason too.

Please, once for all, make the padding-around-icons/text/UI elements a system-wide tunable feature. Stop having padding pre-built in your icons. It is not something you as a system designer should decide, just like you shouldn't decide whether I'll wear a tie or a bow. 

Look at that non-sense: there is so much ribbons and margins when I have a document to review that none of my screens would allow me to properly see an A4 page large enough so I could read the text effortless... unless I turn full-screen of course, in which case I no longer have access to people's comments.

(I truly wish there was an open-source alternative to adobe review system, but given that they now try to automatically upload reviewed documents on their cloud, I doubt that is about to come)

Hopefully, with Firefox, you can toggle browser.compactmode.show and have 'compact' option showing up again when you try to customize your menu bars.

Thursday, March 25, 2021

c:\sink.pl

 Bon, vu qu'on est re-confinés j'ai toujours une machine Windows à la maison. Elle a reçu un mingw (non sans une grosse dose de Rongtudjus). Et si en plus elle avait PERL, (pacman -Sy, mon ami), serait-elle capable de faire des échanges de fichiers avec une DS ?

Bin ça n'a pas l'air d'être le cas. Même après avoir autorisé PERL sur tous les réseaux dans le firewall ... tout au plus, le Windows parvient-il à envoyer les invitations à transmettre (en UDP sortant). Mais j'ai systématiquement une erreur 0xcafe au moment d'essayer d'établir la connexion.

Eh ? ... pas si vite. C'est quoi cette cochette à gauche du nom 'perl' ? et pourquoi est-elle restée décochée ?


Ah bin oui. Là, tout de suite, ça va beaucoup mieux!

Comme ça je peux récupérer le 'xmasdad' découpé pour faire de l'animation modulaire. C'est la branche tuto qui va être contente...

edit: et pour scripter ça, ce serait avec netsh (dont la partie utile de la doc est ici.

Wednesday, February 10, 2021

Connection failed


 arf. Bon, le laptop pro que j'utilisais depuis mars dernier pendant les heures de bureau a claqué. Le disque SSD, plus que probablement, et sans espoir de récup pour autant que je puisse dire: les systèmes Linux ne parviennent même pas à initialiser le contrôleur et il n'est plus dans /dev/sd*.

Ce qui est dommage, c'est que puisqu'il ne s'agissait pas de matos à moi, je n'avais encore jamais fait de backup de ma VM 'machine à écrire' et que du coup, je suis reparti pour une installation d'une LTS ubuntu dans une virtualbox. Oui, encore.

Au moins, avec les package 'virtualbox-guest-dkms' et 'virtualbox-guest-x11' installés proprement par apt-get, j'ai un copier-coller complet, chose que je n'étais pas parvenu à mettre en route la fois dernière.

Rongtudju! Le nouveau laptop n'a pas de prise VGA. Heureusement, j'avais acheté pour mon NUC un petit adaptateur HDMI->VGA qui n'avait encore jamais servi. Le temps de forcer dans 'Advanced Display Settings' le rafraîchissement à 75Hz, et j'ai un second écran de nouveau d'attaque. Oui, parce que sinon, j'ai un signal tout pourri avec une image compactée sur 2/3 de la largeur de l'écran. Allez comprendre ...

Rongtudjuu! C'est assez facile d'avoir le réseau wifi et Internet accessible depuis la virtualbox: il me suffit juste de me mettre en 'accès par pont'. Mais le VPN depuis la VM ? ... Ah ? Configurer la première interface réseau en mode NAT a l'air de faire l'affaire... Par contre, du coup, je perds l'accès à mon WiFi. ça semble tolérable...

Rongtudjuuu! mais qu'est-ce que c'est que ce clavier !? Il est bien joli avec son métal entre les touches, mais pourquoi avoir piégé la touche "ENTER" de la sorte (avec un effet camouflage, en plus, hein?) Pourquoi avoir décidé que les touches F1-F8 devaient céder la priorité au contrôle de volume et de luminosité (on fera donc ALT+Fn+F4 pour fermer une fenêtre et fn+F5 pour rafraîchir une page jusqu'à ordre contraire!) Enfin, pourquoi oh grand pourquoi avoir mis sur une même touche des éléments de navigation comme home et end avec les touches F11 et F12 !? Voilà pourquoi je reste farouchement opposé à ce qu'on m'impose un laptop comme outil de travail quotidien. Ok comme solution temporaire. Ok pour bricoler un peu le soir, mais rongtudju, vu les décisions débiles et anti-codeurs que les gens qui montent des laptop prennent, s'il faut de toutes façons une docking station complète pour s'en servir, alors donnez-moi un NUC! -- un job pour https://github.com/randyrants/sharpkeys ? 

ou alors ...

 git clone https://github.com/Lexikos/AutoHotkey_L
F11::home
F12::end
Launch_App2::F11 ; calculator
<+Launch_App2::F12 ; LSHIFT+calculator.

 Malheuresement, ni AutoHotKey ni les PowerToys de MS n'ont d'effet sur les connexions remote desktop ou les VMs...

RongtudjuUuu! après quelques heures de travail en musique, voilà que l'audio introduit du bruit dès qu'il y a un peu de charge sur le réseau >_< -- (fix: driver DELL mis à jour)

dernière chance ... xmodmap -pke | sed -e s/XF86Switch_VT_1[0-2].*// | xmodmap -. ('faudra que j'enregistre ça quelque-part dans mes scripts de démarrage...)

Friday, July 31, 2020

I hate it!

Let me be 100% clear. It really gets on my nerves to the point I feel like I should crush my mouse into the desk to fill better. Why on Arrakis did they had to make their operating system in such a way that every item you could think of needs a dedicated tool to be investigated. What was wrong with "everything is a file", uh ?

Everything is IUnknown. Wonderful.

- - - Round 1 - - FIGHT! - - -

I wouldn't even object if you had a clear way to scan that.

Want to find the log where DbgPrint wrote stuff ? Better download debugview.exe and don't mess with its settings or you won't see anything
Need to check some NDIS log instead ? that will be tracelog.exe for you. But make sure to check you got anything with tracert.exe before you try to use PDB files to make sense of what you got.
Want to figure out what devices are out there ? You'll need c:\program files (x86)\Windows Kits\...\devcon.exe (that's another download for you)

Want to know what drivers are out there ? that will be driverquery, sir. But maybe you want a cup of sc query first ? Or some pnputil.exe /enum-drivers to check the drivers cache ?
Want to know what that 1077 error code means ? Please use net helpmsg 1077.

Let's not even talk about where to find 'all the running applications' or their windows.

No wonder why they needed a powershell to make things start to work.

Oh, /dev, /sys, /proc. How much I miss you... msinfo32 is such a poor substitute ...

- - - Round 2 - - FIGHT! - - - 

I wish I could simply use my knowledge of gdb on Windows binaries, but I haven't found any way to do so. Granted, Visual Studio debugger does a decent job, but given the size (and the license requirement) of VS, I can hardly install that on every test system on which stepping through code might be required.

Easy (in gdb environment): you'd use gdbserver on the 'test system' and connect from your full-fledged gdb-compatible debugger on the machine that has the source and stuff. Again, I have no clue whether this is possible in the Windows econosystem.

So what's left is WinDbg, which requires a much smaller package to be installed. I'm going through GFFault.net tutorial to try figuring out how to learn that tool.

- - - Round 3 - - FIGHT! - - - 

There's a strace-like tool in https://github.com/DynamoRIO/drmemory ... we'll see whether that makes me a better windebugger during 2021 ... forget it: drstrace.exe just crashes when starting to trace most programs, including something as simple as Notepad.exe >_<
If not, I guess I could at least teach myself https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

Just in case you wonder how to enable core dumps on a system without ulimit, check out Windows Error Reporting. It's not like you hadn't launched the Registry Editor earlier this week, right ?

- - - Epilogue - - -
Before you install rogue sotfware on your machine, you might want to know that Windows has md5sum "equivalent" within the swiss-knife certutil tool: certutil /hashfile your_file_name md5.

- - - Season 2 teaser - - -
tasklist is your /usr/bin/ps

Wednesday, February 12, 2020

Nouveau Gimp

Je n'ai malheureusement pas réussi à ce que Gimp conserve ses anciens paramètres lors de l'installation de mon nouveau PC de bureau. J'ai même été franchement contrarié de les voir passer à une interface "tout intégrée en une seule fenêtre" comme le "nouveau" lecteur PDF d'adobe (eh non, plus moyen de continuer à utiliser Acrobat XI un peu plus longtemps). Mais au moins, chez gimp, on a une cochette [x] Single Window Mode pour si on veut utiliser une image de référence sur un écran pendant qu'on bidouille ses pixels-à-soi sur l'écran d'à côté.

Restons confiant, donc. Après tout, j'ai aussi pu remettre mon 'F12 = snapshot" en cherchant 'screen' dans Edit > Keyboard Shortcuts. (enfin, il fallait quand-même d'abord activer [x] Use dynamic keyboard shortcuts dans Edit > Preferences).

Je n'étais pas franchement convaincu par l'interface revisitée pour changer la taille du pinceau/crayon. 'faut dire que je suis plus souvent entre 1 et 4 pixels qu'entre 20 et 800, personnellement. La 'nouvelle' interface sépare chaque barre en deux zones, une qui permet un règlage absolu (sur le dessus de la barre. Le curseur souris devient une flèche verticale) ou relatif (sur le dessous de la barre. Le curseur ressemble à "changer la taille des colonne"). Mais ni l'un ni l'autre n'offre la vitesse de réaction que j'attends de mon outil.

Je sais que j'ai déjà changé ça: j'avais remappé CTRL+SHIFT+roulette, qui par défaut change la 'forme' du pinceau (ovale vertical -> cercle -> ovale horizontal). J'ai juste oublié comment j'avais fait.

5-10 minutes d'exploration des préférences. Toujours rien. Je cale. Je finis par refaire une recherche et tomber sur la vidéo-tuto où j'avais probablement trouvé le truc la première fois. Je n'étais pas loin: il faut bien aller dans 'input controllers' (logique), mais ce n'est pas un clic droit qui me proposera de configurer les choses. Un bon vieux double-clic-qu'on-avait-oublié-depuis-l'ipad.

J'ai pris tool-increase-size-relative, mais je ne suis pas 100% convaincu. J'aurais aimé pouvoir passer de 1x1-2x2-3x3-4x4-5x5 à 6x6, au lieu de quoi j'ai le choix entre 1x1-2x2-4x4-8x8-... et 1x1-3x3-3x3-3x3-5x5-5x5-5x5-7x7-...
Bah. ça fera l'affaire au bureau, j'imagine.

Wednesday, December 04, 2019

visual ...

  • objdump equivalent in VS world is DUMPBIN. mingw objdump (elf) will not work on msvc objects (coff), and djgpp's coff tool won't work either (MS-DOS executables no longer running on 64-bit systems).
  • /GL is your archenemy if you planned any guru meditation on .obj files. It will kill about everything the file may have as meta-information, including symbol tables. How one can still link such files has not yet been researched. dumbpin will shout File Type: ANONYMOUS OBJECT at you if that flag was present when compiling.
  • If you ever see 'Rtl*' in some windows code, stop thinking about RealTech(Tek?) network cards. This is just Run Time Library, doing weirdo wrappers around standard functions such as memcpy for whatever reasons. Have a look in wdm.h or google the function name to find where it is defined.
  • it may be sensitive to MIDL_PASS, _MEMCPY_INLINE_ and _CRTBLD
  • There is no /Ldirectory_path in (my setup of?) link.exe, but it is sensitive to the %LIB% environment variable.
  • The amount of information /VERBOSE produces on link.exe explains why we don't see anything in the map file unless things went ok
  • There's no stuff & command to send stuff in the background but we can use start stuff to have the same effect
  • Speaking of linking, DUMPBIN /imports exe_or_dll is what you'll use instead of /usr/bin/nm and DUMPBIN /dependents when trying to figure out what DLL is preventing your stuff to run. Note that DLL-loading function will return the same error code whether the requested module or any of its dependencies has an issue, and that will be a 'no such file' for you, sir.
  • It looks like sysinternals is now an official MS resource for system monitoring. It's just ... Dudes, did you really had to sell its documentation ?
  • I won't ever maintain a .sln file in parallel with the SConscript that built the binary I want to debug because I know devenv /debugexe TakeOverTheWorld.exe
  • don't even try to use a Debug binary over a machine where there is no visual studio installed. It will miss its MSVCP140d.dll no matter how many attemps vcredist.x64.exe does at populating c:\windows\system32 with release dlls.
  • don't forget to disable VS Code tracking & telemetry options if you dare to use that.
  • I wish so much I had heard of c:\windows\system32\where.exe, the equivalent of /usr/bin/whereis ...
  • There's no killall, but if you have powershell running, there's taskkill /IM buggy.exe /F
  • If you want to know which #defines are still present after pre-processing your code, add /d1PP to your /P or /E switch
  • If your compiler still pretends that some symbols are undeclared while pre-processing output clearly shows they are there: that sounds like stdafx.h is messing things up. When doing a 'regular' compilation, the compiler ignores whatever #include statements you have and instead blindly use pre-compiled headers that are built only using stdafx.h !

And I still have to check the details of pdb files, dump files and remote debugging... edit: hopefully, one can invoke dumpbin from MSYS shell too. I'll just have a disasm bash function to wrap that around from now on:
disasm() {
   /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 14.0/VC/bin/amd64/dumpbin.exe -disasm $* ; 
   }