Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Variants (http://angband.oook.cz/forum/forumdisplay.php?f=4)
-   -   [Announce] FrogComposband 7.1.salmiak released (http://angband.oook.cz/forum/showthread.php?t=10152)

backwardsEric January 11, 2022 18:22

Quote:

Originally Posted by lea2501 (Post 156975)
Code:

v ~/src/frogcomposband [master]
lea@openbsd > ./src/frogcomposband -uUser -mgcu -- -n1
./src/frogcomposband: Unable to prepare any 'display module'!
x ~/src/frogcomposband [master]
lea@openbsd > ./src/frogcomposband -uUser
./src/frogcomposband: Unable to prepare any 'display module'!
x ~/src/frogcomposband [master]
lea@openbsd > ./src/frogcomposband
./src/frogcomposband: Unable to prepare any 'display module'!


When I compiled it on OpenBSD 6.9, it did not recognize the installed version of ncurses by default but did recognize the X11 libraries which were also installed. Adding "--with-ncurses-prefix=/usr LIBS=-lncurses" to the options to configure let it build the curses front end. That worked, at least as far as getting to the splash screen and the prompt for what sort of game to start.

lea2501 January 11, 2022 18:32

Quote:

Originally Posted by backwardsEric (Post 156976)
When I compiled it on OpenBSD 6.9, it did not recognize the installed version of ncurses by default but did recognize the X11 libraries which were also installed. Adding "--with-ncurses-prefix=/usr LIBS=-lncurses" to the options to configure let it build the curses front end. That worked, at least as far as getting to the splash screen and the prompt for what sort of game to start.

It managed to compile like this:
Code:

$ ./configure --prefix $HOME/.frogcomposband --with-ncurses-prefix=/usr LIBS=-lncurses --without-x --with-no-install CFLAGS="-DSGI -DULTRIX"
But then i get this (new) error:
Code:

x ~/src/frogcomposband [master]
lea@openbsd > ./src/frogcomposband -uUser
./src/frogcomposband: Fatal Error.


backwardsEric January 11, 2022 18:55

The "Fatal Error." means it didn't find the lib directory. Check the output of configure to see what it said the "lib path" would be. I suspect that configure wants the LIBS= option at the end of the command line (after any of the --with, --without, --enable, --prefix, ...) and ignored the --with-no-install.

smbhax January 11, 2022 19:52

Quote:

Originally Posted by backwardsEric (Post 156917)
This also worked for Angband:

Code:

./configure --with-no-install --with-ncurses-prefix=/usr LIBS=-lncurses

Aha! That one solves the ncurses5/6 detection problem on Cygwin. Thanks! : D

GrimaTheBold January 12, 2022 19:01

A quick Ninja question - is there any downside to adding light sources as long as they're offset by darkness sources?

I have a Feanoran Lamp of Darkness which decreases light by 3. Is there any penalty to using Sting, or an Amulet with Lu, as long as they are still offset by the -3 on the Lamp and I'm not getting the "Icky light" message? Is there a benefit to having a larger negative light (darkness)?

Sideways January 12, 2022 22:26

Quote:

Originally Posted by GrimaTheBold (Post 156997)
A quick Ninja question - is there any downside to adding light sources as long as they're offset by darkness sources?

No, actually negative total light simply gets rounded up to no light. As long as any light gets offset by darkness, you're good.

mariari January 16, 2022 21:31

I got the game to compile fine on Linux, however it seems if I try to press !, or { (inscribe then select any item) the game crashes with the message given in the below code snippet .

Note this happens both with the master branch on github and the 7.1 salmiak release. Does anyone know if there is some library mismatch or any way to solve or better report this issue?

Code:

2 katya@Babylon-4:~/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak % ./frogcomposband
=================================================================
==3746037==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe9fbb8ec0 at pc 0x555c18d6a3a2 bp 0x7ffe9fbb8c70 sp 0x7ffe9fbb8c60
WRITE of size 1 at 0x7ffe9fbb8ec0 thread T0
    #0 0x555c18d6a3a1 in askfor_aux /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/util.c:2720
    #1 0x555c18d6abbc in askfor /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/util.c:2904
    #2 0x555c18a85133 in _inscriber /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/obj.c:979
    #3 0x555c18a9cb97 in obj_prompt /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/obj_prompt.c:147
    #4 0x555c18a85555 in obj_inscribe_ui /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/obj.c:999
    #5 0x555c1884cb35 in _dispatch_command /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:4031
    #6 0x555c1884e516 in process_command /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:4499
    #7 0x555c18853232 in process_player /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:5018
    #8 0x555c1885793c in dungeon /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:5432
    #9 0x555c18860566 in play_game /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:6464
    #10 0x555c18e8adbe in main /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/main.c:779
    #11 0x7f9e56cfeb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
    #12 0x555c1863fa5d in _start (/home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/frogcomposband+0x1d6a5d)

Address 0x7ffe9fbb8ec0 is located in stack of thread T0 at offset 128 in frame
    #0 0x555c18a84d6b in _inscriber /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/obj.c:959

  This frame has 2 object(s):
    [48, 128) 'insc' (line 966) <== Memory access at offset 128 overflows this variable
    [160, 415) 'name' (line 965)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/util.c:2720 in askfor_aux
Shadow bytes around the buggy address:
  0x100053f6f180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100053f6f190: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 04 f2
  0x100053f6f1a0: 04 f2 00 00 00 00 00 00 00 00 00 00 00 00 04 f3
  0x100053f6f1b0: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
  0x100053f6f1c0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 00 00
=>0x100053f6f1d0: 00 00 00 00 00 00 00 00[f2]f2 f2 f2 00 00 00 00
  0x100053f6f1e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100053f6f1f0: 00 00 00 00 00 00 00 00 00 00 00 07 f3 f3 f3 f3
  0x100053f6f200: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
  0x100053f6f210: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f2 00 00
  0x100053f6f220: 00 00 00 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:          00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:      fa
  Freed heap region:      fd
  Stack left redzone:      f1
  Stack mid redzone:      f2
  Stack right redzone:    f3
  Stack after return:      f5
  Stack use after scope:  f8
  Global redzone:          f9
  Global init order:      f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:          fe
  Left alloca redzone:    ca
  Right alloca redzone:    cb
  Shadow gap:              cc

2 1 katya@Babylon-4:~/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak % ./frogcomposband
=================================================================
==3746105==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc69e3ad40 at pc 0x55f9d91b63a2 bp 0x7ffc69e3aae0 sp 0x7ffc69e3aad0
WRITE of size 1 at 0x7ffc69e3ad40 thread T0
    #0 0x55f9d91b63a1 in askfor_aux /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/util.c:2720
    #1 0x55f9d91b6bbc in askfor /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/util.c:2904
    #2 0x55f9d91b6c02 in get_string /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/util.c:2932
    #3 0x55f9d8bb00bc in do_cmd_pref /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/cmd4.c:1770
    #4 0x55f9d8c997ea in _dispatch_command /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:4275
    #5 0x55f9d8c9a516 in process_command /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:4499
    #6 0x55f9d8c9f232 in process_player /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:5018
    #7 0x55f9d8ca393c in dungeon /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:5432
    #8 0x55f9d8cac566 in play_game /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/dungeon.c:6464
    #9 0x55f9d92d6dbe in main /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/main.c:779
    #10 0x7f0617c3ab24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
    #11 0x55f9d8a8ba5d in _start (/home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/frogcomposband+0x1d6a5d)

Address 0x7ffc69e3ad40 is located in stack of thread T0 at offset 128 in frame
    #0 0x55f9d8baffdc in do_cmd_pref /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/cmd4.c:1763

  This frame has 1 object(s):
    [48, 128) 'buf' (line 1764) <== Memory access at offset 128 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/katya/Desktop/Games/Rogue/Angband/frogcomposband/frogcomposband-7.1.salmiak/src/util.c:2720 in askfor_aux
Shadow bytes around the buggy address:
  0x10000d3bf550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000d3bf560: 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 04 f2 04 f2
  0x10000d3bf570: 00 00 00 00 00 00 00 00 00 00 00 00 04 f3 f3 f3
  0x10000d3bf580: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000d3bf590: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 00 00
=>0x10000d3bf5a0: 00 00 00 00 00 00 00 00[f3]f3 f3 f3 00 00 00 00
  0x10000d3bf5b0: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00
  0x10000d3bf5c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000d3bf5d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000d3bf5e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000d3bf5f0: 00 f2 f2 f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:          00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:      fa
  Freed heap region:      fd
  Stack left redzone:      f1
  Stack mid redzone:      f2
  Stack right redzone:    f3
  Stack after return:      f5
  Stack use after scope:  f8
  Global redzone:          f9
  Global init order:      f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:          fe
  Left alloca redzone:    ca
  Right alloca redzone:    cb
  Shadow gap:              cc


Nick January 16, 2022 23:49

Quote:

Originally Posted by mariari (Post 157042)
I got the game to compile fine on Linux, however it seems if I try to press !, or { (inscribe then select any item) the game crashes with the message given in the below code snippet .

Looks to me like
Code:

    /* Paranoia -- Clip the default entry */
    buf[len] = '\0';

should be
Code:

    /* Paranoia -- Clip the default entry */
    buf[len - 1] = '\0';

(util.c line 2720). Or potentially you could use different call parameters in line 979 of obj.c, but that still leaves it open for error in other calls.

mariari January 17, 2022 00:57

Quote:

Originally Posted by Nick (Post 157043)
Looks to me like
Code:

    /* Paranoia -- Clip the default entry */
    buf[len] = '\0';

should be
Code:

    /* Paranoia -- Clip the default entry */
    buf[len - 1] = '\0';

(util.c line 2720). Or potentially you could use different call parameters in line 979 of obj.c, but that still leaves it open for error in other calls.

Yeah That seems to fix the two errors I've encountered.

I've since got other people to compile the game, and seems if they ran the make file without any options, the commands work, but pref crashes when you hit enter.

However when they do compile with
Code:

./configure SANITIZE_FLAGS=-fsanitize=address --with-no-install
This error happens for them, I'm guessing without fsantize=adresss the game just sees the errors writes to the memory location that is out of bounds and continues on. Should I make a pull request with this on the repo, it seems to lack any sort of issue tracking.

Thank you once again

smbhax January 17, 2022 09:38

Quote:

Originally Posted by smbhax (Post 156910)
Not sure why Vanilla and Frog haven't updated their config settings to detect ncurses/w 6 as well as 5, though.

Ah, Vanilla is detecting ncurses6 now. : )


All times are GMT +1. The time now is 01:57.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.