code logs -> 2017 -> Sun, 09 Jul 2017< code.20170708.log - code.20170710.log >
--- Log opened Sun Jul 09 00:00:15 2017
00:00 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
00:00 mode/#code [+qo Vornicus Vornicus] by ChanServ
00:02
<&McMartin>
The part I have the most trouble with in that article is actually at the very beginning; I'm unclear as to why the initial empty template is necessary
00:03
<&McMartin>
Otherwise I follow it fine, which may not say much...
00:03
<&McMartin>
... because the codebase I've been working on for the past 2 years includse a class very like your event broadcaster, written by me, early on in that 2 years.
00:03
<&McMartin>
So that code looked fine~
00:05
< RchrdB>
...has anyone tried programming on a device that resembles an MS Surface?
00:05
<&McMartin>
Surface or Surface Pro?
00:06 * RchrdB looks up the difference
00:06
<&McMartin>
"The one that actually runs Windows", which includes Surface 3 on
00:06
<&McMartin>
As opposed to the one running Windows RT on ARM.
00:06
<~Vornicus>
I've done some on a surface. the on screen keybaord is big enough to actualy use as a keyboard but is missing all the good nav buttons
00:06
< RchrdB>
does Win10 run on ARM these days?
00:07
<&McMartin>
I have run MSVS2012 on a Surface Pro 3 with an attached keyboard before.
00:07
<&McMartin>
But mostly as a stunt
00:07
<&McMartin>
But it was able to chew through a very sizable project.
00:08
<&McMartin>
But the Surface Pro 3 is Actually A Laptop.
00:08
< RchrdB>
My current laptop is somewhat fucked; keyboard's terrible and it has atrocious cooling problems such that its fans sound like an aircraft taking off pretty much all the time it's switched on
00:08
<&McMartin>
And to my knowledge, Win10 itself does not run on ARM, but there's some kind of "Win10 IoT edition" thing I know very little about.
00:09
< RchrdB>
so now I'm wondering if it's possible to get something which, I guess ideally I'd like a tiny computer with an Atom or a high-end ARM in it?
00:09
<&McMartin>
Ah, I see.
00:10
<&McMartin>
The Surface Pros straight-up have Cores.
00:10
< RchrdB>
something with a 10W or less TDP that can go fanless, which AFAIK is one of the things that the Surface did
00:10
<&McMartin>
But it seems like this product line has diversified since I last looked at it.
00:10
<&McMartin>
And I don't know if the Pros can actually go fanless, since, as noted, they've got Cores~
00:11
< RchrdB>
AFAIK they've got super low-voltage low-frequency versions with ~5W TDPs
00:11
<&McMartin>
Hmm. Looks like.
00:12
<&McMartin>
"m3-7Y30: 1.0 up to 2.6GHz, 4 MB cache, 4.5 W"
00:12
<&McMartin>
I don't know about the Core m-series, tbh
00:12
<~Vornicus>
I love how everybody else is talking about the power and I'm all "i cannot without pgdn"
00:12
<&McMartin>
I think the SP3 I had tested back in '14 was an i5.
00:12
<~Vornicus>
And I'm not even a command line jockey
00:13
<&McMartin>
I don't use PgDn on commandlines much.
00:13
<&McMartin>
But that wasn't his question!
00:13
< RchrdB>
according to ark.intel.com, the m3-whatever runs at about 5W and the low-power i5 runs at about 15W.
00:13
<~Vornicus>
well no, but
00:13
<&McMartin>
That is matching the specs on the Wiki page.
00:13
<&McMartin>
So it sounds like if you did rock this, you would definitely need the m3 version
00:14
<&McMartin>
Surface Pro 4, m3 version would be the closest in that line to what you want, but I've never run development environments on that chip with any OS
00:15
<&McMartin>
Aha!
00:15
<&McMartin>
Also, the m3 model is fanless, and the i-series ones are not.
00:15
<&McMartin>
How hardcore development are we talking here?
00:16
<&McMartin>
As long as the project size is measured in KLOC instead of MLOC I don't see how 900Mhz wouldn't be basically enough
00:16
<&McMartin>
(The project from 2014 in question was about 2 MLOC, because Qt and Boost)
00:20
< RchrdB>
well… don't know
00:20
<&McMartin>
I have, for about a decade now, preferred to do my heavy dev on i7-based machines, but any i7 CPU will fail your basic requirements.
00:21
< RchrdB>
I remember using a laptop with 32MB of RAM and I think a Pentium1 to learn computer science back in uni :)
00:21
<&McMartin>
Man, that was my *desktop* back in Uni. 120MHz.
00:21
< RchrdB>
alas, everything got big since then
00:22
<&McMartin>
I ran Borland Turbo C++ and Allegro Common Lisp on it.
00:22
<&McMartin>
The former was a DOS program, but that's OK, because Win95.
00:23
< RchrdB>
you probably still could under dosbox ;)
00:23
<&McMartin>
Can and have.
00:23
< RchrdB>
that reminds me
00:23
<&McMartin>
https://bumbershootsoft.wordpress.com/category/retrocoding/dos/
00:24
<&McMartin>
Technically that's Turbo C, because that's the one that's the free download now.
00:34
< Jessikat>
McMartin: this one was more of a 'how you do this thing' than a 'why it works'
00:34 * McMartin nods
00:34
< Jessikat>
the unimplemented template is so that you can write thing<one_template_param>
00:34
< Jessikat>
but the specialisation is the thing that's implemented, which matches on return_type(params...)
00:34
< Jessikat>
and gives names to them by the way it's formulated, so you can use them for operator(_)
00:35
< Jessikat>
oeprator()*
00:35
< RchrdB>
gah macbooks are expensive
00:35
< Jessikat>
some of these blog posts are going to be so I don't forget the things in future x)
00:39 * TheWatcher does a first pass at documentation for Killbot, decides it is time to qwertyface
00:40
<@TheWatcher>
(TODO item #2: world domination)
00:45
< RchrdB>
christ a midrange android tablet would beat this laptop for actual usage right now
00:45
< RchrdB>
this thing is wrecked
00:52
<&McMartin>
... killbot?
00:53
<&McMartin>
And yes, never pay the Mac Tax except under duress
00:53
<&McMartin>
You can *always* get more for less, unless the specific thing you need is OSX or applications that run only on it
00:53
<&McMartin>
... which is basically XCode
00:53
< RchrdB>
but they're so shiny
00:54
< RchrdB>
and everything else has shit physical build quality (not that theirs is perfect either)
00:55
< RchrdB>
and 99% of everything else comes with Windows 10 ☹
00:56
< RchrdB>
I only know of one place in the UK that sells laptops which don't have mandatory Windows on them
00:56
< RchrdB>
other than Apple I mean
01:00
<&McMartin>
Today in Programs That Didn't Work: https://i1.wp.com/bumbershootsoft.files.wordpress.com/2017/07/riscos_16_not_colo rbars.png
01:01
<&McMartin>
(Expected behavior: https://i0.wp.com/bumbershootsoft.files.wordpress.com/2017/07/riscos_15_colorbar s.png )
01:03
<~Vornicus>
whups
01:55 RchrdB [RchrdB@Nightstar-qe9.aug.187.81.IP] has quit [Ping timeout: 121 seconds]
02:34 Jessikat [Jessica@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
04:46
<&[R]>
Okay, I'm compiling some old code I used to work on, it seems C has changed a bit since I last compiled it
04:46
<&McMartin>
How old is this code
04:46
<&[R]>
One of the things it does, is pass a pointer to a struct via va_args
04:46
<&[R]>
Less than 10 years, but close to that
04:46
<&[R]>
This struct has a union inside of it
04:46
<&McMartin>
Are you now compiling 64-bit instead of 32
04:47
<&[R]>
Attempting to access the union results in a segfault
04:47
<&[R]>
Yes
04:47
<&McMartin>
Are you sure you're consuming the entire pointer
04:47
<&McMartin>
(Try logging the pointer values you are passing in and the ones you are receiving.)
04:47
<&[R]>
I have a printf that gives me the mem address before sending it and on recieving it
04:48
<&[R]>
They match up
04:48
<&McMartin>
How about the address of the union
04:48
<&McMartin>
Like, this should in fact work
04:48
<&[R]>
(gdb) print nd
04:48
<&[R]>
$4 = (struct npc_data *) 0x7ffffff7
04:48
<&[R]>
(gdb) print nd->u
04:48
<&[R]>
Cannot access memory at address 0x8000005f
04:48
<&[R]>
If that helps any
04:49
<&[R]>
Note: this is my first time ever using gdb or any debugger
04:49
<&McMartin>
What's offsetof(npc_data, u)?
04:49
<&McMartin>
Also, um
04:49
<&McMartin>
Isn't it supposed to be nd->u.something?
04:50
<&McMartin>
offsetof(u) here looks like it would be 0x60, and you are crossing a page boundary there
04:50
<&McMartin>
Which is kind of unusual, ime
04:50
<&[R]>
(gdb) print nd->u.scr
04:50
<&[R]>
Cannot access memory at address 0x8000005f
04:50
<&McMartin>
k
04:50
<&[R]>
Program received signal SIGSEGV, Segmentation fault.
04:50
<&[R]>
0x00000000004955de in npc_convertlabel_db (key=0x531657d, data=0x26, ap=0x7fffffffc1f8) at /root/tmw/eathena/src/map/npc.c:1308
04:50
<&[R]>
1308lst=nd->u.scr.label_list;
04:50
<&[R]>
Also VM
04:51
<&McMartin>
The address of nd looks kind of suspect to me, tbh
04:53
<&McMartin>
But I'd see if I couldn't put together a small example of this to try to repro it.
04:54
<&McMartin>
As long as both caller and callee were compiled at the same time, and you aren't linking against ancient objects, this "should" be fine.
04:54
<&McMartin>
But I bet the main issue is that this code isn't 32-bit clean somewhere else.
04:54
<&McMartin>
Can you compile with the -m32 flag across the board?
04:54
<&[R]>
New run: 000000007FFFFFEF is the output of printf("%016X", nd) before sending it.
04:54
<&[R]>
(gdb) print nd
04:54
<&[R]>
$1 = (struct npc_data *) 0x7fffffef
04:55
<&[R]>
Can try
04:55
<&McMartin>
Before you do though
04:55
<&McMartin>
Try accessing that union's valuse *before* the call
04:55
<&McMartin>
If it breaks before the call, it's not va_args's fault, for sure.
04:56
<&[R]>
I can, it actually gets filled a few instructions prior though
04:56
<&[R]>
I'm missing headers and such for compiling 32bit, and my distro's website is down
04:56
<&McMartin>
Boo.
04:57
<&McMartin>
Is this open-source/published somewhere?
04:59
<&McMartin>
Try checking the value of that union's members just before calling. It sounds a whole lot like something's scribbling over bits of stack it shouldn't.
05:00
<&McMartin>
Or straight-up freeing memory that's in use with something like brk(), but that seems vanishingly unlikely.
05:00
<&[R]>
It's open source yeah, I can upload the code for you, one sec
05:00
<&[R]>
Though one thing that's confusing me right now, is one line of my debugging code isn't being called on the segfaulting run
05:01
<&McMartin>
Really not being called or not getting a chance to be flushed out of stdout's buffers?
05:01
<&[R]>
00000000052B7E18 - 00000000052B7DB0: 00000000052B7DB0
05:01
<&[R]>
000000007FFFFFDC
05:01
<&[R]>
Program received signal SIGSEGV, Segmentation fault.
05:01
<&[R]>
Two lines are output...
05:01
<&[R]>
// This is the calling environment
05:01
<&[R]>
printf("%016X - %016X: ", &(nd->u), nd);
05:01
<&[R]>
strdb_foreach(label_db,npc_convertlabel_db,nd);
05:02
<&[R]>
// This is inside the function where it segfaults
05:02
<&[R]>
printf("%016X\n", nd);
05:02
<&[R]>
fflush(stdout);
05:02
<&[R]>
npc_convertlabel_db is the function that segfaults
05:03
<&[R]>
http://rpgb.nobl.ca/npc.c.txt
05:03
<&[R]>
#0 0x00000000004955ee in npc_convertlabel_db (key=0x531657d, data=0x26, ap=0x7fffffffc1f8) at /root/tmw/eathena/src/map/npc.c:1309
05:03
<&[R]>
#1 0x00000000004f47cc in db_foreach (table=0x52a7120, func=0x4954f1 <npc_convertlabel_db>) at /root/tmw/eathena/src/core/db.c:443
05:03
<&[R]>
#2 0x0000000000496077 in npc_parse_script (w1=0x7fffffffcac0 "001-1.gat,0,0,0", w2=0x7fffffffcec0 "script", w3=0x7fffffffd2c0 "Mob001-1", w4=0x7fffffffd6c0 "-1,{", first_line=0x7fffffffdef0 "-1,{\n", fp=0x526afb0, lines=0x7fffffffdecc)
05:03
<&[R]>
at /root/tmw/eathena/src/map/npc.c:1507
05:03
<&[R]>
#3 0x0000000000497f65 in do_init_npc () at /root/tmw/eathena/src/map/npc.c:2069
05:03
<&[R]>
#4 0x0000000000482995 in do_init (argc=1, argv=0x7fffffffe478) at /root/tmw/eathena/src/map/map.c:1945
05:03
<&[R]>
#5 0x00000000004f36c6 in main (argc=1, argv=0x7fffffffe478) at /root/tmw/eathena/src/core/core.c:123
05:03
<&[R]>
Stack trace for line numbers
05:05
<&[R]>
Sending you the full source tree is a little more involved
05:05
<&McMartin>
I cannot help but notice that the strings "va_start" and "va_end" appear nowhere in this listing.
05:06
<&McMartin>
Those might have been no-ops in your old compiler, and perhaps they no longer are.
05:06
<&[R]>
I think that might be in db_foreach
05:07
<&McMartin>
I am looking specifically at npc_enable_sub.
05:07
<&[R]>
Actually, they'd have to be in the given functions wouldn't there?
05:07
<&McMartin>
Unless nullpo_retr is a macro and calls it, which seems unlikely given its other usages...
05:08
<&[R]>
nullpo_retr checks for null and will abort the function with a message to console.
05:42 Turaiel[Offline] is now known as Turaiel
05:48
<&McMartin>
Bringing the conversation back here: Looks like the issue is "code isn't 32-bit clean"
06:00
<&[R]>
BTW, is doing stuff like: typedef struct {} Name; bad form at all in C? IIRC somepeople didn't like it, but I forget their rant
06:01
<&McMartin>
That's always been standard for me
06:01
<&McMartin>
Exactly as written, empty structs are iffy, and nameless structs can't be made recursive, which is sometimes a bummer.
06:06
<&[R]>
I meant as non-empty
06:06 Turaiel is now known as Turaiel[Offline]
06:06
<&[R]>
But good to know
06:07
<&[R]>
Actually, question, why does gdb automatically have a break point on core.c:103?
06:09
<&McMartin>
Not offhand. That sounds odd.
06:10
<&[R]>
It's the first non-variable declaration line in main() if that matters any
06:10
<&McMartin>
Oh.
06:10
<&McMartin>
The program doesn't start automatically.
06:12
<&[R]>
That too
06:12
<&[R]>
But I have to do a "start" then a "continue" because of the automatic breakpoint
06:12
<&McMartin>
OK, I did not see that in my build
06:12
<&McMartin>
I just did "run"
06:13
<&[R]>
Weirdness
06:18
<&McMartin>
Aha
06:18
<&McMartin>
"start" and "run" are not the same thing
06:18
<&McMartin>
Start is "begin execution and stop immediately"
06:18
<&[R]>
Ah
06:21
<&[R]>
Is there a way to say in code "have a breakpoint here for a debugger"?
06:22
<&[R]>
... actually I should probably just look up a tutorial
06:31 celticminstrel [celticminst@Nightstar-cn2je9.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:07 Jessikat [Jessikat@Nightstar-0fcdb4.dab.02.net] has joined #code
07:37 Kindamoody[zZz] is now known as Kindamoody
08:14
<&McMartin>
https://bumbershootsoft.wordpress.com/2017/07/09/project-mehitabel-graphics/
09:11 Jessikat` [Jessikat@Nightstar-o8kjr4.dab.02.net] has joined #code
09:14 Jessikat [Jessikat@Nightstar-0fcdb4.dab.02.net] has quit [Ping timeout: 121 seconds]
11:09 Kindamoody is now known as Kindamoody|afk
11:13 Jessikat [Jessica@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
15:12 Jessikat [Jessica@Nightstar-bt5k4h.81.in-addr.arpa] has quit [Ping timeout: 121 seconds]
15:40 celticminstrel [celticminst@Nightstar-cn2je9.dsl.bell.ca] has joined #code
15:40 mode/#code [+o celticminstrel] by ChanServ
15:41 Jessikat [Jessikat@Nightstar-kp04tl.dab.02.net] has joined #code
15:44 Jessikat` [Jessikat@Nightstar-o8kjr4.dab.02.net] has quit [Ping timeout: 121 seconds]
16:33 Jessikat [Jessikat@Nightstar-kp04tl.dab.02.net] has quit [[NS] Quit: Bye]
17:08 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
17:30 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
17:30 mode/#code [+qo Vornicus Vornicus] by ChanServ
17:44 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
18:02 Jessikat [Jessica@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
18:09 * [R] glares at gcc
18:09
<&[R]>
Thank you for erroring on your freaking massively long compile
18:10
<&[R]>
Because you were looking for cpp in /lib/
18:10
<&[R]>
WHY ARE YOU FUCKING LOOKIGN THERE?
18:19 Alek [Alek@Nightstar-7or629.il.comcast.net] has quit [Ping timeout: 121 seconds]
18:23 Alek [Alek@Nightstar-7or629.il.comcast.net] has joined #code
18:23 mode/#code [+o Alek] by ChanServ
19:03 Derakon [Derakon@Nightstar-fr5qel.ca.comcast.net] has joined #code
19:03 mode/#code [+ao Derakon Derakon] by ChanServ
19:03
<&Derakon>
"I put my pants on through lazily evaluated iterative deepening. I don't actually have any pants on until someone would notice I'm not wearing any."
21:30
< Jessikat>
XD
21:32
<&[R]>
Jessikat: how'd it go with your reading floppy mission?
21:36
< Jessikat>
oh! about 2/3 of them are readable, the most interesting thing I found was a firefox bookmarks list circa 2002
21:38
<&[R]>
Nice
22:45
< Jessikat>
oh, and a zip file named sonic2.zip that I've not looked inside yet
22:45
< Jessikat>
for fear of what I might find
23:17
<@celticminstrel>
Heh.
23:17
<@celticminstrel>
At both.
23:28 Kindamoody|afk is now known as Kindamoody
23:52
<@Azash>
[R]: The pleasure of an install dying because it had -Werror and an unused variable (!) In There Somewhere(tm)
23:52
<&[R]>
Heh
23:52
<&[R]>
Seriously though
23:52
<&[R]>
I've been trying to compile GCC for almost 20 hours now
23:53
<&McMartin>
gcc is very finicky about which version of gcc you use to compile it.
23:53
<&[R]>
32bit one failed, but I think I need a newer kernel and relevant headers for that.
23:54
<@Azash>
Oh dear
23:54
<&[R]>
I'm noticing
23:54
<@Azash>
I thought you were just griping normally but
23:54
<&McMartin>
As I learned talking to the dude next to me on the plane last week: this was an explicit decision by the gcc steering committee
23:54 Kindamoody is now known as Kindamoody[zZz]
23:54
<&McMartin>
They had tired of insisting on working on All The Compilers
23:54
<&[R]>
Seriously?
23:54
<&[R]>
WHY?
23:55
<&McMartin>
Because in 2000 they still had to use K&R style and avoid function prototypes because not all compilers accepted them
23:55
<&[R]>
I don't want to have to chain through 50 versions of GCC just to update an old install
23:55
<&McMartin>
And they were tired of that and felt it stalled continuing development.
23:55 starkruzr [quassel@Nightstar-9848jp.fios.verizon.net] has quit [Ping timeout: 121 seconds]
23:57
<&McMartin>
It's more open than that
23:57
<&[R]>
Oh, so it's not "specific versions of GCC are required" it's "we need compilers that are at least slightly modern now"
23:57
<&McMartin>
It's in between that.
23:58
<&McMartin>
The thing I had complained about that set this off was that there was an SDK I was using that packaged its own GCC
23:58
<&McMartin>
And the compiler in Ubuntu 12.04 worked, and the compiler Ubuntu 16.04 did not.
23:58 * [R] is going 4.5.0 to 5.4.0
23:58
<&McMartin>
I was put out by this because my desktop computer is 8 years old
23:58
<&McMartin>
And a 4 year difference seems minor
23:59
<&McMartin>
But "it's based on Debian" does funny things to that.
--- Log closed Mon Jul 10 00:00:16 2017
code logs -> 2017 -> Sun, 09 Jul 2017< code.20170708.log - code.20170710.log >

[ Latest log file ]