Feature request: sum-file checker & updater

Announcements and discussion regarding any projects related to Cyan Worlds' Plasma Engine including (but not limited to) CyanWorlds.com Engine, Drizzle, OfflineKI, PyPRP, and libHSPlasma.

Re: Feature request: sum-file checker & updater

Postby diafero » Tue Jul 14, 2009 4:14 am

I did not install libPlasma and never did, I am directly running the build. I don't see the need to have the binaries twice on my system, I prefer adding that bin dir to the path :D
I could try getting a backtrace if you told me how to enable debug information :)
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2806
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Feature request: sum-file checker & updater

Postby Paradox » Tue Jul 14, 2009 11:05 am

What usually works for me is simply
Code: Select all
make
sudo make install
gdb [program]
gdb> run


Don't seem to need specific debug symbols ;)
"And one day I woke to find the future held no place for me. I was unwanted in a world, that with my hands I'd helped to build. Where once was honesty and pride, I now stand broken and alone."
User avatar
Paradox
 
Posts: 1259
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Feature request: sum-file checker & updater

Postby Zrax » Tue Jul 14, 2009 11:34 am

In the Linux build, debug information is added by default (since Linux is where I do most of my libPlasma debugging)... If you wanted to build with optimization and no debugging, you would just need to remove the -g option and add -O2 to the CXXFLAGS in the makefiles. As paradox pointed out, you can just start it from GDB and run it from there to get a backtrace; just make sure you specify the arguments with the "set args" command in GDB, or it'll run without any arguments, which won't help much ;)
User avatar
Zrax
 
Posts: 202
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: Feature request: sum-file checker & updater

Postby diafero » Sat Jul 18, 2009 12:24 am

The stackdump does not tell me much:

Code: Select all
(gdb) set args Ahnonay.sum
(gdb) run
Starting program: /home/diafero/src/Plasma/Plasma/bin/PlasmaSum Ahnonay.sum
Ahnonay.sum:
  7c6eb9f3a335c1795ff473b8901b80b8  2004/05/26 17:38:36  dat\Ahnonay_District_BuiltIn.prp
*** stack smashing detected ***: /home/diafero/src/Plasma/Plasma/bin/PlasmaSum terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7a54da8]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7a54d60]
/home/diafero/src/Plasma/Plasma/bin/libPlasma.so[0xb7e692f4]
/home/diafero/src/Plasma/Plasma/bin/libPlasma.so(_ZN5plMD510hashStreamEP8hsStream+0x1c6)[0xb7d1a6b6]
[0x0]
======= Memory map: ========
08048000-0804f000 r-xp 00000000 08:07 1898277    /home/diafero/src/Plasma/Plasma/bin/PlasmaSum
0804f000-08050000 r--p 00007000 08:07 1898277    /home/diafero/src/Plasma/Plasma/bin/PlasmaSum
08050000-08051000 rw-p 00008000 08:07 1898277    /home/diafero/src/Plasma/Plasma/bin/PlasmaSum
092b1000-092d2000 rw-p 092b1000 00:00 0          [heap]
b7956000-b7957000 rw-p b7956000 00:00 0
b7957000-b7ab3000 r-xp 00000000 08:05 525641     /lib/tls/i686/cmov/libc-2.9.so
b7ab3000-b7ab4000 ---p 0015c000 08:05 525641     /lib/tls/i686/cmov/libc-2.9.so
b7ab4000-b7ab6000 r--p 0015c000 08:05 525641     /lib/tls/i686/cmov/libc-2.9.so
b7ab6000-b7ab7000 rw-p 0015e000 08:05 525641     /lib/tls/i686/cmov/libc-2.9.so
b7ab7000-b7aba000 rw-p b7ab7000 00:00 0
b7aba000-b7ac7000 r-xp 00000000 08:05 507969     /lib/libgcc_s.so.1
b7ac7000-b7ac8000 r--p 0000c000 08:05 507969     /lib/libgcc_s.so.1
b7ac8000-b7ac9000 rw-p 0000d000 08:05 507969     /lib/libgcc_s.so.1
b7ac9000-b7aed000 r-xp 00000000 08:05 525649     /lib/tls/i686/cmov/libm-2.9.so
b7aed000-b7aee000 r--p 00023000 08:05 525649     /lib/tls/i686/cmov/libm-2.9.so
b7aee000-b7aef000 rw-p 00024000 08:05 525649     /lib/tls/i686/cmov/libm-2.9.so
b7aef000-b7af0000 rw-p b7aef000 00:00 0
b7af0000-b7bd4000 r-xp 00000000 08:05 1060350    /usr/lib/libstdc++.so.6.0.10
b7bd4000-b7bd8000 r--p 000e3000 08:05 1060350    /usr/lib/libstdc++.so.6.0.10
b7bd8000-b7bd9000 rw-p 000e7000 08:05 1060350    /usr/lib/libstdc++.so.6.0.10
b7bd9000-b7bdf000 rw-p b7bd9000 00:00 0
b7bf2000-b7bf7000 rw-p b7bf2000 00:00 0
b7bf7000-b7ee3000 r-xp 00000000 08:07 1897111    /home/diafero/src/Plasma/Plasma/bin/libPlasma.so
b7ee3000-b7eeb000 r--p 002eb000 08:07 1897111    /home/diafero/src/Plasma/Plasma/bin/libPlasma.so
b7eeb000-b7efc000 rw-p 002f3000 08:07 1897111    /home/diafero/src/Plasma/Plasma/bin/libPlasma.so
b7efc000-b7efe000 rw-p b7efc000 00:00 0
b7efe000-b7eff000 r-xp b7efe000 00:00 0          [vdso]
b7eff000-b7f1b000 r-xp 00000000 08:05 507927     /lib/ld-2.9.so
b7f1b000-b7f1c000 r--p 0001b000 08:05 507927     /lib/ld-2.9.so
b7f1c000-b7f1d000 rw-p 0001c000 08:05 507927     /lib/ld-2.9.so
bf908000-bf91d000 rw-p bffeb000 00:00 0          [stack]

