WTF Bites
-
But doesn't the shebang line mean the whole script is always executed by Perl and not by the shell in the first place?!
Only if the shebang line is read correctly. If it is not, the kernel will end up using /bin/sh as interpreter as a fallback.
Oh, interesting. I assumed it would read the perl part correctly and truncate the arguments at some point.
TIL.It was mentioned upthread that some unixes only read the first 32 bytes for the shebang line, which may cause a long path to perl to be truncated.
-
@boomzilla Sounds like you got front page material here.
Front what now?
-
So there's this dotnet project (yes, I'm running as root, shut up)
root@host:~# cd StupidProject-src/ root@host:~/StupidProject-src# ls StupidProject.csproj StupidProject.csproj.user StupidProject.sln DBConnector.cs OtherStuff.cs Program.cs
And it compiles and runs fine
root@host:~/StupidProject-src# dotnet build Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restoring packages for /root/StupidProject-src/StupidProject.csproj... Generating MSBuild file /root/StupidProject-src/obj/StupidProject.csproj.nuget.g.props. Generating MSBuild file /root/StupidProject-src/obj/StupidProject.csproj.nuget.g.targets. Restore completed in 652.42 ms for /root/StupidProject-src/StupidProject.csproj. StupidProject -> /root/StupidProject-src/bin/Debug/netcoreapp2.1/StupidProject.dll Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:04.81
now let's try to build it somewhere else
root@host:~/StupidProject-src# cd .. root@host:~# mkdir outputDir root@host:~# dotnet build -o ./outputDir/ StupidProject-src/ Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 107.83 ms for /root/StupidProject-src/StupidProject.csproj. StupidProject -> /root/StupidProject-src/outputDir/StupidProject.dll Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:02.27 root@host:~# ls outputDir/ root@host:~#
StupidProject -> /root/StupidProject-src/outputDir/
Wtf? that's not what I wanted. I clearly specified "./outputDir". That means where I am.
With an absolute path, it works. OK it's not a big deal but... how does something as basic as that fail?????
This is likely due to what the shells do on each OS, rather than some specific code we run per OS.
No it's not. The shells don't touch the "./". You must be switching to that directory yourself.
-
@boomzilla said in WTF Bites:
Got a screen shot of an excel file from customer. It shows content out to column
DNG
().How did that even fit? Even 1-pixel columns might not be enough…
-
@ixvedeusi said in WTF Bites:
kernel will end up using /bin/sh
The who now? Seriously? What's the kernel doing, executing shell scripts? Is that how things work in Linux-land?
It's down in the guts of the
exec()
family of system calls. The caller specifies a command and an argument list; the kernel needs to determine how that command needs to be called, be that as native x86, native x86_64, .net exe via mono, windows exe via wine, or some interpreter via a shebang line. Or probably some other way I'm forgetting.And as I understand the interpreter in the shebang line can itself be a shell script.
-
@anonymous234 Wait, I spoke too soon. Absolute path:
#dotnet build -o /root/outputDir/ StupidProject-src/ Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 126.75 ms for /root/StupidProject-src/StupidProject.csproj. CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/root/StupidProject-src/StupidProject.csproj] Build FAILED. CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/root/StupidProject-src/StupidProject.csproj] 0 Warning(s) 1 Error(s)
-
@ixvedeusi Welcome to Linux, enjoy your stay. Yes, the kernel function for "run binary" has a few "format decoders" that are tried to see which works (ELF, a.out, etc). One of them looks for #! and just loads the string after that. So yes, the kernel can execute scripts (and it can be extended to other arbitrary file-interpreter combinations).
This isn't as crazy as it seems: ELF files also have an "interpreter" field that gets loaded and run instead of it. It generally points to the dynamic linker (/lib/ld-linux.so.2).
Here's some other fun facts:
- There is no "run in a new process" syscall. It's always fork then exec.
- There is no "elevate permissions" or "run as root" syscall. Running as root is always done through the setuid bit.
-
@anonymous234 said in WTF Bites:
and it can be extended to other arbitrary file-interpreter combinations
$ echo '#!/bin/cat' > quine $ chmod +x ./quine $ ./quine #!/bin/cat
-
@anonymous234 said in WTF Bites:
This isn't as crazy as it seems: ELF files also have an "interpreter" field that gets loaded and run instead of it. It generally points to the dynamic linker (/lib/ld-linux.so.2).
"Not as crazy as it seems", as in "much less crazy than other things that also happen on Linux". Why the hell is linking shared libraries delegated to external applications, that the executable files have to specify themselves!?
-
@anonymous234 said in WTF Bites:
and it can be extended to other arbitrary file-interpreter combinations
$ echo '#!/bin/cat' > quine $ chmod +x ./quine $ ./quine #!/bin/cat
Or, indeed:
$ cat ./words #!/bin/bash cat "$@" | while read line do echo $line | wc -w done $ cat ./test #!/home/pleegwat/words this is a test this is another hello $ ./test 1 4 3 1
Note the
test
script is interpreted by thewords
script.
-
And then there's this little tidbit about how the
ldd
utility works:$ ldd /bin/ls linux-vdso.so.1 => (0x00007fff59d68000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fec384c4000) libcap.so.2 => /lib64/libcap.so.2 (0x00007fec382bf000) libacl.so.1 => /lib64/libacl.so.1 (0x00007fec380b5000) libc.so.6 => /lib64/libc.so.6 (0x00007fec37ce8000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fec37a86000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fec37881000) /lib64/ld-linux-x86-64.so.2 (0x000055f4895ce000) libattr.so.1 => /lib64/libattr.so.1 (0x00007fec3767c000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fec37460000) $ LD_TRACE_LOADED_OBJECTS=1 /bin/ls linux-vdso.so.1 => (0x00007ffdc7bfd000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f868c121000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f868bf1c000) libacl.so.1 => /lib64/libacl.so.1 (0x00007f868bd13000) libc.so.6 => /lib64/libc.so.6 (0x00007f868b946000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f868b6e4000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f868b4e0000) /lib64/ld-linux-x86-64.so.2 (0x00007f868c348000) libattr.so.1 => /lib64/libattr.so.1 (0x00007f868b2db000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f868b0bf000)
-
-
Finally, a phone that can last more than one day
-
@TimeBandit said in WTF Bites:
Finally, a phone that can last more than one day
My year-old S9+ habitually does two.
-
@TimeBandit And somehow they still managed to make the camera stick out.
-
My year-old S9+ habitually does two.
You're not using it to browse WTDWTF
-
@TimeBandit Why would I post to a forum on a tiny screen with an even tinier on-screen keyboard when I've got a pair of 24" monitors and a full keyboard and mouse right in front of me?
-
@Gąska Well, leaving the job out of the kernel makes sense. This way you can implement your own dynamic loader with its own rules and Linux will be happy to run it.
However having to specify the entire path to the loader in the file is pretty stupid.
-
@boomzilla said in WTF Bites:
@boomzilla Sounds like you got front page material here.
Front what now?
Obligatory.
-
@loopback0 said in WTF Bites:
@boomzilla said in WTF Bites:
@boomzilla Sounds like you got front page material here.
Front what now?
Obligatory.Does it run Linux?
-
@TimeBandit Mine lasts four usually.
-
@boomzilla said in WTF Bites:
@loopback0 said in WTF Bites:
@boomzilla said in WTF Bites:
@boomzilla Sounds like you got front page material here.
Front what now?
Obligatory.Does it run Linux?
Did anything run Linux in 2002?
-
@loopback0 said in WTF Bites:
@boomzilla said in WTF Bites:
@loopback0 said in WTF Bites:
@boomzilla said in WTF Bites:
@boomzilla Sounds like you got front page material here.
Front what now?
Obligatory.Does it run Linux?
Did anything run Linux in 2002?
I hear they had a command line interface.
-
And then there's this little tidbit about how the
ldd
utility works:$ ldd /bin/ls linux-vdso.so.1 => (0x00007fff59d68000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fec384c4000) libcap.so.2 => /lib64/libcap.so.2 (0x00007fec382bf000) libacl.so.1 => /lib64/libacl.so.1 (0x00007fec380b5000) libc.so.6 => /lib64/libc.so.6 (0x00007fec37ce8000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fec37a86000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fec37881000) /lib64/ld-linux-x86-64.so.2 (0x000055f4895ce000) libattr.so.1 => /lib64/libattr.so.1 (0x00007fec3767c000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fec37460000) $ LD_TRACE_LOADED_OBJECTS=1 /bin/ls linux-vdso.so.1 => (0x00007ffdc7bfd000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f868c121000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f868bf1c000) libacl.so.1 => /lib64/libacl.so.1 (0x00007f868bd13000) libc.so.6 => /lib64/libc.so.6 (0x00007f868b946000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f868b6e4000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f868b4e0000) /lib64/ld-linux-x86-64.so.2 (0x00007f868c348000) libattr.so.1 => /lib64/libattr.so.1 (0x00007f868b2db000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f868b0bf000)
And wasn’t there some related security vulnerability if you run
ldd
on statically linked binaries or something like that?EDIT: yeah, basically you can get
ldd
to execute arbitrary code with a custom loader.
-
I hear they had
a12 command line interface.FTFY
In typical Open Source fashion, you had multiple choices, and all of them were partly done
-
@anonymous234 said in WTF Bites:
Well someone didn't test their shit even once.
Update: I might have been looking in the wrong place
-
@anonymous234 I like how the message suggests you can use vsdbg in other ways if you don't care about helping you develop and test your application.
-
-
The HOA responded it would not pursue the charge, due to there being no by-laws to support it.
Which implies that they'd have been just fine going for it if there was an at least marginally related bylaw.
-
The HOA responded it would not pursue the charge, due to there being no by-laws to support it.
Which implies that they'd have been just fine going for it if there was an at least marginally related bylaw.
Odds that there is now?
-
-
@r10pez10 is this loss
-
FFS. The game weights in at roughly 50GB, this was after the update errored (paused?) due to insufficient space on the drive.
If it's downloading the whole damn thing again, couldn't they just delete the old version first? And if it isn't downloading the whole damn thing, what the hell is it doing?
-
@cvi for all the things I hate about Origin, I am appreciative of the fact that you can usually play games while they're downloading, whether for the first time or for updates. This is a consequence.
-
@loopback0 said in WTF Bites:
@boomzilla said in WTF Bites:
@boomzilla Sounds like you got front page material here.
Front what now?
Obligatory.I spotted this in the wild while looking into one of the applications that sits under my team.
-
@cvi
Yep. I installed it yesterday evening. Today it got an update. It said 3.05 GB. Oh fine, get on with it then. Wait no, not fine at all! Apparently it made a copy of every goddamn game file (and also promptly ran out of space... twice, before I moved everything off my poor little 120 GB drive), did some binary patching for freaking 15 minutes and then went back to normal.Anyway, played it a bit over 2 hours on my trial (up to much crafting wow), couldn't paint my Irn Man suit orange-blue and off the fuck it went. The environments are pretty, but that's all there is to it. Glorified tech demo. Not my type of things at all.
-
@pie_flavor said in WTF Bites:
@cvi for all the things I hate about Origin, I am appreciative of the fact that you can usually play games while they're downloading, whether for the first time or for updates. This is a consequence.
I'd rather wait the 15 extra minutes and avoid having to clear stuff of my drive. If it were a trivial amount (a GB here or there), I wouldn't care. But 40+GB is a bit much. Also, this time around, I didn't get the option to play while updating (I've seen it other times).
@Applied-Mediocrity said in WTF Bites:
Anyway, played it a bit over 2 hours on my trial (up to much crafting wow), couldn't paint my Irn Man suit orange-blue and off the fuck it went. The environments are pretty, but that's all there is to it. Glorified tech demo. Not my type of things at all.
Yeah, I agree. It's pretty. The gameplay isn't bad (in term of the mechanics), just not very interesting -- it's very repetitive. Not very challenging either (maybe if you unlock the higher levels? But those are rather far off).
-
@boomzilla said in WTF Bites:
@boomzilla holy fuck where did this file come from? Was it generated?
Yes, generated. By idiots.
It's basically a calendar that started on September 1st 2016 and goes to...sometime in the future. Every week day has 4 columns.
Let me guess... In, Out to Lunch, Back from Lunch, Out.
That's a nice timesheet system they've got there. 'd be a shame if anything were to happen to it...
-
@brie Hey, that's my timesheet system. Except, sensibly, each day is its own row, not adding more and more columns.
-
I am working on a project where I need to integrate a bunch of components from different departments.
Because one of the key teams still didn't get to even start, we were delivered a stub implementation (i.e. implements the same interface as the real thing, but just a tiny bit of the actual functionality) for that interface. From a department in India.
It was returning an error. It took me a couple of days to set up debugger properly (this is the first time I am working with Yocto, and the debug libraries are too big, so I needed remote debugging). Anyway, yesterday I managed to trace it. There is a function
Result createSocket(LinkType type, const LinkParams *params, Handle *handle)
The third parameter is an output one, and properly documented as such. So you call it like
Handle handle; if (OK == createSocket(type, params, &handle) { doSomethingWith(handle); … }
However inside the function (three levels deep in a helper) what happens is
arrayOfHandles[i].theHandle = handle.
arrayOfHandles
is a global array, and thetheHandle
member is declared asHandle *theHandle
.See, no dereference. No setting either. Instead of pulling a handle out of a hat and storing it in the provided location, it uses that location as a handle. Of course when the next function tries to do something on the socket, it can't be found…
Anyway, I guess I could have stopped after the word “India”…
-
C:\ had 5.6GB free. Windows says it can clean up 11.5GB of Windows Update stuff. 10.9GB free. Windows now says it can clean up 8.95GB of System Error Reporting files. 12.4GB free.
-
WTF of my day: So, we've had to search for an alternative to WhatsApp for communicating with our pupils and were sold on a similar solution which promised more stringent data protection, encryption and whathaveyou.
Nevermind that no one on their end seemingly had a thought on how to actually manage more than 10 users (let's just say that creating new users isn't done in the least possible steps) but we also have this, fresh in from today:
This is an excerpt from a chat between me and my superior - to the right are my messages.
You'll note that there are some duplicates. In fact, his message from 11:49 is duplicated about 40 times. And no, it's just not a client issue, I have this duplication on my iPhone, my iPad and the browser client.
Next, my message from 12:22h? I sent that one at 09:30h. The first one at 12:31h was actually sent at 12:40h, the next one is a duplicate from before and the last one was actually sent at 12:31h.
Jesus Christ.
-
@boomzilla said in WTF Bites:
@boomzilla holy fuck where did this file come from? Was it generated?
Yes, generated. By idiots.
It's basically a calendar that started on September 1st 2016 and goes to...sometime in the future. Every week day has 4 columns.
Let me guess... In, Out to Lunch, Back from Lunch, Out.
That's a nice timesheet system they've got there. 'd be a shame if anything were to happen to it...
No.
-
@HardwareGeek said in WTF Bites:
@brie Hey, that's my timesheet system. Except, sensibly, each day is its own row, not adding more and more columns.
I was assuming that rows were employees.
Really it wouldn't be an outrageously terrible system if two conditions were met: hard copies of everything, and instead of going to infinity and beyond, it should be split up - one month per sheet, twelve sheets (one year) per workbook.
-
-
Jesus Christ.
Status: Still looking for a replacement.
I heard a cow is an excellent substitute.
-
-
Jesus Christ.
Status: Still looking for a replacement.
-
@Rhywden So I took a look at some contenders which proclaimed offer self-hosting (data privacy and all that jazz, after all, we can't very well proclaim to replace WhatsApp and promptly hand over data to someone else in turn), namely Matrix.org and XMPP.
Well, Matrix.org is something where you cannot see anyone else without joining their "federation", at least not in the default settings or any kind of setting I could easily discover. So you joined a chat program but cannot chat to anyone but yourself. Yay. Also, their mobile client for Android and iOS is called "Riot" (very professional!) and has different capability levels. For instance, on the Android client I can upload pictures, videos and files. On iOS? Only pictures and videos. But I can access files if they were uploaded through an Android client.
I'm not sure why uploading files is such a horrendous problem compared to photos. And, of course, we have the professional level "let's navigate the app to this white screen with no way to navigate back!" options which I found twice throughout the app.So, that one's a no-go.
And then there's XMPP. Well, the first server I installed (Prosody) told me that it was running but did not let anyone connect to it. Ports were open, SSL configured correctly, the logs said: "Okay! Everything is fine!" but the clients said: "Nay."
Which is where I found one of those XMPP clients to be a massive PITA. Because if you get something wrong (or the server is unreachable or something) you'll be presented with an obnoxious error message. Repeated in 3 second intervals (at least non-blocking, but seriously!) ad infinitum.
Okay, scratch that one, on to EJabberd. Installed fine, the clients were also able to connect. Soooo. Where are the users? Yeah, turns out that you have to fill your contact list manually or something. Though there may be a way to allow contact queries. But I wasn't able to make heads or tails out of their configuration scheme for the access rights.
So I may be forced to implement our own chat solution. Thankfully, the user administration and access levels side is already solved, I just need to connect to our local LDAP and get the stuff from there. I'll have a look at databases which have some kind of Pub/Sub scheme in there to facilitate the chat part. Basically that app only needs four pages - one for the contact list, one for the (group) chats, one for settings and a login page.
-
@Rhywden Imagine a school-wide Discord server. Or Slack if you've got that self-hosting boner.