Bitcoin Forum
May 06, 2024, 02:42:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they believe that the creator of this topic displays some red flags which make them high-risk. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [28] 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  Print  
Author Topic: Nxt source code flaw reports  (Read 113306 times)
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 06, 2014, 03:54:50 PM
 #541

A SIGTERM shouldn't corrupt anything?

No idea, I prefer BareMetal OS. I don't like interface with a lot of icons.
1714963349
Hero Member
*
Offline Offline

Posts: 1714963349

View Profile Personal Message (Offline)

Ignore
1714963349
Reply with quote  #2

1714963349
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
jkoil
Hero Member
*****
Offline Offline

Activity: 834
Merit: 524


Nxt NEM


View Profile
January 06, 2014, 05:17:04 PM
Last edit: January 06, 2014, 05:51:44 PM by jkoil
 #542

What information transactions.nxt contains?

Blockchain Explorer shows just timestamp, numbers, IDs for a transaction,
but transactions.nxt contain also names and http addresses.
Eg. "warhorse", "http://google.com", "paperwallet", "darkwallet", "cloudwallet", ...




gsan1
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
January 06, 2014, 06:00:13 PM
 #543

Line 6707:

Code:
counter++;
if (counter >= 255) {

    break;

}

Why is there a counter, so that only 255 transactions get returned? I know that this is the maximum amount of transactions in a block, but there is no reason why I could get more unconfirmed transactions by another peer, isn't it?
nexern
Hero Member
*****
Offline Offline

Activity: 597
Merit: 500



View Profile
January 06, 2014, 06:03:58 PM
 #544

What information transactions.nxt contains?

Blockchain Explorer shows just timestamp, numbers, IDs for a transaction,
but transactions.nxt contain also names and http addresses.
Eg. "warhorse", "http://google.com", "paperwallet", "darkwallet", "cloudwallet", ...


these are attached aliases
ferment
Full Member
***
Offline Offline

Activity: 168
Merit: 100


IDEX - LIVE Real-time DEX


View Profile
January 06, 2014, 06:30:54 PM
 #545

A SIGTERM shouldn't corrupt anything?

No idea, I prefer BareMetal OS. I don't like interface with a lot of icons.

SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process.

Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 06, 2014, 06:52:03 PM
 #546

Line 6707:

Code:
counter++;
if (counter >= 255) {

    break;

}

Why is there a counter, so that only 255 transactions get returned? I know that this is the maximum amount of transactions in a block, but there is no reason why I could get more unconfirmed transactions by another peer, isn't it?

This is to limit volume of data sent between nodes.
ricot
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 06, 2014, 06:56:08 PM
 #547

A SIGTERM shouldn't corrupt anything?

No idea, I prefer BareMetal OS. I don't like interface with a lot of icons.

SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process.

Taking a short look at the code, totally possible that it messes up everything.
Usually, you'd first write to a temporary file, and when it's finished you'd move it in place and therefore overwrite the old one, since that's only one atomic operation...
In case the process ends while writing, you just have a half-written temporary lying around.
This client doesn't do the moving thing, so as soon as you SIGKILL or even SIGTERM it while it's writing, it's in a bad state.
LiQio
Legendary
*
Offline Offline

Activity: 1181
Merit: 1002



View Profile
January 06, 2014, 07:24:40 PM
 #548

hey ricot, thanks a lot for your work - just sent you a beer! cheers!
ferment
Full Member
***
Offline Offline

Activity: 168
Merit: 100


IDEX - LIVE Real-time DEX


View Profile
January 06, 2014, 08:14:13 PM
Last edit: January 06, 2014, 08:38:10 PM by ferment
 #549

A SIGTERM shouldn't corrupt anything?

No idea, I prefer BareMetal OS. I don't like interface with a lot of icons.

SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process.

Taking a short look at the code, totally possible that it messes up everything.
Usually, you'd first write to a temporary file, and when it's finished you'd move it in place and therefore overwrite the old one, since that's only one atomic operation...
In case the process ends while writing, you just have a half-written temporary lying around.
This client doesn't do the moving thing, so as soon as you SIGKILL or even SIGTERM it while it's writing, it's in a bad state.

Ok... brushed up on my Java and dove in:

Code:
	@Override
public void destroy() {

scheduledThreadPool.shutdown();
cachedThreadPool.shutdown();

try {

Block.saveBlocks("blocks.nxt");

} catch (Exception e) { }
try {

Transaction.saveTransactions("transactions.nxt");

} catch (Exception e) { }

try {

blockchainChannel.close();

} catch (Exception e) { }

logMessage("Nxt stopped.");

}

}