Program received signal SIGABRT, Aborted.
0xb7efe430 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7efe430 in __kernel_vsyscall ()
#1  0xb79826d0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7984098 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb79c024d in ?? () from /lib/tls/i686/cmov/libc.so.6
#4  0xb7a54da8 in __fortify_fail () from /lib/tls/i686/cmov/libc.so.6
#5  0xb7a54d60 in __stack_chk_fail () from /lib/tls/i686/cmov/libc.so.6
#6  0xb7e692f4 in __stack_chk_fail_local () from /home/diafero/src/Plasma/Plasma/bin/libPlasma.so
#7  0xb7d1a6b6 in plMD5::hashStream (S=0x92b11a0) at Util/plMD5.cpp:262
#8  0x00000000 in ?? ()


What is also strange is that when I tell it to read a non-existing sum file it says "Stream/plEncryptedStream.cpp:275: Error reading file: Read past end of stream" which is not really a useful error message in this case ;-)
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2806
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Feature request: sum-file checker & updater

Postby Zrax » Sat Jul 18, 2009 6:53 pm

Well, this was not an easy bug to track down, since neither valgrind nor gdb were being very helpful, but I did finally find the problem and fix it. I also added a check for opening a non-existant .sum files, so the error is a little more meaningful now ;)
User avatar
Zrax
 
Posts: 202
Joined: Fri Sep 28, 2007 5:19 pm
Location: Waist-deep in a conecano

Re: Feature request: sum-file checker & updater

Postby diafero » Sun Jul 19, 2009 7:31 am

Thank you very much, I will check it when I am back home :)

Btw, you got a PM :D
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2806
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Feature request: sum-file checker & updater

Postby diafero » Mon Jul 20, 2009 8:48 am

Ok, it works now :-)

However (yeah, I am complaining too much...), it seems the tool also accepts sum files in which "filename.prp" is saved instead of "dat\filename.prp" - TPOTS will not accept this though, it will complain about missing or invalid files.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2806
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Feature request: sum-file checker & updater

Postby Tsar Hoikas » Mon Jul 20, 2009 9:11 am

diafero wrote:Ok, it works now :-)

However (yeah, I am complaining too much...), it seems the tool also accepts sum files in which "filename.prp" is saved instead of "dat\filename.prp" - TPOTS will not accept this though, it will complain about missing or invalid files.


filename.prp is required by ABM/UU
Image
User avatar
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 1887
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Feature request: sum-file checker & updater

Postby diafero » Mon Jul 20, 2009 1:07 pm

Great... what about a command line switch to change behaviour? Currently it accepts both.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2806
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Feature request: sum-file checker & updater

Postby Chacal » Sat Nov 19, 2011 5:58 pm

Sorry for resurrecting this old thread, but for anyone searching about this issue, it has been resolved for some time.
Plasmasum now accepts the -old parameter. For example:

I:\libplasma\plasmasum.exe -c -old -i I:\POTS\dat\Ahnonay_District_BuiltIn.prp I:\POTS\dat\ahnonay.sum

This will add this line to the sum file:
7c6eb9f3a335c1795ff473b8901b80b8 2004/05/26 16:38:36 Ahnonay_District_BuiltIn.prp

Without the -old parameter, it adds this line:
7c6eb9f3a335c1795ff473b8901b80b8 2004/05/26 16:38:36 dat\Ahnonay_District_BuiltIn.prp

Also, by reading the source I finally understood how the "-c" parameter works.
Plasmasum usage is as follows:
Usage: plasmasum.exe [options] sumfile [...]

Code: Select all
Options:
    -L        List the contents of the sumfile
    -c        Create a new sumfile (or overwrite one if it already exists)
    -i path   Insert `path` into the sumfile (or re-hash if it exists)
    -d path   Remove `path` from the sumfile
    -y        Answer YES to delete prompts
    -old      Use the older (pre-Path of the Shell) format

If no options are specified, the default is to re-sum the contents of `sumfile`

The -c parameter only works with -i. It does NOT create a new, empty file when used by itself.
It only prevents an error when trying to insert a new `path` into a sumfile that does not exist, or when the `path` already exists in the sumfile.

So the correct syntax for building a brand new sumfile seems to be this:
' Create the file if it doesn't exist, or overwrite if it does, then add the first line in it
I:\libplasma\plasmasum.exe -c -i I:\POTS\dat\Ahnonay_District_BuiltIn.prp I:\POTS\dat\ahnonay.sum
' then add a second line
I:\libplasma\plasmasum.exe -i I:\POTS\dat\Ahnonay_District_Textures.prp I:\POTS\dat\ahnonay.sum
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
User avatar
Chacal
 
Posts: 2433
Joined: Tue Nov 06, 2007 2:45 pm
Location: Quebec, Canada

Previous

Return to Plasma Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest