I'll put this in another thread, apologies if this bothers anyone.

I explained that my application crashes without error messages under
certain conditions (when I ask it to provide reports about stock
evolution over several periods).

The app source contains logging statements, and I just added some to try
and figure out where it is crashing.

The relevant piece of code is in attachment code.c (not inlined in this
mail because all the lines wrap), the logfile is in log.txt .

The application is crashing in a line that basically prints log info.
I've written a couple of lines before it printing out all the info that
get printed in the offending statement. The separate print statements
work, the combined one crashes the application.

This is also what happens under gdb : the application crashes when in
the line
        Log(STATUS_LOG, "Value Change %d - %d -> [%s]\r\n",
                value, prevValue, valval);
The output of a gdb session is also attached.

Bright (and other) ideas are most welcome.

        Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
PocketInvest initialising
InitCommonControlsEx Error [Cannot create a file when that file already exists.
]
SHCreateMenuBar -> 0x3cc250     Error [This function is only valid in Win32 
mode.
]
SHSipInfo       Error [Cannot create a file when that file already exists.
]
Yow 1   Error [The parameter is incorrect.
]
Yow 2   Error [Cannot create a file when that file already exists.
]
Yow 3
Error [This function is only valid in Win32 mode.
]
Yow 4
Error [Cannot create a file when that file already exists.
]
Yow 5
Error [Cannot create a file when that file already exists.
]
Yow 6
Error [Cannot create a file when that file already exists.
]
1 -     LOG:    General W 0x3c8470


Yow 7
Error [Cannot create a file when that file already exists.
]
2 -     LOG:    Restoring state from file [/Application 
data/PocketInvest/PocketInvest.ini] .

Yow 8
Error [This function is only valid in Win32 mode.
]
Yow 9
Error [Cannot create a file when that file already exists.
]
Yow 10
Error [The handle is invalid.
]
3 -     LOG:    PaneProc


4 -     LOG:    DoButtonClick(0x3d4490)


5 -     LOG:    SetActiveAccount(9)


6 -     LOG:    Run periods 1984 scope 6 flags 3


7 -     LOG:    RunReport (6, 1984, 3)


8 -     LOG:    GuiInitProgressBar(2700)


9 -     LOG:    ReportExportOk: accounts 6 (36) times 1984 (5)


10 -     LOG:   GuiShowProgressBar(1)


11 -     LOG:   GuiShowProgressBar(2)


12 -     LOG:   GuiShowProgressBar(3)


13 -     LOG:   ReportExportTimeVal(acc 2) time 6


14 -     LOG:   rate_price -> 1214.680000


15 -     LOG:   rate_price -> prev 1214.680000


16 -     LOG:   daymax -> 148401
daymin -> 147671
value     -> 4373.410000
prevalue  -> 4373.410000
cost      -> 3383.760000
precost   -> 3383.760000
debit     -> 0.000000
predebit  -> 0.000000
fee       -> 0.000000
prefee    -> 0.000000
distrib   -> 0.000000
predistrib-> 0.000000
shares    -> 989.650000


17 -     LOG:   ../../src/report.c - 524


18 -     LOG:   ../../src/report.c - 529


19 -     LOG:   ../../src/report.c - 531


20 -     LOG:   ../../src/report.c - 565


21 -     LOG:   ../../src/report.c - 567


22 -     LOG:   ../../src/report.c - 569


23 -     LOG:   ../../src/report.c - 571


24 -     LOG:   ../../src/report.c - 573


25 -     LOG:   GuiShowProgressBar(4)


26 -     LOG:   ../../src/report.c - 575


27 -     LOG:   ../../src/report.c - 580


28 -     LOG:   ../../src/report.c - 585


29 -     LOG:   ../../src/report.c - 587


30 -     LOG:   ../../src/report.c - 589


31 -     LOG:   Value Change - a -171798692


32 -     LOG:   Value Change - b -171798692


33 -     LOG:   Value Change - c1 0x2204ea58


