Work-around to declare Unknown accounts?

80 views
Skip to first unread message

Charles Merriam

unread,
Sep 20, 2013, 1:51:05 AM9/20/13
to ledge...@googlegroups.com
Hello All,

I'm trying to use --pedantic and finding the problem with declaring the 'Unknown' account.

If I declare this account with the usual line:

     account Unknown

I get a Segmentation Fault 11 on my OS/X version of ledger.   If I comment the line out, I get an 'Error:  Unknown Account' error. 

Anyone found a work around?

Charles

--
for the curious, the seg fault is somewhere in register_account/journal.cc

Process:         ledger [5126]
Path:            /usr/local/bin/ledger
Identifier:      ledger
Version:         0
Code Type:       X86-64 (Native)
Parent Process:  bash [430]
User ID:         501

Date/Time:       2013-09-19 22:42:15.073 -0700
OS Version:      Mac OS X 10.8.5 (12F37)
Report Version:  10

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000001b8

VM Regions Near 0x1b8:
--> 
    __TEXT                 000000010106a000-00000001016ef000 [ 6676K] r-x/rwx SM=COW  /usr/local/bin/ledger

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   ledger                         0x0000000101297b18 ledger::journal_t::register_account(std::string const&, ledger::post_t*, ledger::account_t*) + 1768 (journal.cc:154)
1   ledger                         0x00000001012553a9 ledger::(anonymous namespace)::instance_t::account_directive(char*) + 295 (textual.cc:907)
2   ledger                         0x000000010126e175 ledger::(anonymous namespace)::instance_t::general_directive(char*) + 289 (textual.cc:1247)
3   ledger                         0x000000010126f2b6 ledger::(anonymous namespace)::instance_t::read_next_directive(bool&) + 1498 (textual.cc:381)
4   ledger                         0x000000010126cee5 ledger::(anonymous namespace)::instance_t::parse() + 519 (textual.cc:249)
5   ledger                         0x000000010126be38 ledger::(anonymous namespace)::instance_t::include_directive(char*) + 5174 (textual.cc:785)
...
---
and the account.led file offending line, about 400 lines in is:
...
account Transfer:Visa

;account Unknown
account Unknown:Amazon
  payee ^AMAZON MKTPLACE
  payee ^AMAZON.COM
account Unknown:PayPal
....

John Wiegley

unread,
Sep 20, 2013, 1:57:45 AM9/20/13
to ledge...@googlegroups.com
>>>>> Charles Merriam <charles...@gmail.com> writes:

> I'm trying to use --pedantic and finding the problem with declaring the
> 'Unknown' account.

> If I declare this account with the usual line:

> account Unknown

> I get a Segmentation Fault 11 on my OS/X version of ledger. If I comment
> the line out, I get an 'Error: Unknown Account' error.

I just pushed a possible fix for this. Can you try? "Unknown" has special
meaning for account names in some places, so you are triggering code paths
that have never been used in this context.

Thanks, John

Charles Merriam

unread,
Sep 20, 2013, 5:22:01 PM9/20/13
to ledge...@googlegroups.com
Here's the accounts.led file. It should fail with a 'ledger -f
accounts0918.led bal' -- Charles
> --
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/knbVQf4wBiU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
accounts0918.led
Reply all
Reply to author
Forward
0 new messages