Since scheduledThreadPool.shutdown() (and cachedThreadPool) doesn't wait for the threads to actually finish before returning, it might create a condition where saveBlocks blocks the threads that are trying to shutdown due to the synchronized on blocks. So it might be possible for destroy() to exit before the thread pools have completely shutdown, which could cause corruption of blocks.nxt if something bad happens in the threads.

The fix is to call awaitTermination on the threadpools before call Block.saveBlocks.

Jean-Luc
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250



View Profile WWW
January 06, 2014, 08:45:12 PM
 #550

The fix is to call awaitTermination on the threadpools before call Block.saveBlocks.
This has been fixed since 0.4.9e. Waiting up to 10 s, then shutdownNow.

lead Nxt developer, gpg key id: 0x811D6940E1E4240C
Nxt blockchain platform | Ardor blockchain platform | Ignis ICO
ferment
Full Member
***
Offline Offline

Activity: 168
Merit: 100


IDEX - LIVE Real-time DEX


View Profile
January 06, 2014, 09:30:03 PM
 #551

The fix is to call awaitTermination on the threadpools before call Block.saveBlocks.
This has been fixed since 0.4.9e. Waiting up to 10 s, then shutdownNow.


Guess that's not what is killing 80% of my nodes. heh.

klee
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000



View Profile
January 06, 2014, 09:31:04 PM
 #552

smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.

FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 06, 2014, 09:38:44 PM
 #553

smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.

FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K

What about FrictionlessCoin? Grin
klee
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000



View Profile
January 06, 2014, 09:47:21 PM
 #554

smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.

FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K

What about FrictionlessCoin? Grin
I will pay him in his scamcoin Tongue
utopianfuture
Sr. Member
****
Offline Offline

Activity: 602
Merit: 268

Internet of Value


View Profile
January 06, 2014, 09:47:43 PM
 #555

smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.

FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K

That's great klee. I hope you would be NXT billionaire in two years. Don't forget to helicopter me to your private island at that time  Grin  


░░░░░░▄▄▄████████▄▄▄
░░░░▄████████████████▄
░░▄███████████████████▄
███████████████████████
▐████████████████████████▌
█████████████████████████
█████████████████████████
█████████████████████████
▐██████████████████████▌
████████████████████████
░░▀████████████████████▀
░░░░▀████████████████▀
░░░░░░▀▀▀████████▀▀▀
  TomoChain  •    •  TomoChain 
░░░░░░▄▄▄████████▄▄▄
░░░░▄████████████████▄
░░▄███████████████████▄
███████████████████████
▐████████████████████████▌
█████████████████████████
█████████████████████████
█████████████████████████
▐██████████████████████▌
████████████████████████
░░▀████████████████████▀
░░░░▀████████████████▀
░░░░░░▀▀▀████████▀▀▀
klee
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000



View Profile
January 06, 2014, 09:48:26 PM
 #556

Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K


Is this for real?!?   Shocked    TRULY APPRECIATED!   Grin


...address is in my signature...



Check!
klee
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000



View Profile
January 06, 2014, 09:49:09 PM
 #557

smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.

FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K

That's great klee. I hope you would be NXT billionaire in two years. Don't forget to helicopter me to your private island at that time  Grin  
You will be in my VIP list  Cool Cheesy Tongue
BloodyRookie
Hero Member
*****
Offline Offline

Activity: 687
Merit: 500


View Profile
January 06, 2014, 09:52:40 PM
 #558

smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.

FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K

Hey, I am a nice guy too Cheesy

Nothing Else Matters
NEM: NALICE-LGU3IV-Y4DPJK-HYLSSV-YFFWYS-5QPLYE-ZDJJ
NXT: 11095639652683007953
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 06, 2014, 09:58:42 PM
 #559


Hey CfB... ricot helped me put my concerns from my previous post into perspective...

https://bitcointalk.org/index.php?topic=397183.msg4342184#msg4342184


Would it be more secure for the network if all initial founding accounts were restricted from forging (after funds have been transferred in other accounts of course)?



It changes nothing.
instacalm
Hero Member
*****
Offline Offline

Activity: 798
Merit: 500



View Profile
January 06, 2014, 10:05:41 PM
 #560

smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.

FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts...

ricot : 100K
ImmortAlex :50K
vamdor: 50K
rlh: 50K
smaragda: 50K

Greetings to sunny Greece. Grin

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [28] 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!