Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old October 23, 2016, 22:27   #11
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,015
Donated: $40
Pete Mack is on a distinguished road
An ordinary debug build will expose the bugs. It just won't label them for you. I believe CLANG is fully compatible with gcc make files.
Pete Mack is offline   Reply With Quote
Old October 24, 2016, 13:52   #12
t4nk
Adept
 
Join Date: May 2016
Posts: 246
t4nk is on a distinguished road
Quote:
Originally Posted by Nick View Post
If someone tells me how to do a sanitize build I will be happy to do this - bonus points for answers that don't involve completely changing the build system

Failing that, I can spam earthquake traps until one of them does the appropriate thing.
I recall you use Linux? I think "./configure CLFAGS=-fsanitize=address LDFLAGS=-fsanitize=address [OTHER_OPTIONS]..." should work (if your compiler supports those, which I guess it does).
Although, I still don't know how Angband's build system works and just use makefiles
edit: (OTHER_OPTIONS are standard Angband's options, like --disable-curses, etc).
t4nk is offline   Reply With Quote
Old October 24, 2016, 14:54   #13
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,262
AnonymousHero is on a distinguished road
For ASAN/UBSAN/etc. IIRC what you need to do is to avoid use of "ld" for the linking step (just use "cc" or "clang" instead) and to get the -fsanitize flags into the compiler flags.

The "ld" thing is needed because ASAN/etc. need to link with libraries which won't be included if you use "ld".
AnonymousHero is offline   Reply With Quote
Old October 24, 2016, 14:57   #14
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,262
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
An ordinary debug build will expose the bugs. It just won't label them for you. I believe CLANG is fully compatible with gcc make files.
This is incorrect. ASAN and UBSAN will find a huge number of bugs[1] that debug builds don't. (In fact, debug builds usually won't actually expose any more bugs, per se, although they might just by virtue of having a lower level of optimization.)

You pay for it with lower performance (usually anything from 1.5x-3x, sometimes even worse), but it shouldn't be a big deal. It's certainly nothing like as bad as valgrind.

[1] Assuming that there are in fact any bugs to be found.
AnonymousHero is offline   Reply With Quote
Old October 24, 2016, 16:50   #15
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,015
Donated: $40
Pete Mack is on a distinguished road
Debug builds set all values to 0xeeeeeeee in freed memory, and detects duplicate frees. It is a big win compared to, say, O2 for finding memory errors
Pete Mack is offline   Reply With Quote
Old October 24, 2016, 17:38   #16
kandrc
Adept
 
Join Date: Dec 2007
Posts: 163
kandrc is on a distinguished road
I hit the following (character was dead):

Code:
Program received signal SIGSEGV, Segmentation fault.
0x00000000004df521 in dice_reset (dice=0x7320707520666f20) at z-dice.c:165
165             dice->b = 0;
(gdb) print dice
$1 = (dice_t *) 0x7320707520666f20
(gdb) bt
#0  0x00000000004df521 in dice_reset (dice=0x7320707520666f20) at z-dice.c:165
#1  0x00000000004df6a2 in dice_free (dice=0x7320707520666f20) at z-dice.c:216
#2  0x00000000004197fd in free_effect (source=0x8864b8) at effects.c:4248
#3  0x000000000043337f in cleanup_curse () at init.c:1349
#4  0x00000000004800a2 in cleanup_parser (fp=0x7413a0 <curse_parser>)
    at parser.c:690
#5  0x000000000043d350 in cleanup_arrays () at init.c:5116
#6  0x000000000043d443 in cleanup_angband () at init.c:5203
#7  0x00000000004e6425 in main (argc=1, argv=0x7fffffffdc48) at main.c:538
This is in master with last commit tagged 76734a1717075a3cea7cdcb0326210967527d655.
kandrc is offline   Reply With Quote
Old October 24, 2016, 20:02   #17
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,449
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by t4nk View Post
I recall you use Linux? I think "./configure CLFAGS=-fsanitize=address LDFLAGS=-fsanitize=address [OTHER_OPTIONS]..." should work (if your compiler supports those, which I guess it does).
Although, I still don't know how Angband's build system works and just use makefiles
edit: (OTHER_OPTIONS are standard Angband's options, like --disable-curses, etc).
Thank you - I was having trouble getting the flags to work.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old October 25, 2016, 06:00   #18
t4nk
Adept
 
Join Date: May 2016
Posts: 246
t4nk is on a distinguished road
In player-calcs.h, PR_INVEN and PR_MAP have exactly the same value:
Code:
#define PR_MAP			0x00010000L	/* Redraw whole map */
#define PR_INVEN		0x00010000L /* Display inven/equip */
All updates to inventory try to redraw the map, and vice versa.
t4nk is offline   Reply With Quote
Old October 25, 2016, 06:50   #19
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,449
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by t4nk View Post
In player-calcs.h, PR_INVEN and PR_MAP have exactly the same value:
Code:
#define PR_MAP			0x00010000L	/* Redraw whole map */
#define PR_INVEN		0x00010000L /* Display inven/equip */
All updates to inventory try to redraw the map, and vice versa.
Yeah, that's a bit embarrassing. Fixed in latest master.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old October 25, 2016, 08:37   #20
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 1,383
Ingwe Ingweron is on a distinguished road
In latest nightly, when Sauron is killed, the stairs appear, but items that had fallen in the spot "disappear" according to the messages, rather than the items being shifted to a new spot on the floor.
__________________
“We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.”
― Tom Stoppard, Rosencrantz and Guildenstern are Dead
Ingwe Ingweron is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sil 1.1.1 no-artefacts, polearm master bron AAR 21 August 27, 2013 23:42
3x Breaking and Entering by Anaxe the Master Thief Thraalbee AAR 0 August 26, 2011 21:42
Artifacts in 3.2 (Master List) Tregonsee Vanilla 8 March 6, 2011 11:33
State of Angband master branch d_m Development 80 November 26, 2010 14:14
squelch comments/complaints ChodTheWacko Vanilla 2 July 28, 2007 17:50


All times are GMT +1. The time now is 07:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.