Bug #540

pstext: problem parsing wrong -F options

Added by Eduardo about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:2014-04-16
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:Linux

Description

In Linux 64 bits, if I make a mistake and do

echo '0 0 A' | pstext -R-1/1/-1/1 -Jx1 -B1 -F+a0+fBC+j12p,Helvetica,black > out.ps

pstext: Warning: B not a valid number and may not be decoded properly.
pstext: Representation of font size not recognised. Using default.
ERROR: Caught signal number 11 (Segmentation fault) at
/lib/x86_64-linux-gnu/libc.so.6(IO_vfprintf+0x44c2)[0x7ff742150b42]
[0xc]
Stack backtrace:
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(sig_handler+0x13c)[0x7ff744611c1c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf030)[0x7ff7424a3030]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x44c2)[0x7ff742150b42]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libpsl.so.5(PSL_command+0x96)[0x7ff744aefe46]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libpsl.so.5(PSL_plottext+0xda5)[0x7ff744afa2e5]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(GMT_pstext+0x1b6a)[0x7ff74481700a]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(GMT_Call_Module+0x151)[0x7ff7446157f1]
pstext(main+0x274)[0x400fc4]
/lib/x86_64-linux-gnu/libc.so.6(
_libc_start_main+0xfd)[0x7ff742127ead]
pstext[0x400c69]

Running with valgrind

8103 Memcheck, a memory error detector
8103 Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
8103 Using Valgrind-3.7.0 and LibVEX; rerun with h for copyright info
8103 Command: pstext -R-1/1/-1/1 -Jx1 -B1 -F+a0+fBC+j12p,Helvetica,black
8103
vex amd64
>IR: unhandled instruction bytes: 0xC5 0xFB 0x10 0x83 0x60 0xB8 0x12 0x0
8103 valgrind: Unrecognised instruction at address 0x4f69442.
8103 at 0x4F69442: gmt_set_distaz (gmt_map.c:7988)
8103 by 0x4F69826: GMT_init_distaz (gmt_map.c:8143)
8103 by 0x4F416AD: New_GMT_Ctrl (gmt_init.c:9964)
8103 by 0x4F4514F: GMT_begin (gmt_init.c:10075)
8103 by 0x4E8F050: GMT_Create_Session (gmt_api.c:3292)
8103 by 0x400E1A: main (gmt.c:71)
8103 Your program just tried to execute an instruction that Valgrind
8103 did not recognise. There are two possible reasons for this.
8103 1. Your program has a bug and erroneously jumped to a non-code
8103 location. If you are running Memcheck and you just saw a
8103 warning about a bad jump, it's probably your program's fault.
8103 2. The instruction is legitimate but Valgrind doesn't handle it,
8103 i.e. it's Valgrind's fault. If you think this is the case or
8103 you are not sure, please let us know and we'll try to fix it.
8103 Either way, Valgrind will now raise a SIGILL signal which will
8103 probably kill your program.
ERROR: Caught signal number 4 (Illegal instruction) at
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(gmt_set_distaz+0x2f2)[0x4f69442]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(gmt_set_distaz+0x2f2)[0x4f69442]
Stack backtrace:
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(sig_handler+0x13c)[0x4e7ec1c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf030)[0x709b030]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(gmt_set_distaz+0x2f2)[0x4f69442]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(GMT_init_distaz+0x177)[0x4f69827]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(New_GMT_Ctrl+0x17e)[0x4f416ae]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(GMT_begin+0x30)[0x4f45150]
/opt/apps/GMT/GMT-5-testing/bin/../lib/x86_64-linux-gnu/libgmt.so.5(GMT_Create_Session+0x81)[0x4e8f051]
pstext(main+0xcb)[0x400e1b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x72c6ead]
pstext[0x400c69]
8103
8103 HEAP SUMMARY:
8103 in use at exit: 1,245,707 bytes in 48 blocks
8103 total heap usage: 100 allocs, 52 frees, 1,289,583 bytes allocated
8103
8103 LEAK SUMMARY:
8103 definitely lost: 0 bytes in 0 blocks
8103 indirectly lost: 0 bytes in 0 blocks
8103 possibly lost: 0 bytes in 0 blocks
8103 still reachable: 1,245,707 bytes in 48 blocks
8103 suppressed: 0 bytes in 0 blocks
8103 Rerun with --leak-check=full to see details of leaked memory
8103
8103 For counts of detected and suppressed errors, rerun with: -v
8103 ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 32 from 6)

Associated revisions

Revision 13066
Added by Paul about 3 years ago

Address issue #540

History

#1 Updated by Paul about 3 years ago

  • Status changed from New to Resolved

Problem was that +j12p,... was taken as the justification value 12, which is outside 1-11 range but no check was applied. I've added that check so it would default to LB if a bad integer is given. In r13066. let me know if crash is gone.

#2 Updated by Eduardo about 3 years ago

It works for me

echo '0 0 A' | pstext -R-1/1/-1/1 -Jx1 -B1 -F+a0+fBC+j12p,Helvetica,black > out.ps
pstext: Warning: B not a valid number and may not be decoded properly.
pstext: Representation of font size not recognised. Using default.
pstext: Record 0 had bad justification info (set to LB)

gmt --version
5.1.2_r13066

Close it!

#3 Updated by Paul about 3 years ago

  • Status changed from Resolved to Closed

Done with this one.

Also available in: Atom PDF