34 -     LOG:   Value Change - c2 $0.00


				/* Transaction details line 1 */

				if (reportValue & REPORT_DETAIL_ON) {
				Log(STATUS_LOG, "%s - %d\n", __FILE__, __LINE__);
					/* 
					** delta VALUE - VALUE CHANGE
					*/
					inc_x = 20; 
				Log(STATUS_LOG, "%s - %d\n", __FILE__, __LINE__);
					strcpy (valhdr, getResource(reportResource, REPDVALUE));
				Log(STATUS_LOG, "%s - %d\n", __FILE__, __LINE__);
					sprintf (valval, "%.20s", utilCurrOut(value-prevValue, UTILCURR));
				Log(STATUS_LOG, "%s - %d\n", __FILE__, __LINE__);
					Log(STATUS_LOG, "Value Change - a %d\n", value);
					Log(STATUS_LOG, "Value Change - b %d\n", prevValue);
					Log(STATUS_LOG, "Value Change - c1 %p\n", valval);
					Log(STATUS_LOG, "Value Change - c2 %s\n", valval);
					Log(STATUS_LOG, "Value Change %d - %d -> [%s]\r\n",
							value, prevValue, valval);
				Log(STATUS_LOG, "%s - %d\n", __FILE__, __LINE__);
					reportRenderText (valhdr, valval, inc_x, True, NULL, report, fp);
				Log(STATUS_LOG, "%s - %d\n", __FILE__, __LINE__);
					GuiShowProgressBar();
				Log(STATUS_LOG, "%s - %d\n", __FILE__, __LINE__);
dannypc: {284} arm-wince-cegcc-gdb PocketInvest.exe
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=arm-wince-cegcc"...
(gdb) l reportExportTimeVal
415     /*
416      * This function exports the same things as reportTimeVal does for
417      * on screen display. Keep them in sync !
418      */
419     static int reportExportTimeVal (int account, int report, FILE *fp)
420     {
421             int i, k; 
422     
423             double  price, value, shares, cost, debit, fee, distrib;
424             double  prevPrice, prevValue, prevShares, prevCost, prevDebit,
prevFee, prevDistrib;
(gdb) break 589
Breakpoint 1 at 0x1bc08: file ../../src/report.c, line 589.
(gdb) r
Starting program:
/home/danny/Hungry/xinvest/sunsite.dk/xinvest/build/PocketInvest/PocketInvest.exe 
[CeCreateFile:40] begin
[CeCreateFile:40] begin
Uploading to remote device: \gdb\wince-stub.exe
[CeWriteFile:115] begin
.....[CeWriteFile:115] begin
......[CeWriteFile:115] begin
......[CeWriteFile:115] begin
...
Starting on device: "\gdb\wince-stub.exe \gdb\wince-stub.exe"
[CeCreateProcess:37] last_error = 183
[CeCreateProcess:39] result = 1
Waiting for connection...
Connected
[CeCreateFile:40] begin
[CeCreateFile:40] begin
Uploading to remote device: \gdb\PocketInvest.exe
[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.[CeWriteFile:115] begin
[CeWriteFile:115] begin
.
[tcsetpgrp failed in terminal_inferior: Operation not permitted]
Process Created
Error while mapping shared library sections:
cegcc.dll: No such file or directory.
Error while mapping shared library sections:
shutil.dll: No such file or directory.
Error while mapping shared library sections:
tshres.dll: No such file or directory.
Error while mapping shared library sections:
commctrl.dll: No such file or directory.
Error while mapping shared library sections:
oleaut32.dll: No such file or directory.
Error while mapping shared library sections:
ossvcs.dll: No such file or directory.
Error while mapping shared library sections:
aygshell.dll: No such file or directory.
Error while mapping shared library sections:
ws2.dll: No such file or directory.
Error while mapping shared library sections:
iphlpapi.dll: No such file or directory.
Error while mapping shared library sections:
ole32.dll: No such file or directory.
Error while mapping shared library sections:
coredll.dll: No such file or directory.
warning: __init_c__: initted = 1
warning: "WCETRACE" not found in registry
warning: "WCETRACE_DEBUGGER" not found in registry
Error while mapping shared library sections:
compime.dll: No such file or directory.

Breakpoint 1, reportExportTimeVal (account=2, report=1, fp=0xb04e4)
at ../../src/report.c:589
589                                     Log(STATUS_LOG, "%s - %d\n",
__FILE__, __LINE__);
(gdb) n
590                                             Log(STATUS_LOG, "Value
Change - a %d\n", value);
(gdb) n
591                                             Log(STATUS_LOG, "Value
Change - b %d\n", prevValue);
(gdb) n
592                                             Log(STATUS_LOG, "Value
Change - c1 %p\n", valval);
(gdb) n
593                                             Log(STATUS_LOG, "Value
Change - c2 %s\n", valval);
(gdb) n
594                                             Log(STATUS_LOG, "Value
Change %d - %d -> [%s]\r\n",
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x01759370 in ?? ()
(gdb) where
#0  0x01759370 in ?? ()
(gdb) q

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to